# HG changeset patch # User Martin von Zweigbergk # Date 2014-12-03 18:01:24 # Node ID 73d4f655179862a5b744650c5f143c1c8f293b29 # Parent bb0143e12f3513877cf984d76395220578eb1c2d 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). diff --git a/tests/test-rename-dir-merge.t b/tests/test-rename-dir-merge.t --- a/tests/test-rename-dir-merge.t +++ b/tests/test-rename-dir-merge.t @@ -111,14 +111,16 @@ and untracked in local target directory. 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 @@ and committed in local target directory. 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