From 9709f8f364e1d05003b3016937ba3590db1dcdb5 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sat, 25 Aug 2018 08:40:32 +0000 Subject: [PATCH] Mercurial 4.7 compatibility (#29413). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Patch by Frédéric Fondement. git-svn-id: http://svn.redmine.org/redmine/trunk@17474 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