Patchwork D9335: shelve: clear merge state after partial shelve

login
register
mail settings
Submitter phabricator
Date Nov. 17, 2020, 6:49 a.m.
Message ID <differential-rev-PHID-DREV-r6o23jsismz77k7d7mdf-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47611/
State Superseded
Headers show

Comments

phabricator - Nov. 17, 2020, 6:49 a.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9335

AFFECTED FILES
  mercurial/shelve.py
  tests/test-shelve.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-shelve.t b/tests/test-shelve.t
--- a/tests/test-shelve.t
+++ b/tests/test-shelve.t
@@ -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')
diff --git a/mercurial/shelve.py b/mercurial/shelve.py
--- a/mercurial/shelve.py
+++ b/mercurial/shelve.py
@@ -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)