tests: add test about aborting content-divergence when multiple parents
This patch adds tests for --abort flag of hg evolve command when we are
resolving content-divergence which are on different parents and parent of one of
them is the gca of both of them.
The tests shows that we are doing good and we should advertise the flag during
conflicts.
--- a/tests/test-evolve-abort-contentdiv.t Wed Jun 13 15:47:19 2018 +0530
+++ b/tests/test-evolve-abort-contentdiv.t Tue Jun 12 03:29:13 2018 +0530
@@ -221,3 +221,140 @@
rewritten(content) as 2ba73e31f264 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
rewritten(content) as 7398f702a162 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+ $ cd ..
+
+Creating content-divergence on multiple parents when gca of divergent changesets
+is parent of one of the divergents and relocating leads to conflicts
+---------------------------------------------------------------------------------
+
+ $ hg init multiparent
+ $ cd multiparent
+ $ 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
+ | () draft
+ o 3:ca1b80f7960a added c
+ | () draft
+ o 2:b1661037fa25 added b
+ | () draft
+ o 1:c7586e2a9264 added a
+ | () draft
+ o 0:8fa14d15e168 added hgignore
+ () draft
+
+ $ hg rebase -r . -d .^^^ --config extensions.rebase=
+ rebasing 4:c41c793e0ef1 "added d" (tip)
+ $ echo bar > c
+ $ hg add c
+ $ hg amend
+
+ $ hg up --hidden c41c793e0ef1
+ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ updated to hidden changeset c41c793e0ef1
+ (hidden revision 'c41c793e0ef1' was rewritten as: 69bdd23a9b0d)
+ working directory parent is obsolete! (c41c793e0ef1)
+ (use 'hg evolve' to update to its successor: 69bdd23a9b0d)
+ $ echo bar > d
+ $ hg amend
+ 2 new content-divergent changesets
+
+ $ hg glog
+ @ 7:e49523854bc8 added d
+ | () draft
+ | * 6:69bdd23a9b0d added d
+ | | () draft
+ o | 3:ca1b80f7960a added c
+ | | () draft
+ o | 2:b1661037fa25 added b
+ |/ () draft
+ o 1:c7586e2a9264 added a
+ | () draft
+ o 0:8fa14d15e168 added hgignore
+ () draft
+
+ $ hg evolve --content-divergent
+ merge:[7] added d
+ with: [6] added d
+ base: [4] added d
+ rebasing "other" content-divergent changeset 69bdd23a9b0d on ca1b80f7960a
+ merging c
+ warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
+ abort: unresolved merge conflicts (see hg help resolve)
+ [255]
+
+ $ hg evolve --abort
+ evolve aborted
+ working directory is now at e49523854bc8
+
+ $ hg glog
+ @ 7:e49523854bc8 added d
+ | () draft
+ | * 6:69bdd23a9b0d added d
+ | | () draft
+ o | 3:ca1b80f7960a added c
+ | | () draft
+ o | 2:b1661037fa25 added b
+ |/ () draft
+ o 1:c7586e2a9264 added a
+ | () draft
+ o 0:8fa14d15e168 added hgignore
+ () draft
+
+Creating content-divergence on multiple parents when gca of divergent changesets
+is parent of one of the divergents and merging divergent leads to conflicts
+---------------------------------------------------------------------------------
+
+ $ hg up 69bdd23a9b0d
+ 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ $ hg rm c
+ $ echo wat > d
+ $ hg amend
+
+ $ hg glog
+ @ 8:33e4442acf98 added d
+ | () draft
+ | * 7:e49523854bc8 added d
+ | | () draft
+ | o 3:ca1b80f7960a added c
+ | | () draft
+ | o 2:b1661037fa25 added b
+ |/ () draft
+ o 1:c7586e2a9264 added a
+ | () draft
+ o 0:8fa14d15e168 added hgignore
+ () draft
+
+ $ hg evolve --content-divergent
+ merge:[7] added d
+ with: [8] added d
+ base: [4] added d
+ rebasing "other" content-divergent changeset 33e4442acf98 on ca1b80f7960a
+ updating to "local" side of the conflict: e49523854bc8
+ merging "other" content-divergent changeset 'a663d1567f0b'
+ merging d
+ warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
+ 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+ abort: fix conflicts and run 'hg evolve --continue' or use 'hg update -C .' to abort
+ [255]
+
+ $ hg evolve --abort
+ evolve aborted
+ working directory is now at 33e4442acf98
+
+ $ hg glog
+ @ 8:33e4442acf98 added d
+ | () draft
+ | * 7:e49523854bc8 added d
+ | | () draft
+ | o 3:ca1b80f7960a added c
+ | | () draft
+ | o 2:b1661037fa25 added b
+ |/ () draft
+ o 1:c7586e2a9264 added a
+ | () draft
+ o 0:8fa14d15e168 added hgignore
+ () draft