--- a/tests/test-evolve-content-divergence.t Sat Mar 02 01:43:14 2019 +0530
+++ b/tests/test-evolve-content-divergence.t Mon Mar 04 02:55:38 2019 +0530
@@ -927,3 +927,106 @@
| () [default] draft
o 0:8fa14d15e168 added hgignore
() [default] draft
+
+
+Test which demonstrate that evolve can 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
+ update:[2] added c
+ abort: outstanding uncommitted merge
+ [255]
+
+ $ hg evolve --abort
+ update:[2] added c
+ abort: outstanding uncommitted merge
+ [255]
+
+ $ hg ci -m "merge commit"
+ abort: evolve in progress
+ (use 'hg evolve --continue' or 'hg evolve --abort' to abort)
+ [255]
+