diff mercurial/cmdutil.py @ 26578:8bd2759f1fa7

dirstate: remove meaningless dirstateguard Previous patch made dirstate changes in a transaction scope "all or nothing". Therefore, 'dirstateguard' is meaningless, if its scope is as same as one of the related transaction. This patch removes such meaningless 'dirstateguard' usage.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Fri, 09 Oct 2015 03:53:46 +0900
parents dd2f5e014806
children dc2b8c005697
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Fri Oct 09 03:53:46 2015 +0900
+++ b/mercurial/cmdutil.py	Fri Oct 09 03:53:46 2015 +0900
@@ -2507,10 +2507,9 @@
     base = old.p1()
     createmarkers = obsolete.isenabled(repo, obsolete.createmarkersopt)
 
-    wlock = dsguard = lock = newid = None
+    wlock = lock = newid = None
     try:
         wlock = repo.wlock()
-        dsguard = dirstateguard(repo, 'amend')
         lock = repo.lock()
         tr = repo.transaction('amend')
         try:
@@ -2682,7 +2681,6 @@
             tr.close()
         finally:
             tr.release()
-        dsguard.close()
         if not createmarkers and newid != old.node():
             # Strip the intermediate commit (if there was one) and the amended
             # commit
@@ -2691,7 +2689,7 @@
             ui.note(_('stripping amended changeset %s\n') % old)
             repair.strip(ui, repo, old.node(), topic='amend-backup')
     finally:
-        lockmod.release(lock, dsguard, wlock)
+        lockmod.release(lock, wlock)
     return newid
 
 def commiteditor(repo, ctx, subs, editform=''):