diff tests/test-rebase-inmemory.t @ 45087:ab33782deb84

rebase: add test case that shows that inmemory rebase does not preserve merges Differential Revision: https://phab.mercurial-scm.org/D8727
author Manuel Jacob <me@manueljacob.de>
date Fri, 10 Jul 2020 01:36:19 +0200
parents 905b21783968
children 0ecb3b11fcad
line wrap: on
line diff
--- a/tests/test-rebase-inmemory.t	Thu Jul 09 07:00:32 2020 +0200
+++ b/tests/test-rebase-inmemory.t	Fri Jul 10 01:36:19 2020 +0200
@@ -920,3 +920,50 @@
   |/   foo
   o  0: r0
      r0
+
+  $ cd ..
+
+Changesets that become empty should not be committed. Merges are not empty by
+definition.
+
+  $ hg init keep_merge
+  $ cd keep_merge
+  $ echo base > base; hg add base; hg ci -m base
+  $ echo test > test; hg add test; hg ci -m a
+  $ hg up 0 -q
+  $ echo test > test; hg add test; hg ci -m b -q
+  $ hg up 0 -q
+  $ echo test > test; hg add test; hg ci -m c -q
+  $ hg up 1 -q
+  $ hg merge 2 -q
+  $ hg ci -m merge
+  $ hg up null -q
+  $ hg tglog
+  o    4: 59c8292117b1 'merge'
+  |\
+  | | o  3: 531f80391e4a 'c'
+  | | |
+  | o |  2: 0194f1db184a 'b'
+  | |/
+  o /  1: 6f252845ea45 'a'
+  |/
+  o  0: d20a80d4def3 'base'
+  
+FIXME: It's broken for inmemory merges.
+  $ hg rebase -s 2 -d 3
+  rebasing 2:0194f1db184a "b"
+  note: not rebasing 2:0194f1db184a "b", its destination already has all its changes
+  rebasing 4:59c8292117b1 "merge" (tip)
+  note: not rebasing 4:59c8292117b1 "merge" (tip), its destination already has all its changes (true !)
+  saved backup bundle to $TESTTMP/keep_merge/.hg/strip-backup/0194f1db184a-aee31d03-rebase.hg
+#if false
+  $ hg tglog
+  o    3: 506e2454484b 'merge'
+  |\
+  | o  2: 531f80391e4a 'c'
+  | |
+  o |  1: 6f252845ea45 'a'
+  |/
+  o  0: d20a80d4def3 'base'
+  
+#endif