diff mercurial/merge.py @ 22405:6f63c47cbb86

dirstate: wrap setparent calls with begin/endparentchange (issue4353) This wraps all the locations of dirstate.setparent with the appropriate begin/endparentchange calls. This will prevent exceptions during those calls from causing incoherent dirstates (issue4353).
author Durham Goode <durham@fb.com>
date Fri, 05 Sep 2014 11:36:20 -0700
parents 8dda6f6ff564
children 19903277f035
line wrap: on
line diff
--- a/mercurial/merge.py	Fri Sep 05 11:34:29 2014 -0700
+++ b/mercurial/merge.py	Fri Sep 05 11:36:20 2014 -0700
@@ -1134,6 +1134,7 @@
         stats = applyupdates(repo, actions, wc, p2, overwrite, labels=labels)
 
         if not partial:
+            repo.dirstate.beginparentchange()
             repo.setparents(fp1, fp2)
             recordupdates(repo, actions, branchmerge)
             # update completed, clear state
@@ -1141,6 +1142,7 @@
 
             if not branchmerge:
                 repo.dirstate.setbranch(p2.branch())
+            repo.dirstate.endparentchange()
     finally:
         wlock.release()