D8727: rebase: add test case that shows that inmemory rebase does not preserve merges

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

D8727: rebase: add test case that shows that inmemory rebase does not preserve merges

pulkit (Pulkit Goyal)
mjacob created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8727

AFFECTED FILES
  tests/test-rebase-inmemory.t

CHANGE DETAILS

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
@@ -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



To: mjacob, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel