Mercurial > evolve
changeset 2742:64fb1a082f58
prev: add '_getcurrenttopic' helper and use it
We'll add more spot where this information is used.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 14 Jul 2017 02:35:12 +0200 |
parents | 51d669b16fa8 |
children | 2fe562f94ead |
files | hgext3rd/evolve/__init__.py |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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]