evolve: add test for `--continue` case when relocating "divergent"
authorSushil khanchi <sushilkhanchi97@gmail.com>
Mon, 25 Nov 2019 21:28:52 +0530
changeset 5015 43f4784a3f21
parent 5014 35870ce163ee
child 5016 64868b7dc112
evolve: add test for `--continue` case when relocating "divergent" This test shows that for now we don't handle the continue case when relocating "divergent" cset hit merge conflict while resolving content-divergence. Next patch will be adding the support for --continue case.
tests/test-evolve-content-divergent-stack.t
--- a/tests/test-evolve-content-divergent-stack.t	Mon Nov 25 19:12:51 2019 +0530
+++ b/tests/test-evolve-content-divergent-stack.t	Mon Nov 25 21:28:52 2019 +0530
@@ -10,6 +10,7 @@
   > [phases]
   > publish = False
   > [extensions]
+  > strip =
   > rebase =
   > EOF
   $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
@@ -348,6 +349,49 @@
   |   () [default] draft
   o  0:8fa14d15e168 added hgignore
       () [default] draft
+
+when "divergent" and "other" both hit merge conflict in relocating
+------------------------------------------------------------------
+
+  $ hg strip 14: --hidden
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  saved backup bundle to $TESTTMP/stackrepo1/.hg/strip-backup/74fbf3e6a0b6-f3612603-backup.hg
+  8 new content-divergent changesets
+
+Prepare repo to have merge conflicts
+  $ hg up -r "max(desc('added a'))"
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg evolve -r . --content-divergent
+  merge:[10] added a
+  with: [5] watbar to a
+  base: [1] added a
+  rebasing "other" content-divergent changeset 8e222f257bbf on 2228e3b74514
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  6 new orphan changesets
+  working directory is now at 74fbf3e6a0b6
+  $ echo b_conflict > b
+  $ hg amend -A
+  adding b
+
+Let's try to evolve stack
+  $ hg evolve --content-divergent
+  merge:[11] added b
+  with: [6] added b
+  base: [2] added b
+  rebasing "divergent" content-divergent changeset 6eb54b5af3fb on 119989a4317e
+  merging b
+  warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
+  unresolved merge conflicts
+  (see 'hg help evolve.interrupted')
+  [1]
+
+  $ echo b > b
+  $ hg res -m
+  (no more unresolved files)
+  continue: hg evolve --continue
+  $ hg evolve --continue 2>&1 | grep "KeyError"
+  KeyError: 'resolutionparent'
+
   $ cd ..
 
 Make sure that content-divergent resolution doesn't undo a change (issue6203)