diff hgext/strip.py @ 24709:69154e0ae384

strip: properly clear resolve state with --keep (issue4593) Normal updates automatically clean up the resolve state, but strip --keep does a "manual" update that bypasses the normal machinery. This adds a mergestate reset.
author Matt Mackall <mpm@selenic.com>
date Mon, 13 Apr 2015 07:42:25 -0500
parents 1ff35d76421c
children 08ec11e3ae4c
line wrap: on
line diff
--- a/hgext/strip.py	Mon Apr 13 20:53:05 2015 -0700
+++ b/hgext/strip.py	Mon Apr 13 07:42:25 2015 -0500
@@ -7,7 +7,7 @@
 from mercurial.node import nullid
 from mercurial.lock import release
 from mercurial import cmdutil, hg, scmutil, util
-from mercurial import repair, bookmarks
+from mercurial import repair, bookmarks, merge
 
 cmdtable = {}
 command = cmdutil.command(cmdtable)
@@ -205,6 +205,11 @@
 
             repo.dirstate.rebuild(urev, uctx.manifest(), changedfiles)
             repo.dirstate.write()
+
+            # clear resolve state
+            ms = merge.mergestate(repo)
+            ms.reset(repo['.'].node())
+
             update = False