changeset 5513:a8c21707e9c4

evolve: add test to show broken --continue case of content divergence This test case demonstrates that during the resolution of content divergence which includes relocation of "divergent" side but not "other" and results in merge conflict during relocation, we can lose some changes. Next patch will fix this bug.
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Wed, 05 Aug 2020 00:16:26 +0530
parents 9fef6f8790a5
children 4c3656aaacc6
files tests/test-evolve-content-divergent-stack.t
diffstat 1 files changed, 97 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-evolve-content-divergent-stack.t	Wed Aug 26 17:25:02 2020 +0530
+++ b/tests/test-evolve-content-divergent-stack.t	Wed Aug 05 00:16:26 2020 +0530
@@ -173,6 +173,103 @@
   |   () [default] draft
   o  0:8fa14d15e168 added hgignore
       () [default] draft
+
+Testing --continue case when relocating "divergent"
+---------------------------------------------------
+When no relocation is required for "other", but "divergent"
+hit merge conflict in relocation. This test makes sure that
+content of two divergent csets merged correctly after the
+merge conflict.
+
+  $ hg log -r "desc('added c')" -p
+  changeset:   17:a18171c7d9e7
+  parent:      15:365f419742a3
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     added c
+  
+  diff -r 365f419742a3 -r a18171c7d9e7 c
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,1 @@
+  +foo
+  
+  $ hg strip -r 16: --hidden
+  saved backup bundle to $TESTTMP/stacktest/.hg/strip-backup/b949c7ad8d83-6039d2cc-backup.hg
+  4 new orphan changesets
+  4 new content-divergent changesets
+  $ hg glog
+  o  15:365f419742a3 added b
+  |   () [default] draft
+  @  13:df93a529fa42 watbar to a
+  |   () [default] draft
+  | *  12:15c781f93cac added d
+  | |   () [default] draft
+  | *  11:9e5fb1d5b955 added c
+  | |   () [default] draft
+  | x  10:88516dccf68a added b
+  | |   () [default] draft
+  | x  9:82b74d5dc678 watbar to a
+  |/    () [default] draft
+  | *  8:c72d2885eb51 added d
+  | |   () [default] draft
+  | *  7:3ce4be6d8e5e added c
+  | |   () [default] draft
+  | x  6:d5f148423c16 added b
+  | |   () [default] draft
+  | x  5:8e222f257bbf watbar to a
+  |/    () [default] draft
+  o  0:8fa14d15e168 added hgignore
+      () [default] draft
+  $ hg next
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  [15] added b
+  $ echo conflict > c
+  $ hg amend -A
+  adding c
+
+add some changes on "other" side, to check later that merging performed correctly
+  $ hg up -r 11
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo new_file > newfile
+  $ hg amend -Am "added c and newfile"
+  adding newfile
+
+  $ hg evolve --content-divergent -r 7
+  merge:[7] added c
+  with: [17] added c and newfile
+  base: [3] added c
+  rebasing "divergent" content-divergent changeset 3ce4be6d8e5e on fb488ec29dfa
+  merging c
+  warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
+  unresolved merge conflicts
+  (see 'hg help evolve.interrupted')
+  [1]
+  $ echo c > c
+  $ hg res -m
+  (no more unresolved files)
+  continue: hg evolve --continue
+
+  $ hg evolve --continue
+  evolving 7:3ce4be6d8e5e "added c"
+  working directory is now at 9cede3ad51fc
+# XXX: resultant cset should contain the newfile added on "other" side
+  $ hg log -p -l1
+  changeset:   19:9cede3ad51fc
+  tag:         tip
+  parent:      16:fb488ec29dfa
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     added c and newfile
+  
+  diff -r fb488ec29dfa -r 9cede3ad51fc c
+  --- a/c	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,1 @@
+  -conflict
+  +c
+  
+
 Resolving content-divergence of a stack with different parents
 ---------------------------------------------------------