# HG changeset patch # User Martin von Zweigbergk # Date 1555694633 25200 # Node ID c54d4c2c28467adc47ed613c51a48bf274997a6d # Parent fe2999627556e5bb46ce27768c64ac3b32dd7cf7 evolve: drop nested locks and transactions All callers of _solveone() now take the locks and start the transactions, so there's no need to do that anymore. diff -r fe2999627556 -r c54d4c2c2846 hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Fri Apr 19 11:12:00 2019 -0700 +++ b/hgext3rd/evolve/evolvecmd.py Fri Apr 19 10:23:53 2019 -0700 @@ -64,6 +64,8 @@ formed. newnode can be node, when resolution led to no new commit. If bool is False, this is ".". """ + tr = repo.currenttransaction() + assert tr is not None displayer = None if stacktmplt: displayer = compat.changesetdisplayer(ui, repo, @@ -71,23 +73,20 @@ else: displayer = compat.changesetdisplayer(ui, repo, {'template': shorttemplate}) - with repo.wlock(), repo.lock(): - tr = repo.transaction("evolve") - with util.acceptintervention(tr): - if 'orphan' == category: - result = _solveunstable(ui, repo, ctx, evolvestate, displayer, - dryrun, confirm, progresscb, - lastsolved=lastsolved) - elif 'phasedivergent' == category: - result = _solvephasedivergence(ui, repo, ctx, evolvestate, - displayer, dryrun, confirm, - progresscb) - elif 'contentdivergent' == category: - result = _solvedivergent(ui, repo, ctx, evolvestate, displayer, - dryrun, confirm, progresscb) - else: - assert False, "unknown trouble category: %s" % (category) - return result + if 'orphan' == category: + result = _solveunstable(ui, repo, ctx, evolvestate, displayer, + dryrun, confirm, progresscb, + lastsolved=lastsolved) + elif 'phasedivergent' == category: + result = _solvephasedivergence(ui, repo, ctx, evolvestate, + displayer, dryrun, confirm, + progresscb) + elif 'contentdivergent' == category: + result = _solvedivergent(ui, repo, ctx, evolvestate, displayer, + dryrun, confirm, progresscb) + else: + assert False, "unknown trouble category: %s" % (category) + return result def _solveunstable(ui, repo, orig, evolvestate, displayer, dryrun=False, confirm=False, progresscb=None, lastsolved=None):