Alessio Caiazza is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

nolith / redmine-hg (patch queue to redmine)

NO LONGER USED. Please refer to https://bitbucket.org/nolith/redmine-mq-issue4455

Clone this repository and patch queue (size: 32.7 KB): HTTPS / SSH
hg qclone https://bitbucket.org/nolith/redmine-hg
hg qclone ssh://hg@bitbucket.org/nolith/redmine-hg

redmine-hg / fix_localization_issue.diff

Branch
default
# HG changeset patch
# 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
@@ -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]
+            %x{#{HG_BIN} --version}
           end
 
           def template_path