Project

General

Profile

Defect #29413 » 29413-mercurial-fix.diff

Patch by Frédéric Fondement (#29413#note-5) - Go MAEDA, 2018-08-22 05:47

View differences:

lib/redmine/scm/adapters/mercurial/redminehelper.py (working copy)
46 46
    </rhmanifest>
47 47
"""
48 48
import re, time, cgi, urllib
49
from mercurial import cmdutil, commands, node, error, hg
49
from mercurial import cmdutil, commands, node, error, hg, registrar
50 50

  
51 51
cmdtable = {}
52
command = cmdutil.command(cmdtable)
52
command = registrar.command(cmdtable) if hasattr(registrar, 'command') else cmdutil.command(cmdtable)
53 53

  
54 54
_x = cgi.escape
55 55
_u = lambda s: cgi.escape(urllib.quote(s))
56 56

  
57 57
def _changectx(repo, rev):
58
    if isinstance(rev, str):
59
       rev = repo.lookup(rev)
58 60
    if hasattr(repo, 'changectx'):
59 61
        return repo.changectx(rev)
60 62
    else:
    (1-1/1)