# HG changeset patch # User Pierre-Yves David # Date 1499992512 -7200 # Node ID 64fb1a082f58a08b493d4e1cf6fe926c2ac4b14e # Parent 51d669b16fa88a2eb8d663a4316a65de9860b3da prev: add '_getcurrenttopic' helper and use it We'll add more spot where this information is used. diff -r 51d669b16fa8 -r 64fb1a082f58 hgext3rd/evolve/__init__.py --- 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]