tests/test-evolve-content-divergence.t
changeset 4441 f606eab8dff8
parent 4428 fe37721aa0d9
child 4442 819bad275701
--- a/tests/test-evolve-content-divergence.t	Fri Mar 22 09:45:07 2019 -0700
+++ b/tests/test-evolve-content-divergence.t	Fri Mar 22 00:16:44 2019 +0530
@@ -928,6 +928,186 @@
   o  0:8fa14d15e168 added hgignore
       () [default] draft
 
+Resolving content-divergence of a stack with different parents
+---------------------------------------------------------
+
+  $ cd ..
+  $ hg init stackrepo1
+  $ cd stackrepo1
+  $ echo ".*\.orig" > .hgignore
+  $ hg add .hgignore
+  $ hg ci -m "added hgignore"
+
+  $ for ch in a b c d;
+  > do echo foo > $ch;
+  > hg add $ch;
+  > hg ci -qm "added "$ch;
+  > done;
+
+  $ hg glog
+  @  4:c41c793e0ef1 added d
+  |   () [default] draft
+  o  3:ca1b80f7960a added c
+  |   () [default] draft
+  o  2:b1661037fa25 added b
+  |   () [default] draft
+  o  1:c7586e2a9264 added a
+  |   () [default] draft
+  o  0:8fa14d15e168 added hgignore
+      () [default] draft
+
+  $ cd ..
+  $ hg init stackrepo2
+  $ cd stackrepo2
+  $ hg pull ../stackrepo1
+  pulling from ../stackrepo1
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 5 changesets with 5 changes to 5 files
+  new changesets 8fa14d15e168:c41c793e0ef1 (5 drafts)
+  (run 'hg update' to get a working copy)
+
+  $ hg glog
+  o  4:c41c793e0ef1 added d
+  |   () [default] draft
+  o  3:ca1b80f7960a added c
+  |   () [default] draft
+  o  2:b1661037fa25 added b
+  |   () [default] draft
+  o  1:c7586e2a9264 added a
+  |   () [default] draft
+  o  0:8fa14d15e168 added hgignore
+      () [default] draft
+
+  $ hg up 8fa14d15e168
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo newfile > newfile
+  $ hg ci -Am "add newfile"
+  adding newfile
+  created new head
+  $ hg rebase -s c7586e2a9264 -d .
+  rebasing 1:c7586e2a9264 "added a"
+  rebasing 2:b1661037fa25 "added b"
+  rebasing 3:ca1b80f7960a "added c"
+  rebasing 4:c41c793e0ef1 "added d"
+
+  $ hg glog
+  o  9:d45f050514c2 added d
+  |   () [default] draft
+  o  8:8ed612937375 added c
+  |   () [default] draft
+  o  7:6eb54b5af3fb added b
+  |   () [default] draft
+  o  6:c04ff147ef79 added a
+  |   () [default] draft
+  @  5:2228e3b74514 add newfile
+  |   () [default] draft
+  o  0:8fa14d15e168 added hgignore
+      () [default] draft
+
+  $ cd ../stackrepo1
+  $ hg up .^^^
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  $ echo wat > a
+  $ hg amend -m "watbar to a"
+  3 new orphan changesets
+  $ hg evolve --all
+  move:[2] added b
+  atop:[5] watbar to a
+  move:[3] added c
+  move:[4] added d
+  working directory is now at c72d2885eb51
+
+  $ hg glog
+  @  8:c72d2885eb51 added d
+  |   () [default] draft
+  o  7:3ce4be6d8e5e added c
+  |   () [default] draft
+  o  6:d5f148423c16 added b
+  |   () [default] draft
+  o  5:8e222f257bbf watbar to a
+  |   () [default] draft
+  o  0:8fa14d15e168 added hgignore
+      () [default] draft
+
+  $ hg pull ../stackrepo2
+  pulling from ../stackrepo2
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 5 changesets with 1 changes to 5 files (+1 heads)
+  4 new obsolescence markers
+  8 new content-divergent changesets
+  new changesets 2228e3b74514:d45f050514c2 (5 drafts)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+  $ hg glog
+  *  13:d45f050514c2 added d
+  |   () [default] draft
+  *  12:8ed612937375 added c
+  |   () [default] draft
+  *  11:6eb54b5af3fb added b
+  |   () [default] draft
+  *  10:c04ff147ef79 added a
+  |   () [default] draft
+  o  9:2228e3b74514 add newfile
+  |   () [default] draft
+  | @  8:c72d2885eb51 added d
+  | |   () [default] draft
+  | *  7:3ce4be6d8e5e added c
+  | |   () [default] draft
+  | *  6:d5f148423c16 added b
+  | |   () [default] draft
+  | *  5:8e222f257bbf watbar to a
+  |/    () [default] draft
+  o  0:8fa14d15e168 added hgignore
+      () [default] draft
+
+  $ hg evolve --all --content-divergent
+  merge:[10] added a
+  with: [5] watbar to a
+  base: [1] added a
+  rebasing "other" content-divergent changeset 8e222f257bbf on 2228e3b74514
+  updating to "local" side of the conflict: c04ff147ef79
+  merging "other" content-divergent changeset '186bdc2cdfa2'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  6 new orphan changesets
+  merge:[6] added b
+  with: [11] added b
+  base: [2] added b
+  updating to "local" side of the conflict: d5f148423c16
+  merging "other" content-divergent changeset '6eb54b5af3fb'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  merge:[7] added c
+  with: [12] added c
+  base: [3] added c
+  updating to "local" side of the conflict: 3ce4be6d8e5e
+  merging "other" content-divergent changeset '8ed612937375'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  merge:[8] added d
+  with: [13] added d
+  base: [4] added d
+  updating to "local" side of the conflict: c72d2885eb51
+  merging "other" content-divergent changeset 'd45f050514c2'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  working directory is now at c8f73c376a6e
+
+  $ hg glog
+  @  18:c8f73c376a6e added d
+  |   () [default] draft
+  o  17:77126af93a25 added c
+  |   () [default] draft
+  o  16:4e29776e83a5 added b
+  |   () [default] draft
+  o  15:74fbf3e6a0b6 watbar to a
+  |   () [default] draft
+  o  9:2228e3b74514 add newfile
+  |   () [default] draft
+  o  0:8fa14d15e168 added hgignore
+      () [default] draft
 
 Test to make sure that evolve don't fall into unrecoverable state (issue6053)
 ------------------------------------------------------------------------------