# HG changeset patch # User Martin von Zweigbergk # Date 1555694545 25200 # Node ID fe22c36b55639034730afe8892b965b3132aa098 # Parent d314deb12f08ac3dfcd799b4fcd534dfe7f96aba evolve: use single transaction also when continuing diff -r d314deb12f08 -r fe22c36b5563 hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Fri Apr 19 09:41:39 2019 -0700 +++ b/hgext3rd/evolve/evolvecmd.py Fri Apr 19 10:22:25 2019 -0700 @@ -1949,30 +1949,32 @@ # redundancy lastsolved = None activetopic = getattr(repo, 'currenttopic', '') - for rev in evolvestate['revs']: - # XXX: prevent this lookup by storing nodes instead of revnums - curctx = unfi[rev] - - # check if we can use stack template - 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 + tr = repo.transaction("evolve") + with util.acceptintervention(tr): + for rev in evolvestate['revs']: + # XXX: prevent this lookup by storing nodes instead of revnums + curctx = unfi[rev] - if (curctx.node() not in evolvestate['replacements'] - and curctx.node() not in evolvestate['skippedrevs']): - newnode = _solveone(ui, repo, curctx, evolvestate, False, - confirm, progresscb, category, - lastsolved=lastsolved, - stacktmplt=stacktmplt) - if newnode[0]: - evolvestate['replacements'][curctx.node()] = newnode[1] - lastsolved = newnode[1] - else: - evolvestate['skippedrevs'].append(curctx.node()) - seen += 1 + # check if we can use stack template + 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 + + if (curctx.node() not in evolvestate['replacements'] + and curctx.node() not in evolvestate['skippedrevs']): + newnode = _solveone(ui, repo, curctx, evolvestate, False, + confirm, progresscb, category, + lastsolved=lastsolved, + stacktmplt=stacktmplt) + if newnode[0]: + evolvestate['replacements'][curctx.node()] = newnode[1] + lastsolved = newnode[1] + else: + evolvestate['skippedrevs'].append(curctx.node()) + seen += 1 def _continuecontentdivergent(ui, repo, evolvestate, progresscb): """function to continue the interrupted content-divergence resolution.""" diff -r d314deb12f08 -r fe22c36b5563 tests/test-evolve-progress.t --- a/tests/test-evolve-progress.t Fri Apr 19 09:41:39 2019 -0700 +++ b/tests/test-evolve-progress.t Fri Apr 19 10:22:25 2019 -0700 @@ -165,9 +165,6 @@ b committing manifest committing changelog - updating the branch cache - obscache is out of date - invalid branchheads cache (served): tip differs move:[7] fourth hg rebase -r 385376d04062 -d b2de95304e32 evolve: 3/3 changesets (100.00%)