mercurial/commands.py
changeset 26581 6e715040c172
parent 26580 4688945f316c
child 26587 56b2bcea2529
--- a/mercurial/commands.py	Fri Oct 09 03:53:47 2015 +0900
+++ b/mercurial/commands.py	Fri Oct 09 03:53:47 2015 +0900
@@ -547,14 +547,14 @@
         bheads = repo.branchheads(branch)
         rctx = scmutil.revsingle(repo, hex(parent))
         if not opts.get('merge') and op1 != node:
+            dsguard = cmdutil.dirstateguard(repo, 'backout')
             try:
                 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''),
                              'backout')
-                repo.dirstate.beginparentchange()
                 stats = mergemod.update(repo, parent, True, True, False,
                                         node, False)
                 repo.setparents(op1, op2)
-                repo.dirstate.endparentchange()
+                dsguard.close()
                 hg._showstats(repo, stats)
                 if stats[3]:
                     repo.ui.status(_("use 'hg resolve' to retry unresolved "
@@ -567,6 +567,7 @@
                     return 0
             finally:
                 ui.setconfig('ui', 'forcemerge', '', '')
+                lockmod.release(dsguard)
         else:
             hg.clean(repo, node, show_stats=False)
             repo.dirstate.setbranch(branch)