From 565c4ed12807c00ef81967bf540b0caf09d8a057 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sat, 25 Aug 2018 09:48:14 +0000 Subject: [PATCH] Merged r17474 from trunk to 3.3-stable (#29413). 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/redmine/scm/adapters/mercurial/redminehelper.py b/lib/redmine/scm/adapters/mercurial/redminehelper.py index d98ae5184..8097d905a 100644 --- a/lib/redmine/scm/adapters/mercurial/redminehelper.py +++ b/lib/redmine/scm/adapters/mercurial/redminehelper.py @@ -46,15 +46,17 @@ Output example of 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: -- 2.39.5