diff hgext/rebase.py @ 40790:f07d4f94f098 stable

rebase: preserve working copy when redoing in-mem rebase on disk When in-memory rebase runs into conflicts, we retry it on disk. But before we do that, we abort the in-memory rebase. That is done because even though it's mostly in memory, there are still a few state files written (e.g. the merge state). We should make it not write those files so we don't need to abort, but for the stable branch, let's explicitly clear the state we need to clear instead of running the usual abort code. Differential Revision: https://phab.mercurial-scm.org/D5356
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 30 Nov 2018 16:21:37 -0800
parents b14fdf1fb615
children 6f679f25fd4d
line wrap: on
line diff
--- a/hgext/rebase.py	Fri Nov 30 15:08:43 2018 -0800
+++ b/hgext/rebase.py	Fri Nov 30 16:21:37 2018 -0800
@@ -865,7 +865,11 @@
         except error.InMemoryMergeConflictsError:
             ui.warn(_('hit merge conflicts; re-running rebase without in-memory'
                       ' merge\n'))
-            _dorebase(ui, repo, action='abort', opts={})
+            # TODO: Make in-memory merge not use the on-disk merge state, so
+            # we don't have to clean it here
+            mergemod.mergestate.clean(repo)
+            clearstatus(repo)
+            clearcollapsemsg(repo)
             return _dorebase(ui, repo, action, opts, inmemory=False)
     else:
         return _dorebase(ui, repo, action, opts)