# HG changeset patch # User Martin von Zweigbergk # Date 2020-12-02 23:39:01 # Node ID 1d5189a57405ceca5aa244052c9f948977f4699b # Parent 39e2cf7cb12038beb0f02c81059ca724724e9bb2 rebase: clear merge state when aborting in-memory merge on dirty working copy Differential Revision: https://phab.mercurial-scm.org/D9509 diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -638,7 +638,12 @@ class rebaseruntime(object): 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) 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 @@ Retrying without in-memory merge won't l 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 ..