touch: use util.acceptintervention() for closing the transaction
authorSushil khanchi <sushilkhanchi97@gmail.com>
Mon, 13 May 2019 18:47:58 +0530
changeset 4640 c720d09c2366
parent 4639 c4cab1dd31b7
child 4641 686b9a7d3b46
touch: use util.acceptintervention() for closing the transaction It will close the transaction on InterventionRequired.
hgext3rd/evolve/cmdrewrite.py
--- 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']