--- a/hgext3rd/evolve/cmdrewrite.py Mon May 13 18:39:43 2019 +0530
+++ b/hgext3rd/evolve/cmdrewrite.py Mon May 13 18:45:00 2019 +0530
@@ -1362,15 +1362,8 @@
rewriteutil.precheck(repo, revs, 'touch')
tmpl = utility.shorttemplate
displayer = compat.changesetdisplayer(ui, repo, {'template': tmpl})
- wlock = lock = tr = None
- try:
- wlock = repo.wlock()
- lock = repo.lock()
- tr = repo.transaction('touch')
+ with repo.wlock(), repo.lock(), repo.transaction('touch'):
touchnodes(ui, repo, revs, displayer, **opts)
- tr.close()
- finally:
- lockmod.release(tr, lock, wlock)
def touchnodes(ui, repo, revs, displayer, **opts):
duplicate = opts['duplicate']