--- a/hgext3rd/evolve/evolvecmd.py Tue Jan 22 10:17:58 2019 -0800
+++ b/hgext3rd/evolve/evolvecmd.py Tue Jan 22 22:36:29 2019 -0800
@@ -19,7 +19,6 @@
copies,
error,
hg,
- lock as lockmod,
merge,
mergeutil,
node as nodemod,
@@ -71,11 +70,7 @@
else:
displayer = compat.changesetdisplayer(ui, repo,
{'template': shorttemplate})
- wlock = lock = tr = None
- try:
- wlock = repo.wlock()
- lock = repo.lock()
- tr = repo.transaction("evolve")
+ with repo.wlock(), repo.lock(), repo.transaction("evolve"):
if 'orphan' == category:
result = _solveunstable(ui, repo, ctx, evolvestate, displayer,
dryrun, confirm, progresscb,
@@ -89,10 +84,7 @@
dryrun, confirm, progresscb)
else:
assert False, "unknown trouble category: %s" % (category)
- tr.close()
return result
- finally:
- lockmod.release(tr, lock, wlock)
def _solveunstable(ui, repo, orig, evolvestate, displayer, dryrun=False,
confirm=False, progresscb=None, lastsolved=None):