# HG changeset patch # User Pierre-Yves David # Date 1540483714 -7200 # Node ID aa9f330781577b6734bc7f28289b93da3a43ab0c # Parent 46cef25fbd960eb4fae9c2eaddc199168517b3d9 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. diff -r 46cef25fbd96 -r aa9f33078157 hgext3rd/evolve/evolvecmd.py --- 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,