# HG changeset patch # User Manuel Jacob # Date 1594337779 -7200 # Node ID ab33782deb84497d9d9fe52e363384563db37910 # Parent a0192a03216d6f0d279aa17312e946a06776875d rebase: add test case that shows that inmemory rebase does not preserve merges Differential Revision: https://phab.mercurial-scm.org/D8727 diff -r a0192a03216d -r ab33782deb84 tests/test-rebase-inmemory.t --- 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