shelve: clear merge state after partial shelve
authorMartin von Zweigbergk <martinvonz@google.com>
Mon, 16 Nov 2020 21:28:42 -0800
changeset 45860 073bb7563931
parent 45859 781b09790633
child 45861 c9c3c277e5a5
shelve: clear merge state after partial shelve Differential Revision: https://phab.mercurial-scm.org/D9335
mercurial/shelve.py
tests/test-shelve.t
--- a/mercurial/shelve.py	Mon Nov 16 22:38:36 2020 -0800
+++ b/mercurial/shelve.py	Mon Nov 16 21:28:42 2020 -0800
@@ -564,6 +564,10 @@
                 scmutil.movedirstate(repo, parent, match)
         else:
             hg.update(repo, parent.node())
+            ms = mergestatemod.mergestate.read(repo)
+            if not ms.unresolvedcount():
+                ms.reset()
+
         if origbranch != repo[b'.'].branch() and not _isbareshelve(pats, opts):
             repo.dirstate.setbranch(origbranch)
 
--- a/tests/test-shelve.t	Mon Nov 16 22:38:36 2020 -0800
+++ b/tests/test-shelve.t	Mon Nov 16 21:28:42 2020 -0800
@@ -810,9 +810,8 @@
   ? foo/foo
   $ hg bookmark
    \* test                      (4|13):33f7f61e6c5e (re)
-BROKEN: there shouldn't be a merge state
+there shouldn't be a merge state
   $ hg resolve -l
-  R a/a
   $ hg unshelve
   unshelving change 'test'
   temporarily committing pending changes (restore with 'hg unshelve --abort')