rebase: clear merge state when aborting in-memory merge on dirty working copy stable 5.6.1
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 02 Dec 2020 15:39:01 -0800
branchstable
changeset 45780 1d5189a57405
parent 45779 39e2cf7cb120
child 45781 a3ef50355673
rebase: clear merge state when aborting in-memory merge on dirty working copy Differential Revision: https://phab.mercurial-scm.org/D9509
hgext/rebase.py
tests/test-rebase-inmemory.t
--- a/hgext/rebase.py	Wed Dec 02 15:15:16 2020 -0800
+++ b/hgext/rebase.py	Wed Dec 02 15:39:01 2020 -0800
@@ -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)
--- a/tests/test-rebase-inmemory.t	Wed Dec 02 15:15:16 2020 -0800
+++ b/tests/test-rebase-inmemory.t	Wed Dec 02 15:39:01 2020 -0800
@@ -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 ..