]> source.dussan.org Git - redmine.git/commitdiff
Merged r17474 from trunk to 3.3-stable (#29413).
authorGo MAEDA <maeda@farend.jp>
Sat, 25 Aug 2018 09:48:14 +0000 (09:48 +0000)
committerGo MAEDA <maeda@farend.jp>
Sat, 25 Aug 2018 09:48:14 +0000 (09:48 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@17476 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/mercurial/redminehelper.py

index d98ae5184e1e7cf59a4d7213faa125c8a179abc5..8097d905a6fde664327331293223ec29e085ed77 100644 (file)
@@ -46,15 +46,17 @@ Output example of rhmanifest::
     </rhmanifest>
 """
 import re, time, cgi, urllib
-from mercurial import cmdutil, commands, node, error, hg
+from mercurial import cmdutil, commands, node, error, hg, registrar
 
 cmdtable = {}
-command = cmdutil.command(cmdtable)
+command = registrar.command(cmdtable) if hasattr(registrar, 'command') else cmdutil.command(cmdtable)
 
 _x = cgi.escape
 _u = lambda s: cgi.escape(urllib.quote(s))
 
 def _changectx(repo, rev):
+    if isinstance(rev, str):
+       rev = repo.lookup(rev)
     if hasattr(repo, 'changectx'):
         return repo.changectx(rev)
     else: