Patchwork D9509: rebase: clear merge state when aborting in-memory merge on dirty working copy

login
register
mail settings
Submitter phabricator
Date Dec. 2, 2020, 11:46 p.m.
Message ID <differential-rev-PHID-DREV-jifa2yxcgmgp6v72yxmw-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47791/
State Superseded
Headers show

Comments

phabricator - Dec. 2, 2020, 11:46 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

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

CHANGE DETAILS




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

Patch

diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t
--- a/tests/test-rebase-inmemory.t
+++ b/tests/test-rebase-inmemory.t
@@ -489,12 +489,6 @@ 
   dirty
   $ hg status -v
   M a
-  # The repository is in an unfinished *rebase* state.
-  
-  # To continue:    hg rebase --continue
-  # To abort:       hg rebase --abort
-  # To stop:        hg rebase --stop
-  
 
 Retrying without in-memory merge won't lose merge state
   $ cd ..
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -638,7 +638,12 @@ 
                                 b"commit again in the working copy\n"
                             )
                         )
-                        cmdutil.bailifchanged(repo)
+                        try:
+                            cmdutil.bailifchanged(repo)
+                        except error.Abort:
+                            clearstatus(repo)
+                            clearcollapsemsg(repo)
+                            raise
                         self.inmemory = False
                         self._assignworkingcopy()
                         mergemod.update(repo[p1], wc=self.wctx)