Patchwork D2759: rebase: fix issue 5494 also with --collapse

login
register
mail settings
Submitter phabricator
Date March 13, 2018, 2:55 p.m.
Message ID <56e8aec0f04d18604c2800be4ee68c39@localhost.localdomain>
Download mbox | patch
Permalink /patch/29440/
State Not Applicable
Headers show

Comments

phabricator - March 13, 2018, 2:55 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG72e58801950a: rebase: fix issue 5494 also with --collapse (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2759?vs=6787&id=6985

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

AFFECTED FILES
  hgext/rebase.py
  tests/test-rebase-interruptions.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-rebase-interruptions.t b/tests/test-rebase-interruptions.t
--- a/tests/test-rebase-interruptions.t
+++ b/tests/test-rebase-interruptions.t
@@ -479,7 +479,6 @@ 
   $ hg rebase --continue
   rebasing 2:fdaca8533b86 "b" (tip)
   saved backup bundle to $TESTTMP/repo/.hg/strip-backup/fdaca8533b86-7fd70513-rebase.hg
-BROKEN: the merge state was not cleared
   $ hg resolve --list
-  R a
   $ test -d .hg/merge
+  [1]
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -579,6 +579,12 @@ 
                     editor=editor,
                     keepbranches=self.keepbranchesf,
                     date=self.date)
+
+            if newnode is None:
+                # If it ended up being a no-op commit, then the normal
+                # merge state clean-up path doesn't happen, so do it
+                # here. Fix issue5494
+                mergemod.mergestate.clean(repo)
             if newnode is not None:
                 newrev = repo[newnode].rev()
                 for oldrev in self.state: