touch: use util.acceptintervention() for closing the transaction
It will close the transaction on InterventionRequired.
--- a/hgext3rd/evolve/cmdrewrite.py Mon May 13 18:45:00 2019 +0530
+++ b/hgext3rd/evolve/cmdrewrite.py Mon May 13 18:47:58 2019 +0530
@@ -1362,8 +1362,10 @@
rewriteutil.precheck(repo, revs, 'touch')
tmpl = utility.shorttemplate
displayer = compat.changesetdisplayer(ui, repo, {'template': tmpl})
- with repo.wlock(), repo.lock(), repo.transaction('touch'):
- touchnodes(ui, repo, revs, displayer, **opts)
+ with repo.wlock(), repo.lock():
+ tr = repo.transaction('touch')
+ with util.acceptintervention(tr):
+ touchnodes(ui, repo, revs, displayer, **opts)
def touchnodes(ui, repo, revs, displayer, **opts):
duplicate = opts['duplicate']