diff mercurial/cmdutil.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 402e5fba6509
children bd15932846a4
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Fri Sep 05 11:34:29 2014 -0700
+++ b/mercurial/cmdutil.py	Fri Sep 05 11:36:20 2014 -0700
@@ -659,6 +659,7 @@
 
         n = None
         if update:
+            repo.dirstate.beginparentchange()
             if p1 != parents[0]:
                 updatefunc(repo, p1.node())
             if p2 != parents[1]:
@@ -698,6 +699,7 @@
                 n = repo.commit(message, opts.get('user') or user,
                                 opts.get('date') or date, match=m,
                                 editor=editor, force=partial)
+            repo.dirstate.endparentchange()
         else:
             if opts.get('exact') or opts.get('import_branch'):
                 branch = branch or 'default'