diff tests/test-evolve-content-divergence.t @ 4422:62a6f8f4e694

branching: merge with stable
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 04 Mar 2019 12:30:15 +0100
parents 02ece0e5865e 6a20e0e9b957
children fe37721aa0d9
line wrap: on
line diff
--- a/tests/test-evolve-content-divergence.t	Sat Mar 02 02:34:29 2019 +0530
+++ b/tests/test-evolve-content-divergence.t	Mon Mar 04 12:30:15 2019 +0100
@@ -927,3 +927,102 @@
   |   () [default] draft
   o  0:8fa14d15e168 added hgignore
       () [default] draft
+
+
+Test to make sure that evolve don't fall into unrecoverable state (issue6053):
+------------------------------------------------------------------------------
+  $ cd ..
+  $ hg init localside
+  $ cd localside
+  $ for ch in a b c d e; do
+  > echo $ch > $ch;
+  > hg add $ch;
+  > hg ci -m "added "$ch;
+  > done;
+
+  $ hg glog
+  @  4:8d71eadcc9df added e
+  |   () [default] draft
+  o  3:9150fe93bec6 added d
+  |   () [default] draft
+  o  2:155349b645be added c
+  |   () [default] draft
+  o  1:5f6d8a4bf34a added b
+  |   () [default] draft
+  o  0:9092f1db7931 added a
+      () [default] draft
+
+  $ echo ee > e
+  $ hg amend -m "updated e"
+
+  $ hg up 1 -q
+  $ echo dd > d
+  $ echo ee > e
+  $ hg add d e
+  $ hg ci -m "updated e"
+  created new head
+
+  $ hg prune 4 -s . --hidden
+  1 changesets pruned
+  2 new content-divergent changesets
+
+  $ hg prune 3
+  1 changesets pruned
+  1 new orphan changesets
+
+  $ hg glog
+  @  6:de4ea3103326 updated e
+  |   () [default] draft
+  | *  5:ff6f7cd76a7c updated e
+  | |   () [default] draft
+  | x  3:9150fe93bec6 added d
+  | |   () [default] draft
+  | o  2:155349b645be added c
+  |/    () [default] draft
+  o  1:5f6d8a4bf34a added b
+  |   () [default] draft
+  o  0:9092f1db7931 added a
+      () [default] draft
+
+  $ hg evolve --content-divergent --any
+  merge:[5] updated e
+  with: [6] updated e
+  base: [4] added e
+  rebasing "other" content-divergent changeset de4ea3103326 on 9150fe93bec6
+  merging d
+  warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
+  fix conflicts and see `hg help evolve.interrupted`
+  [1]
+
+  $ hg diff
+  diff -r 9150fe93bec6 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 @@
+  +<<<<<<< destination: 9150fe93bec6 - test: added d
+   d
+  +=======
+  +dd
+  +>>>>>>> evolving:    de4ea3103326 - test: updated e
+  diff -r 9150fe93bec6 e
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/e	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,1 @@
+  +ee
+
+  $ echo dresolved > d
+  $ hg res -m
+  (no more unresolved files)
+  continue: hg evolve --continue
+
+  $ hg evolve --continue
+  evolving 6:de4ea3103326 "updated e"
+  updating to "local" side of the conflict: ff6f7cd76a7c
+  merging "other" content-divergent changeset 'e504bd82de7e'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  working directory is now at 83b1664a580f
+
+  $ hg glog -l1
+  @  8:83b1664a580f updated e
+  |   () [default] draft
+  ~