comparison hgsubversion/wrappers.py @ 1557:dd409375c261

wrappers: adapt to introduction of logcmdutil package in hg
author Augie Fackler <raf@durin42.com>
date Sat, 24 Mar 2018 16:57:49 -0400
parents cff81f35b31e
children ae572c9be4e6
comparison
equal deleted inserted replaced
1556:53d170a6c3c8 1557:dd409375c261
16 from mercurial import hg 16 from mercurial import hg
17 from mercurial import util as hgutil 17 from mercurial import util as hgutil
18 from mercurial import node 18 from mercurial import node
19 from mercurial import i18n 19 from mercurial import i18n
20 from mercurial import extensions 20 from mercurial import extensions
21 try:
22 # hg 4.6 and later
23 from mercurial import logcmdutil
24 logcmdutil.changesetdisplayer
25 except ImportError:
26 # hg 4.5 and earlier
27 logcmdutil = None
21 from mercurial import repair 28 from mercurial import repair
22 from mercurial import revset 29 from mercurial import revset
23 from mercurial import scmutil 30 from mercurial import scmutil
24 31
25 import inspect 32 import inspect
68 meta = repo.svnmeta() 75 meta = repo.svnmeta()
69 hashes = meta.revmap.hashes() 76 hashes = meta.revmap.hashes()
70 ha = util.parentrev(ui, repo, meta, hashes) 77 ha = util.parentrev(ui, repo, meta, hashes)
71 if ha.node() == node.nullid: 78 if ha.node() == node.nullid:
72 raise hgerror.Abort('No parent svn revision!') 79 raise hgerror.Abort('No parent svn revision!')
73 displayer = cmdutil.show_changeset(ui, repo, opts, buffered=False) 80 if logcmdutil is not None:
81 displayer = logcmdutil.changesetdisplayer(
82 ui, repo, opts, buffered=False)
83 else:
84 displayer = cmdutil.show_changeset(ui, repo, opts, buffered=False)
74 displayer.show(ha) 85 displayer.show(ha)
75 return 0 86 return 0
76 87
77 88
78 def getpeer(ui, opts, source): 89 def getpeer(ui, opts, source):