Patchwork merge: add test with conflicting file and remote directory rename

login
register
mail settings
Submitter Martin von Zweigbergk
Date Dec. 3, 2014, 6:06 p.m.
Message ID <420f46b5d327725bda71.1417630005@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/6983/
State Accepted
Commit 73d4f655179862a5b744650c5f143c1c8f293b29
Headers show

Comments

Martin von Zweigbergk - Dec. 3, 2014, 6:06 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1417629684 28800
#      Wed Dec 03 10:01:24 2014 -0800
# Node ID 420f46b5d327725bda711cde95da34a47f0aec24
# Parent  fc76f55705eb5884707c977ecb756aee7c794676
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).
Matt Mackall - Dec. 4, 2014, 1:07 a.m.
On Wed, 2014-12-03 at 10:06 -0800, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1417629684 28800
> #      Wed Dec 03 10:01:24 2014 -0800
> # Node ID 420f46b5d327725bda711cde95da34a47f0aec24
> # Parent  fc76f55705eb5884707c977ecb756aee7c794676
> merge: add test with conflicting file and remote directory rename

Queued for default, thanks.

Patch

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 @@ 
 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