prev: add '_getcurrenttopic' helper and use it
We'll add more spot where this information is used.
--- a/hgext3rd/evolve/__init__.py Fri Jul 14 02:34:42 2017 +0200
+++ b/hgext3rd/evolve/__init__.py Fri Jul 14 02:35:12 2017 +0200
@@ -1979,6 +1979,9 @@
shorttemplate = "[{label('evolve.rev', rev)}] {desc|firstline}\n"
+def _getcurrenttopic(repo):
+ return getattr(repo, 'currenttopic', '')
+
def _prevupdate(repo, displayer, target, bookmark, dryrun):
if dryrun:
repo.ui.write(('hg update %s;\n' % target.rev()))
@@ -2008,7 +2011,7 @@
wkctx = repo[None]
p1 = wkctx.parents()[0]
parents = p1.parents()
- currenttopic = getattr(repo, 'currenttopic', '')
+ currenttopic = _getcurrenttopic(repo)
if currenttopic and topic:
parents = [ctx for ctx in parents if ctx.topic() == currenttopic]