changeset 5786:c0122b98356c

divergence-resolution: [patch 1] fix a messed up test case Because of logic change in divergence resolution which causes the order change in picking the resolution parent this test case was messed up. It was supposed to test that that it hits conflict while relocating the divergent cset but because of some change in previous patches, relocation went successful and it hits conflict while merging the two divergent csets. This patch, by making some changes in files content make sure that we get conflict during relocation.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 24 Jan 2021 19:47:17 +0530
parents a9ad01ed1539
children 32c0b2899fc4
files tests/test-evolve-content-divergent-interrupted.t
diffstat 1 files changed, 36 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-evolve-content-divergent-interrupted.t	Wed Feb 17 18:11:44 2021 +0530
+++ b/tests/test-evolve-content-divergent-interrupted.t	Sun Jan 24 19:47:17 2021 +0530
@@ -537,17 +537,25 @@
 relocation
 ---------------------------------------------------------------------------
 
-  $ echo babar > c
-  $ hg add c
-  c already tracked!
+Making changes to make sure that it hits conflict while relocating
+  $ hg up -r 3
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo "some_changes" >> a
+  $ hg amend
+  1 new orphan changesets
+  $ hg next
+  move:[5] added d
+  atop:[8] added c
+  working directory is now at dc9ba677cba1
+  $ echo "latest_changes" >> a
   $ hg amend
   $ hg glog
-  @  8:2d664a4ab749 added d
+  @  10:0892835a581f added d
+  |   () draft
+  o  8:33c16a2e0eb8 added c
   |   () draft
   | *  7:517d4375cb72 added d
   | |   () draft
-  o |  3:ca1b80f7960a added c
-  | |   () draft
   o |  2:b1661037fa25 added b
   |/    () draft
   o  1:c7586e2a9264 added a
@@ -557,50 +565,47 @@
 
   $ hg evolve --content-divergent
   merge:[7] added d
-  with: [8] added d
+  with: [10] added d
   base: [4] added d
-  rebasing "other" content-divergent changeset 2d664a4ab749 on c7586e2a9264
-  file 'c' was deleted in local but was modified in other.
-  You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
-  What do you want to do? u
-  merging d
-  warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
-  0 files updated, 0 files merged, 0 files removed, 2 files unresolved
+  rebasing "other" content-divergent changeset 0892835a581f on c7586e2a9264
+  merging a
+  warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
   unresolved merge conflicts
   (see 'hg help evolve.interrupted')
   [240]
 
   $ hg diff
-  diff -r 517d4375cb72 c
+  diff -r c7586e2a9264 a
+  --- a/a	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,6 @@
+   foo
+  +<<<<<<< destination: c7586e2a9264 - test: added a
+  +=======
+  +some_changes
+  +latest_changes
+  +>>>>>>> evolving:    0892835a581f - test: added d
+  diff -r c7586e2a9264 d
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-  +++ b/c	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/d	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
-  +babar
-  diff -r 517d4375cb72 d
-  --- a/d	Thu Jan 01 00:00:00 1970 +0000
-  +++ b/d	Thu Jan 01 00:00:00 1970 +0000
-  @@ -1,1 +1,5 @@
-  +<<<<<<< local: 517d4375cb72 - test: added d
-   foobar
-  +=======
   +bar
-  +>>>>>>> other: e315463d94bd - test: added d
 
   $ hg evolve --stop
   stopped the interrupted evolve
-  working directory is now at 2d664a4ab749
+  working directory is now at c7586e2a9264
 
-XXX: we should have preserved the wdir to be at rev 8
+XXX: we should have preserved the wdir to be at rev 10
   $ hg glog
-  @  8:2d664a4ab749 added d
+  *  10:0892835a581f added d
+  |   () draft
+  o  8:33c16a2e0eb8 added c
   |   () draft
   | *  7:517d4375cb72 added d
   | |   () draft
-  o |  3:ca1b80f7960a added c
-  | |   () draft
   o |  2:b1661037fa25 added b
   |/    () draft
-  o  1:c7586e2a9264 added a
+  @  1:c7586e2a9264 added a
   |   () draft
   o  0:8fa14d15e168 added hgignore
       () draft