tests/test-evolve-public-content-divergent.t
changeset 4444 ea336a6592cc
parent 4438 a6bdb02a1902
child 4454 f530850c8184
--- a/tests/test-evolve-public-content-divergent.t	Sun Mar 24 21:29:44 2019 +0530
+++ b/tests/test-evolve-public-content-divergent.t	Sun Mar 24 21:30:12 2019 +0530
@@ -1418,3 +1418,301 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     added d
   
+
+  $ cd ..
+
+Test a pratical "rebase" case
+=============================
+
+Initial setup
+
+  $ hg init rebase-divergence
+  $ cd rebase-divergence
+  $ echo root >> root
+  $ hg add root
+  $ hg commit -m root
+  $ for x in c_A c_B c_C c_D; do
+  >     echo $x >> $x
+  >     hg add $x
+  >     hg commit -m $x
+  > done
+
+  $ hg up 'desc("c_A")'
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+
+  $ for x in c_E c_F; do
+  >     echo $x >> $x
+  >     hg add $x
+  >     hg commit -m $x
+  > done
+  created new head
+
+(creating divergence locally for simplicity)
+
+  $ node=`hg log --rev 'desc("c_E")' -T '{node}'`
+  $ hg rebase -s $node -d 'desc("c_B")'
+  rebasing 5:4ab2719bbab9 "c_E"
+  rebasing 6:77ccbf8d837e "c_F" (tip)
+  $ hg phase --public tip
+  $ hg rebase --hidden -s $node -d 'desc("c_C")' --config experimental.evolution.allowdivergence=yes
+  rebasing 5:4ab2719bbab9 "c_E"
+  rebasing 6:77ccbf8d837e "c_F"
+  2 new content-divergent changesets
+
+  $ hg sum
+  parent: 8:a52ac76b45f5 
+   c_F
+  branch: default
+  commit: (clean)
+  update: 4 new changesets, 3 branch heads (merge)
+  phases: 4 draft
+  content-divergent: 2 changesets
+  $ hg evolve --list
+  b4a584aea4bd: c_E
+    content-divergent: c7d2d47c7240 (public) (precursor 4ab2719bbab9)
+  
+  8ae8db670b4a: c_F
+    content-divergent: a52ac76b45f5 (public) (precursor 77ccbf8d837e)
+  
+  $ hg log -G --patch
+  *  changeset:   10:8ae8db670b4a
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  instability: content-divergent
+  |  summary:     c_F
+  |
+  |  diff -r b4a584aea4bd -r 8ae8db670b4a c_F
+  |  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |  +++ b/c_F	Thu Jan 01 00:00:00 1970 +0000
+  |  @@ -0,0 +1,1 @@
+  |  +c_F
+  |
+  *  changeset:   9:b4a584aea4bd
+  |  parent:      3:abb77b893f28
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  instability: content-divergent
+  |  summary:     c_E
+  |
+  |  diff -r abb77b893f28 -r b4a584aea4bd c_E
+  |  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |  +++ b/c_E	Thu Jan 01 00:00:00 1970 +0000
+  |  @@ -0,0 +1,1 @@
+  |  +c_E
+  |
+  | @  changeset:   8:a52ac76b45f5
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  summary:     c_F
+  | |
+  | |  diff -r c7d2d47c7240 -r a52ac76b45f5 c_F
+  | |  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  | |  +++ b/c_F	Thu Jan 01 00:00:00 1970 +0000
+  | |  @@ -0,0 +1,1 @@
+  | |  +c_F
+  | |
+  | o  changeset:   7:c7d2d47c7240
+  | |  parent:      2:eb1b4e1205b8
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  summary:     c_E
+  | |
+  | |  diff -r eb1b4e1205b8 -r c7d2d47c7240 c_E
+  | |  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  | |  +++ b/c_E	Thu Jan 01 00:00:00 1970 +0000
+  | |  @@ -0,0 +1,1 @@
+  | |  +c_E
+  | |
+  +---o  changeset:   4:dbb960d6c97c
+  | |    user:        test
+  | |    date:        Thu Jan 01 00:00:00 1970 +0000
+  | |    summary:     c_D
+  | |
+  | |    diff -r abb77b893f28 -r dbb960d6c97c c_D
+  | |    --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  | |    +++ b/c_D	Thu Jan 01 00:00:00 1970 +0000
+  | |    @@ -0,0 +1,1 @@
+  | |    +c_D
+  | |
+  o |  changeset:   3:abb77b893f28
+  |/   user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     c_C
+  |
+  |    diff -r eb1b4e1205b8 -r abb77b893f28 c_C
+  |    --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |    +++ b/c_C	Thu Jan 01 00:00:00 1970 +0000
+  |    @@ -0,0 +1,1 @@
+  |    +c_C
+  |
+  o  changeset:   2:eb1b4e1205b8
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c_B
+  |
+  |  diff -r e31751786014 -r eb1b4e1205b8 c_B
+  |  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |  +++ b/c_B	Thu Jan 01 00:00:00 1970 +0000
+  |  @@ -0,0 +1,1 @@
+  |  +c_B
+  |
+  o  changeset:   1:e31751786014
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c_A
+  |
+  |  diff -r 1e4be0697311 -r e31751786014 c_A
+  |  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |  +++ b/c_A	Thu Jan 01 00:00:00 1970 +0000
+  |  @@ -0,0 +1,1 @@
+  |  +c_A
+  |
+  o  changeset:   0:1e4be0697311
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     root
+  
+     diff -r 000000000000 -r 1e4be0697311 root
+     --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+     +++ b/root	Thu Jan 01 00:00:00 1970 +0000
+     @@ -0,0 +1,1 @@
+     +root
+  
+
+Run automatic evolution
+
+  $ hg evolve --content-divergent --rev 'not public() and desc("c_E")::'
+  merge:[7] c_E
+  with: [9] c_E
+  base: [5] c_E
+  rebasing "other" content-divergent changeset b4a584aea4bd on eb1b4e1205b8
+  updating to "local" side of the conflict: c7d2d47c7240
+  merging "other" content-divergent changeset '0773642cfa95'
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  1 new orphan changesets
+  merge:[8] c_F
+  with: [10] c_F
+  base: [6] c_F
+  rebasing "other" content-divergent changeset 8ae8db670b4a on c7d2d47c7240
+  updating to "local" side of the conflict: a52ac76b45f5
+  merging "other" content-divergent changeset '6a87ed4aa317'
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg sum
+  parent: 8:a52ac76b45f5 tip
+   c_F
+  branch: default
+  commit: (clean)
+  update: 2 new changesets, 2 branch heads (merge)
+  phases: 2 draft
+
+  $ hg evolve --list
+
+  $ hg log -G --patch
+  @  changeset:   8:a52ac76b45f5
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c_F
+  |
+  |  diff -r c7d2d47c7240 -r a52ac76b45f5 c_F
+  |  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |  +++ b/c_F	Thu Jan 01 00:00:00 1970 +0000
+  |  @@ -0,0 +1,1 @@
+  |  +c_F
+  |
+  o  changeset:   7:c7d2d47c7240
+  |  parent:      2:eb1b4e1205b8
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c_E
+  |
+  |  diff -r eb1b4e1205b8 -r c7d2d47c7240 c_E
+  |  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |  +++ b/c_E	Thu Jan 01 00:00:00 1970 +0000
+  |  @@ -0,0 +1,1 @@
+  |  +c_E
+  |
+  | o  changeset:   4:dbb960d6c97c
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  summary:     c_D
+  | |
+  | |  diff -r abb77b893f28 -r dbb960d6c97c c_D
+  | |  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  | |  +++ b/c_D	Thu Jan 01 00:00:00 1970 +0000
+  | |  @@ -0,0 +1,1 @@
+  | |  +c_D
+  | |
+  | o  changeset:   3:abb77b893f28
+  |/   user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     c_C
+  |
+  |    diff -r eb1b4e1205b8 -r abb77b893f28 c_C
+  |    --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |    +++ b/c_C	Thu Jan 01 00:00:00 1970 +0000
+  |    @@ -0,0 +1,1 @@
+  |    +c_C
+  |
+  o  changeset:   2:eb1b4e1205b8
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c_B
+  |
+  |  diff -r e31751786014 -r eb1b4e1205b8 c_B
+  |  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |  +++ b/c_B	Thu Jan 01 00:00:00 1970 +0000
+  |  @@ -0,0 +1,1 @@
+  |  +c_B
+  |
+  o  changeset:   1:e31751786014
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     c_A
+  |
+  |  diff -r 1e4be0697311 -r e31751786014 c_A
+  |  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  |  +++ b/c_A	Thu Jan 01 00:00:00 1970 +0000
+  |  @@ -0,0 +1,1 @@
+  |  +c_A
+  |
+  o  changeset:   0:1e4be0697311
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     root
+  
+     diff -r 000000000000 -r 1e4be0697311 root
+     --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+     +++ b/root	Thu Jan 01 00:00:00 1970 +0000
+     @@ -0,0 +1,1 @@
+     +root
+  
+  $ hg export tip
+  # HG changeset patch
+  # User test
+  # Date 0 0
+  #      Thu Jan 01 00:00:00 1970 +0000
+  # Node ID a52ac76b45f523a039fc4a938d79874f4bdb1a85
+  # Parent  c7d2d47c7240562be5cbd1a24080dd0396178709
+  c_F
+  
+  diff -r c7d2d47c7240 -r a52ac76b45f5 c_F
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c_F	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,1 @@
+  +c_F
+
+  $ hg obslog --rev a52ac76b45f5
+  @    a52ac76b45f5 (8) c_F
+  |\
+  x |  6a87ed4aa317 (12) c_F
+  | |    rewritten as a52ac76b45f5 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  8ae8db670b4a (10) c_F
+  |/     rewritten(parent) as 6a87ed4aa317 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  77ccbf8d837e (6) c_F
+       rewritten(parent) as 8ae8db670b4a using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+       rewritten(parent) as a52ac76b45f5 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+