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