--- a/hgext3rd/evolve/evolvecmd.py Mon Oct 01 19:59:17 2018 +0530
+++ b/hgext3rd/evolve/evolvecmd.py Tue Oct 02 12:55:29 2018 +0530
@@ -54,7 +54,7 @@
abortmessage = _("see `hg help evolve.interrupted`\n")
def _solveone(ui, repo, ctx, evolvestate, dryrun, confirm,
- progresscb, category, lastsolved=None):
+ progresscb, category, lastsolved=None, stacktmplt=False):
"""Resolve the troubles affecting one revision
returns a tuple (bool, newnode) where,
@@ -63,8 +63,14 @@
formed. newnode can be node, when resolution led to no new
commit. If bool is False, this is ''.
"""
+ displayer = None
+ if stacktmplt:
+ displayer = compat.changesetdisplayer(ui, repo,
+ {'template': stacktemplate})
+ else:
+ displayer = compat.changesetdisplayer(ui, repo,
+ {'template': shorttemplate})
wlock = lock = tr = None
- displayer = compat.changesetdisplayer(ui, repo, {'template': shorttemplate})
try:
wlock = repo.wlock()
lock = repo.lock()
@@ -1571,12 +1577,23 @@
# lastsolved: keep track of successor of last troubled cset we evolved
# to confirm that if atop msg should be suppressed to remove redundancy
lastsolved = None
+
+ # check if revs to be evolved are in active topic to make sure that we
+ # can use stack aliases s# in evolve msgs.
+ activetopic = getattr(repo, 'currenttopic', '')
+ rev = revs[0]
+ revtopic = getattr(repo[rev], 'topic', '')
+ if revtopic:
+ revtopic = revtopic()
+ stacktmplt = False
+ if activetopic and revtopic and (activetopic == revtopic):
+ stacktmplt = True
for rev in revs:
curctx = repo[rev]
progresscb()
ret = _solveone(ui, repo, curctx, evolvestate, dryrunopt,
confirmopt, progresscb, targetcat,
- lastsolved=lastsolved)
+ lastsolved=lastsolved, stacktmplt=stacktmplt)
seen += 1
if ret[0]:
evolvestate['replacements'][curctx.node()] = ret[1]
@@ -1588,7 +1605,8 @@
# we were processing an orphan merge with both parents obsolete,
# stabilized for second parent, re-stabilize for the first parent
ret = _solveone(ui, repo, repo[ret[1]], evolvestate, dryrunopt,
- confirmopt, progresscb, targetcat)
+ confirmopt, progresscb, targetcat,
+ stacktmplt=stacktmplt)
if ret[0]:
evolvestate['replacements'][curctx.node()] = ret[1]
else: