evolve: check if we should use stack template for each item in the stack
We should probably just track the current topic and move all the logic in the
template itself. However, this is a good first step.
--- a/hgext3rd/evolve/evolvecmd.py Thu Oct 25 10:01:58 2018 +0200
+++ b/hgext3rd/evolve/evolvecmd.py Thu Oct 25 18:08:34 2018 +0200
@@ -1583,15 +1583,13 @@
# 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]
+ revtopic = getattr(curctx, 'topic', lambda: '')()
+ topicidx = getattr(curctx, 'topicidx', lambda: None)()
+ stacktmplt = False
+ if activetopic and (activetopic == revtopic) and topicidx is not None:
+ stacktmplt = True
progresscb()
ret = _solveone(ui, repo, curctx, evolvestate, dryrunopt,
confirmopt, progresscb, targetcat,