Patchwork [5,of,6,mergedriver] test-merge-changedelete.t: add a file with regular merge conflicts

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 24, 2015, 10:02 p.m.
Message ID <50ae01719de5fdada5e3.1448402560@dev666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11614/
State Superseded
Commit 969ca40cad1dbae493c5796da30504ebed4cfaa1
Delegated to: Martin von Zweigbergk
Headers show

Comments

Siddharth Agarwal - Nov. 24, 2015, 10:02 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1448314994 28800
#      Mon Nov 23 13:43:14 2015 -0800
# Node ID 50ae01719de5fdada5e3d3f5d530a41dd56b0253
# Parent  b2436682a9f6f8b56b768475004aecf57cab6677
# Available At http://42.netv6.net/sid0-wip/hg/
#              hg pull http://42.netv6.net/sid0-wip/hg/ -r 50ae01719de5
test-merge-changedelete.t: add a file with regular merge conflicts

In upcoming patches we're going to move change/delete conflicts to the resolve
phase -- it will be important to see how regular conflicts interact with
change/delete ones.
Martin von Zweigbergk - Nov. 28, 2015, 5:55 a.m.
On Tue, Nov 24, 2015 at 2:07 PM Siddharth Agarwal <sid0@fb.com> wrote:

> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1448314994 28800
> #      Mon Nov 23 13:43:14 2015 -0800
> # Node ID 50ae01719de5fdada5e3d3f5d530a41dd56b0253
> # Parent  b2436682a9f6f8b56b768475004aecf57cab6677
> # Available At http://42.netv6.net/sid0-wip/hg/
> #              hg pull http://42.netv6.net/sid0-wip/hg/ -r 50ae01719de5
> test-merge-changedelete.t: add a file with regular merge conflicts
>
> In upcoming patches we're going to move change/delete conflicts to the
> resolve
> phase -- it will be important to see how regular conflicts interact with
> change/delete ones.
>
> diff --git a/tests/test-merge-changedelete.t
> b/tests/test-merge-changedelete.t
> --- a/tests/test-merge-changedelete.t
> +++ b/tests/test-merge-changedelete.t
> @@ -10,8 +10,8 @@ Make sure HGMERGE doesn't interfere with
>
>    $ status() {
>    >     echo "--- status ---"
> -  >     hg st -A file1 file2
> -  >     for file in file1 file2; do
> +  >     hg st -A file1 file2 file3
> +  >     for file in file1 file2 file3; do
>    >         if [ -f $file ]; then
>    >             echo "--- $file ---"
>    >             cat $file
> @@ -25,20 +25,24 @@ Make sure HGMERGE doesn't interfere with
>
>    $ echo 1 > file1
>    $ echo 2 > file2
> -  $ hg ci -Am 'added file1 and file2'
> +  $ echo 3 > file3
> +  $ hg ci -Am 'added files'
>    adding file1
>    adding file2
> +  adding file3
>
>    $ hg rm file1
>    $ echo changed >> file2
> -  $ hg ci -m 'removed file1, changed file2'
> +  $ echo changed1 >> file3
> +  $ hg ci -m 'removed file1, changed file2, changed file3'
>
>    $ hg co 0
> -  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
>
>    $ echo changed >> file1
>    $ hg rm file2
> -  $ hg ci -m 'changed file1, removed file2'
> +  $ echo changed2 >> file3
> +  $ hg ci -m 'changed file1, removed file2, changed file3'
>    created new head
>
>
> @@ -49,12 +53,16 @@ Non-interactive merge:
>    use (c)hanged version or (d)elete? c
>    remote changed file2 which local deleted
>    use (c)hanged version or leave (d)eleted? c
> -  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> -  (branch merge, don't forget to commit)
> +  merging file3
>

The test hangs here on my machine, i.e. the line above is printed, but the
line below is not. I haven't looked into it in more detail.


> +  warning: conflicts while merging file3! (edit, then use 'hg resolve
> --mark')
> +  1 files updated, 0 files merged, 0 files removed, 1 files unresolved
> +  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to
> abandon
> +  [1]
>
>    $ status
>    --- status ---
>    M file2
> +  M file3
>    C file1
>    --- file1 ---
>    1
> @@ -62,12 +70,19 @@ Non-interactive merge:
>    --- file2 ---
>    2
>    changed
> +  --- file3 ---
> +  3
> +  <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2,
> changed file3
> +  changed2
> +  =======
> +  changed1
> +  >>>>>>> other: 10f9a0a634e8  - test: removed file1, changed file2,
> changed file3
>
>
>  Interactive merge:
>
>    $ hg co -C
> -  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
> +  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
>
>    $ hg merge --config ui.interactive=true <<EOF
>    > c
> @@ -77,23 +92,34 @@ Interactive merge:
>    use (c)hanged version or (d)elete? c
>    remote changed file2 which local deleted
>    use (c)hanged version or leave (d)eleted? d
> -  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
> -  (branch merge, don't forget to commit)
> +  merging file3
> +  warning: conflicts while merging file3! (edit, then use 'hg resolve
> --mark')
> +  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
> +  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to
> abandon
> +  [1]
>
>    $ status
>    --- status ---
>    file2: * (glob)
> +  M file3
>    C file1
>    --- file1 ---
>    1
>    changed
>    *** file2 does not exist
> +  --- file3 ---
> +  3
> +  <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2,
> changed file3
> +  changed2
> +  =======
> +  changed1
> +  >>>>>>> other: 10f9a0a634e8  - test: removed file1, changed file2,
> changed file3
>
>
>  Interactive merge with bad input:
>
>    $ hg co -C
> -  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>
>    $ hg merge --config ui.interactive=true <<EOF
>    > foo
> @@ -115,23 +141,34 @@ Interactive merge with bad input:
>    unrecognized response
>    remote changed file2 which local deleted
>    use (c)hanged version or leave (d)eleted? c
> -  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
> -  (branch merge, don't forget to commit)
> +  merging file3
> +  warning: conflicts while merging file3! (edit, then use 'hg resolve
> --mark')
> +  1 files updated, 0 files merged, 1 files removed, 1 files unresolved
> +  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to
> abandon
> +  [1]
>
>    $ status
>    --- status ---
>    M file2
> +  M file3
>    R file1
>    *** file1 does not exist
>    --- file2 ---
>    2
>    changed
> +  --- file3 ---
> +  3
> +  <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2,
> changed file3
> +  changed2
> +  =======
> +  changed1
> +  >>>>>>> other: 10f9a0a634e8  - test: removed file1, changed file2,
> changed file3
>
>
>  Interactive merge with not enough input:
>
>    $ hg co -C
> -  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
> +  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
>
>    $ hg merge --config ui.interactive=true <<EOF
>    > d
> @@ -146,15 +183,19 @@ Interactive merge with not enough input:
>    --- status ---
>    file2: * (glob)
>    C file1
> +  C file3
>    --- file1 ---
>    1
>    changed
>    *** file2 does not exist
> +  --- file3 ---
> +  3
> +  changed2
>
>  Non-interactive linear update
>
>    $ hg co -C 0
> -  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
>    $ echo changed >> file1
>    $ hg rm file2
>    $ hg update 1 -y
> @@ -162,14 +203,18 @@ Non-interactive linear update
>    use (c)hanged version or (d)elete? c
>    remote changed file2 which local deleted
>    use (c)hanged version or leave (d)eleted? c
> -  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
>    $ status
>    --- status ---
>    A file1
>    C file2
> +  C file3
>    --- file1 ---
>    1
>    changed
>    --- file2 ---
>    2
>    changed
> +  --- file3 ---
> +  3
> +  changed1
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/tests/test-merge-changedelete.t b/tests/test-merge-changedelete.t
--- a/tests/test-merge-changedelete.t
+++ b/tests/test-merge-changedelete.t
@@ -10,8 +10,8 @@  Make sure HGMERGE doesn't interfere with
 
   $ status() {
   >     echo "--- status ---"
-  >     hg st -A file1 file2
-  >     for file in file1 file2; do
+  >     hg st -A file1 file2 file3
+  >     for file in file1 file2 file3; do
   >         if [ -f $file ]; then
   >             echo "--- $file ---"
   >             cat $file
@@ -25,20 +25,24 @@  Make sure HGMERGE doesn't interfere with
 
   $ echo 1 > file1
   $ echo 2 > file2
-  $ hg ci -Am 'added file1 and file2'
+  $ echo 3 > file3
+  $ hg ci -Am 'added files'
   adding file1
   adding file2
+  adding file3
 
   $ hg rm file1
   $ echo changed >> file2
-  $ hg ci -m 'removed file1, changed file2'
+  $ echo changed1 >> file3
+  $ hg ci -m 'removed file1, changed file2, changed file3'
 
   $ hg co 0
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
   $ echo changed >> file1
   $ hg rm file2
-  $ hg ci -m 'changed file1, removed file2'
+  $ echo changed2 >> file3
+  $ hg ci -m 'changed file1, removed file2, changed file3'
   created new head
 
 
@@ -49,12 +53,16 @@  Non-interactive merge:
   use (c)hanged version or (d)elete? c
   remote changed file2 which local deleted
   use (c)hanged version or leave (d)eleted? c
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  (branch merge, don't forget to commit)
+  merging file3
+  warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
+  1 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
 
   $ status
   --- status ---
   M file2
+  M file3
   C file1
   --- file1 ---
   1
@@ -62,12 +70,19 @@  Non-interactive merge:
   --- file2 ---
   2
   changed
+  --- file3 ---
+  3
+  <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
+  changed2
+  =======
+  changed1
+  >>>>>>> other: 10f9a0a634e8  - test: removed file1, changed file2, changed file3
 
 
 Interactive merge:
 
   $ hg co -C
-  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
 
   $ hg merge --config ui.interactive=true <<EOF
   > c
@@ -77,23 +92,34 @@  Interactive merge:
   use (c)hanged version or (d)elete? c
   remote changed file2 which local deleted
   use (c)hanged version or leave (d)eleted? d
-  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  (branch merge, don't forget to commit)
+  merging file3
+  warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
 
   $ status
   --- status ---
   file2: * (glob)
+  M file3
   C file1
   --- file1 ---
   1
   changed
   *** file2 does not exist
+  --- file3 ---
+  3
+  <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
+  changed2
+  =======
+  changed1
+  >>>>>>> other: 10f9a0a634e8  - test: removed file1, changed file2, changed file3
 
 
 Interactive merge with bad input:
 
   $ hg co -C
-  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
   $ hg merge --config ui.interactive=true <<EOF
   > foo
@@ -115,23 +141,34 @@  Interactive merge with bad input:
   unrecognized response
   remote changed file2 which local deleted
   use (c)hanged version or leave (d)eleted? c
-  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  (branch merge, don't forget to commit)
+  merging file3
+  warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
+  1 files updated, 0 files merged, 1 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
 
   $ status
   --- status ---
   M file2
+  M file3
   R file1
   *** file1 does not exist
   --- file2 ---
   2
   changed
+  --- file3 ---
+  3
+  <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
+  changed2
+  =======
+  changed1
+  >>>>>>> other: 10f9a0a634e8  - test: removed file1, changed file2, changed file3
 
 
 Interactive merge with not enough input:
 
   $ hg co -C
-  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
 
   $ hg merge --config ui.interactive=true <<EOF
   > d
@@ -146,15 +183,19 @@  Interactive merge with not enough input:
   --- status ---
   file2: * (glob)
   C file1
+  C file3
   --- file1 ---
   1
   changed
   *** file2 does not exist
+  --- file3 ---
+  3
+  changed2
 
 Non-interactive linear update
 
   $ hg co -C 0
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ echo changed >> file1
   $ hg rm file2
   $ hg update 1 -y
@@ -162,14 +203,18 @@  Non-interactive linear update
   use (c)hanged version or (d)elete? c
   remote changed file2 which local deleted
   use (c)hanged version or leave (d)eleted? c
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ status
   --- status ---
   A file1
   C file2
+  C file3
   --- file1 ---
   1
   changed
   --- file2 ---
   2
   changed
+  --- file3 ---
+  3
+  changed1