changeset 40453:6f679f25fd4d stable

rebase: abort in-mem rebase if there's a dirty merge state In-memory merge uses the on-disk merge state, so we should not allow it run in-memory merge when the merge state is not clean. We should probably not use the on-disk merge state when running in-memory merge, but chaning that is not suitable for the stable branch. Differential Revision: https://phab.mercurial-scm.org/D5357
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 03 Dec 2018 09:36:40 -0800
parents f07d4f94f098
children 97190b0bb81a
files hgext/rebase.py tests/test-rebase-inmemory.t
diffstat 2 files changed, 4 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/rebase.py	Fri Nov 30 16:21:37 2018 -0800
+++ b/hgext/rebase.py	Mon Dec 03 09:36:40 2018 -0800
@@ -540,7 +540,7 @@
             p1, p2, base = defineparents(repo, rev, self.destmap,
                                          self.state, self.skipped,
                                          self.obsoletenotrebased)
-            if len(repo[None].parents()) == 2:
+            if not self.inmemory and len(repo[None].parents()) == 2:
                 repo.ui.debug('resuming interrupted rebase\n')
             else:
                 overrides = {('ui', 'forcemerge'): opts.get('tool', '')}
--- a/tests/test-rebase-inmemory.t	Fri Nov 30 16:21:37 2018 -0800
+++ b/tests/test-rebase-inmemory.t	Mon Dec 03 09:36:40 2018 -0800
@@ -463,17 +463,12 @@
   [1]
   $ hg resolve -l
   U e
-BROKEN: these should not say "created no changes to commit"
   $ hg rebase -s 2 -d 7
   rebasing 2:177f92b77385 "c"
-  note: rebase of 2:177f92b77385 created no changes to commit
-  rebasing 3:055a42cdd887 "d"
-  note: rebase of 3:055a42cdd887 created no changes to commit
-  rebasing 4:e860deea161a "e"
-  note: rebase of 4:e860deea161a created no changes to commit
-  saved backup bundle to $TESTTMP/repo1/repo3-merge-state/.hg/strip-backup/177f92b77385-4da7ba9e-rebase.hg
-BROKEN: merge state lost
+  abort: outstanding merge conflicts
+  [255]
   $ hg resolve -l
+  U e
 
 ==========================
 Test for --confirm option|