diff hgext/transplant.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 2449a0a6ebda
children 56b2bcea2529
line wrap: on
line diff
--- a/hgext/transplant.py	Fri Oct 09 03:53:46 2015 +0900
+++ b/hgext/transplant.py	Fri Oct 09 03:53:46 2015 +0900
@@ -127,10 +127,9 @@
         diffopts = patch.difffeatureopts(self.ui, opts)
         diffopts.git = True
 
-        lock = wlock = tr = dsguard = None
+        lock = wlock = tr = None
         try:
             wlock = repo.wlock()
-            dsguard = cmdutil.dirstateguard(repo, 'transplant')
             lock = repo.lock()
             tr = repo.transaction('transplant')
             for rev in revs:
@@ -203,7 +202,6 @@
                             # Do not rollback, it is up to the user to
                             # fix the merge or cancel everything
                             tr.close()
-                            dsguard.close()
                             raise
                         if n and domerge:
                             self.ui.status(_('%s merged at %s\n') % (revstr,
@@ -216,7 +214,6 @@
                         if patchfile:
                             os.unlink(patchfile)
             tr.close()
-            dsguard.close()
             if pulls:
                 exchange.pull(repo, source.peer(), heads=pulls)
                 merge.update(repo, pulls[-1], False, False, None)
@@ -227,8 +224,6 @@
                 tr.release()
             if lock:
                 lock.release()
-            if dsguard:
-                dsguard.release()
             wlock.release()
 
     def filter(self, filter, node, changelog, patchfile):