changeset 23464:73d4f6551798

merge: add test with conflicting file and remote directory rename Changset 88629daa727b (merge: demonstrate that directory renames can lose local file content, 2014-12-02) should clearly have added the reverse version of the test: where the remote side renamed a directory, added a new file in that directory, and the local directory added a conflicting file in the source directory. Add such a test now, and also touch up the ones already added slightly (e.g. 'local' was a stupid value for content that can be on either side of a merge).
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 03 Dec 2014 10:01:24 -0800
parents bb0143e12f35
children 7e6d73f65e7b
files tests/test-rename-dir-merge.t
diffstat 1 files changed, 35 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-rename-dir-merge.t	Wed Dec 03 15:03:29 2014 -0800
+++ b/tests/test-rename-dir-merge.t	Wed Dec 03 10:01:24 2014 -0800
@@ -111,14 +111,16 @@
 BROKEN: the uncommitted file is overwritten; we should abort
 
   $ hg co -qC 1
-  $ echo local > b/c
+  $ echo target > b/c
   $ hg merge 2
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
-  $ hg st -C
+  $ hg st -A
   A b/c
     a/c
   ? a/d
+  C b/a
+  C b/b
   $ cat b/c
   baz
 
@@ -128,16 +130,45 @@
 BROKEN: the local file is overwritten; it should be merged
 
   $ hg co -qC 1
-  $ echo local > b/c
+  $ echo target > b/c
   $ hg add b/c
   $ hg commit -qm 'new file in target directory'
   $ hg merge 2
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
-  $ hg st -C
+  $ hg st -A
   A b/c
     a/c
   ? a/d
+  C b/a
+  C b/b
+  $ cat b/c
+  baz
+
+Remote directory rename with conflicting file added in remote target directory
+and committed in local source directory.
+
+BROKEN: the remote is ignored; it should be merged
+
+  $ hg co -qC 2
+  $ rm b/c
+  $ hg st -A
+  ? a/d
+  C a/a
+  C a/b
+  C a/c
+  $ hg merge 5
+  3 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg st -A
+  M b/a
+  M b/b
+  A b/c
+    a/c
+  R a/a
+  R a/b
+  R a/c
+  ? a/d
   $ cat b/c
   baz