# HG changeset patch # User Alessio Caiazza # Date 1268993442 -3600 # Node ID f9ecae6c34248e9be8f2f49c0db6bcb99f2d84cb # Parent d3fcc54339600b6cf660cc9394672c51d3720c84 LANG issue fix based on http://www.redmine.org/issues/5117#note-7 diff -r d3fcc54339600b6cf660cc9394672c51d3720c84 -r f9ecae6c34248e9be8f2f49c0db6bcb99f2d84cb fix_localization_issue.diff --- a/fix_localization_issue.diff Thu Mar 18 16:59:40 2010 +0100 +++ b/fix_localization_issue.diff Fri Mar 19 11:10:42 2010 +0100 @@ -1,20 +1,24 @@ # HG changeset patch -# Parent 23317322ebedf761be70f30f4dede0d71a98f0bd -if regexp fail try asking to python +# Parent a6584afedc88f0ec28e3d2d629b76fbcdb032221 +Assume that the version number is of the first line of the output. diff --git a/lib/redmine/scm/adapters/mercurial_adapter.rb b/lib/redmine/scm/adapters/mercurial_adapter.rb --- a/lib/redmine/scm/adapters/mercurial_adapter.rb +++ b/lib/redmine/scm/adapters/mercurial_adapter.rb -@@ -52,6 +52,12 @@ +@@ -45,13 +45,13 @@ + # release number (eg 0.9.5 or 1.0) or as a revision + # id composed of 12 hexa characters. + theversion = hgversion_from_command_line +- if theversion.match(/^\d+(\.\d+)+/) +- theversion.split(".").collect(&:to_i) ++ if m = theversion.match(/((\d+\.)+\d+)/) ++ theversion = m[0].scan(/\d+/).collect(&:to_i) + end + end def hgversion_from_command_line - %x{#{HG_BIN} --version}.match(/\(version (.*)\)/)[1] -+ rescue NoMethodError -+ hgversion_from_python -+ end -+ -+ def hgversion_from_python -+ %x{python -c "from mercurial import util; print util.version()"}.strip +- %x{#{HG_BIN} --version}.match(/\(version (.*)\)/)[1] ++ %x{#{HG_BIN} --version} end def template_path diff -r d3fcc54339600b6cf660cc9394672c51d3720c84 -r f9ecae6c34248e9be8f2f49c0db6bcb99f2d84cb fix_mercurial_localization_issue.diff --- a/fix_mercurial_localization_issue.diff Thu Mar 18 16:59:40 2010 +0100 +++ b/fix_mercurial_localization_issue.diff Fri Mar 19 11:10:42 2010 +0100 @@ -1,20 +1,24 @@ # HG changeset patch # Parent 0dc60afda5722afecf6f7fc5c13552d3f008bdf2 -if regexp fail try asking to python +Assume that the version number is of the first line of the output. diff --git a/lib/redmine/scm/adapters/mercurial_adapter.rb b/lib/redmine/scm/adapters/mercurial_adapter.rb --- a/lib/redmine/scm/adapters/mercurial_adapter.rb +++ b/lib/redmine/scm/adapters/mercurial_adapter.rb -@@ -45,6 +45,12 @@ +@@ -38,13 +38,13 @@ + # release number (eg 0.9.5 or 1.0) or as a revision + # id composed of 12 hexa characters. + theversion = hgversion_from_command_line +- if theversion.match(/^\d+(\.\d+)+/) +- theversion.split(".").collect(&:to_i) ++ if m = theversion.match(/((\d+\.)+\d+)/) ++ theversion = m[0].scan(/\d+/).collect(&:to_i) + end + end def hgversion_from_command_line - %x{#{HG_BIN} --version}.match(/\(version (.*)\)/)[1] -+ rescue NoMethodError -+ hgversion_from_python -+ end -+ -+ def hgversion_from_python -+ %x{python -c "from mercurial import util; print util.version()"}.strip +- %x{#{HG_BIN} --version}.match(/\(version (.*)\)/)[1] ++ %x{#{HG_BIN} --version} end def template_path