diff lib/redmine/scm/adapters/mercurial/redminehelper.py @ 909:cbb26bc654de redmine-1.3

Update to Redmine 1.3-stable branch (Redmine SVN rev 8964)
author Chris Cannam
date Fri, 24 Feb 2012 19:09:32 +0000
parents cbce1fd3b1b7
children 433d4f72a19b
line wrap: on
line diff
--- a/lib/redmine/scm/adapters/mercurial/redminehelper.py	Fri Feb 24 18:36:29 2012 +0000
+++ b/lib/redmine/scm/adapters/mercurial/redminehelper.py	Fri Feb 24 19:09:32 2012 +0000
@@ -46,7 +46,7 @@
     </rhmanifest>
 """
 import re, time, cgi, urllib
-from mercurial import cmdutil, commands, node, error
+from mercurial import cmdutil, commands, node, error, hg
 
 _x = cgi.escape
 _u = lambda s: cgi.escape(urllib.quote(s))
@@ -146,7 +146,10 @@
     bra      = urllib.unquote_plus(opts.pop('rhbranch', None))
     from_rev = from_rev.replace('"', '\\"')
     to_rev   = to_rev.replace('"', '\\"')
-    opts['rev'] = ['"%s":"%s"' % (from_rev, to_rev)]
+    if hg.util.version() >= '1.6':
+      opts['rev'] = ['"%s":"%s"' % (from_rev, to_rev)]
+    else:
+      opts['rev'] = ['%s:%s' % (from_rev, to_rev)]
     opts['branch'] = [bra]
     return commands.log(ui, repo, *map(urllib.unquote_plus, pats), **opts)
 
@@ -196,21 +199,21 @@
                    [
                     ('r', 'rev', [], 'show the specified revision'),
                     ('b', 'branch', [],
-                       'show changesets within the given named branch', 'BRANCH'),
+                       'show changesets within the given named branch'),
                     ('l', 'limit', '',
-                         'limit number of changes displayed', 'NUM'),
+                         'limit number of changes displayed'),
                     ('d', 'date', '',
-                         'show revisions matching date spec', 'DATE'),
+                         'show revisions matching date spec'),
                     ('u', 'user', [],
-                      'revisions committed by user', 'USER'),
+                      'revisions committed by user'),
                     ('', 'from', '',
-                      '', ''),
+                      ''),
                     ('', 'to', '',
-                      '', ''),
+                      ''),
                     ('', 'rhbranch', '',
-                      '', ''),
+                      ''),
                     ('', 'template', '',
-                       'display with template', 'TEMPLATE')],
+                       'display with template')],
                    'hg rhlog [OPTION]... [FILE]'),
     'rhmanifest': (rhmanifest,
                    [('r', 'rev', '', 'show the specified revision')],