tests/test-evolve-content-divergent-corner-cases.t
changeset 4493 32446b7a6e7c
parent 4481 d02a7c8cdee5
child 4513 d70db7e455dc
child 4576 96ce1030d2fb
--- a/tests/test-evolve-content-divergent-corner-cases.t	Wed Apr 10 17:29:40 2019 +0200
+++ b/tests/test-evolve-content-divergent-corner-cases.t	Wed Apr 10 17:57:11 2019 +0200
@@ -319,3 +319,67 @@
   ~
 
   $ cd ..
+
+Check that canceling of file deletion are merge correctly
+---------------------------------------------------------
+
+File addition/deletion tend to have special processing. So we better test them directory
+
+  $ hg init non-public
+  $ cd non-public
+  $ echo a > a
+  $ echo b > b
+  $ echo c > c
+  $ echo d > d
+  $ hg ci -Aqm initial
+
+oops, we meant to delete just 'a', but we deleted 'b' and 'c' too
+
+  $ hg rm a b c
+  $ hg ci -m 'delete a'
+  $ hg revert -r .^ b
+  $ hg amend
+
+create some content divergence
+
+  $ hg co dff6e52f5e41 --hidden
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  updated to hidden changeset dff6e52f5e41
+  (hidden revision 'dff6e52f5e41' was rewritten as: 0825dcee2670)
+  working directory parent is obsolete! (dff6e52f5e41)
+  (use 'hg evolve' to update to its successor: 0825dcee2670)
+  $ hg revert -r .^ c
+  $ hg amend
+  2 new content-divergent changesets
+  $ hg glog --hidden
+  @  3:92ecd58f9b05 delete a
+  |   () [default] draft
+  | *  2:0825dcee2670 delete a
+  |/    () [default] draft
+  | x  1:dff6e52f5e41 delete a
+  |/    () [default] draft
+  o  0:75d2b02c4a5c initial
+      () [default] draft
+
+Resolve the divergence, only "a" should be removed
+
+  $ hg evolve --content-divergent
+  merge:[3] delete a
+  with: [2] delete a
+  base: [1] delete a
+  merging "other" content-divergent changeset '0825dcee2670'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  working directory is now at 7ca6a9fafcf6
+  $ hg glog
+  @  4:7ca6a9fafcf6 delete a
+  |   () [default] draft
+  o  0:75d2b02c4a5c initial
+      () [default] draft
+
+  $ hg diff --change .
+  diff --git a/a b/a
+  deleted file mode 100644
+  --- a/a
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -a