Patchwork [4,of,5] test-resolve: add tests for re-merge

login
register
mail settings
Submitter Martin von Zweigbergk
Date Oct. 10, 2014, 4:14 p.m.
Message ID <806a523b8b91284e01fb.1412957664@handduk2.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/6184/
State Accepted
Headers show

Comments

Martin von Zweigbergk - Oct. 10, 2014, 4:14 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@gmail.com>
# Date 1412831778 25200
#      Wed Oct 08 22:16:18 2014 -0700
# Node ID 806a523b8b91284e01fbc41f767f87a8fdeac342
# Parent  0210cb7c64ddcdfef4ebadb95a643e23e3a2d28b
test-resolve: add tests for re-merge
Augie Fackler - Oct. 17, 2014, 2:56 p.m.
On Fri, Oct 10, 2014 at 09:14:24AM -0700, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@gmail.com>
> # Date 1412831778 25200
> #      Wed Oct 08 22:16:18 2014 -0700
> # Node ID 806a523b8b91284e01fbc41f767f87a8fdeac342
> # Parent  0210cb7c64ddcdfef4ebadb95a643e23e3a2d28b
> test-resolve: add tests for re-merge
>
> diff --git a/tests/test-resolve.t b/tests/test-resolve.t
> --- a/tests/test-resolve.t
> +++ b/tests/test-resolve.t
> @@ -99,6 +99,45 @@
>    abort: resolve command not applicable when not merging
>    [255]
>
> +get back to conflicting state
> +
> +  $ hg up -qC 2
> +  $ hg merge --tool=internal:fail 1
> +  0 files updated, 0 files merged, 0 files removed, 2 files unresolved
> +  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
> +  [1]
> +
> +resolve without arguments should suggest --all
> +  $ hg resolve
> +  abort: no files or directories specified
> +  (use --all to remerge all files)
> +  [255]
> +
> +resolve --all should re-merge all unresolved files
> +  $ hg resolve -q --all
> +  warning: conflicts during merge.
> +  merging file1 incomplete! (edit conflicts, then use 'hg resolve --mark')
> +  warning: conflicts during merge.
> +  merging file2 incomplete! (edit conflicts, then use 'hg resolve --mark')
> +  [1]
> +  $ grep -q '<<<' file1
> +  $ grep -q '<<<' file2

Fixing in flight: check-code sends its regards.

> +
> +resolve <file> should re-merge file
> +  $ echo resolved > file1
> +  $ hg resolve -q file1
> +  warning: conflicts during merge.
> +  merging file1 incomplete! (edit conflicts, then use 'hg resolve --mark')
> +  [1]
> +  $ grep -q '<<<' file1
> +
> +resolve <file> should do nothing if 'file' was marked resolved
> +  $ echo resolved > file1
> +  $ hg resolve -m file1
> +  $ hg resolve -q file1
> +  $ cat file1
> +  resolved
> +
>  test crashed merge with empty mergestate
>
>    $ hg up -qC 1
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/tests/test-resolve.t b/tests/test-resolve.t
--- a/tests/test-resolve.t
+++ b/tests/test-resolve.t
@@ -99,6 +99,45 @@ 
   abort: resolve command not applicable when not merging
   [255]
 
+get back to conflicting state
+
+  $ hg up -qC 2
+  $ hg merge --tool=internal:fail 1
+  0 files updated, 0 files merged, 0 files removed, 2 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
+
+resolve without arguments should suggest --all
+  $ hg resolve
+  abort: no files or directories specified
+  (use --all to remerge all files)
+  [255]
+
+resolve --all should re-merge all unresolved files
+  $ hg resolve -q --all
+  warning: conflicts during merge.
+  merging file1 incomplete! (edit conflicts, then use 'hg resolve --mark')
+  warning: conflicts during merge.
+  merging file2 incomplete! (edit conflicts, then use 'hg resolve --mark')
+  [1]
+  $ grep -q '<<<' file1
+  $ grep -q '<<<' file2
+
+resolve <file> should re-merge file
+  $ echo resolved > file1
+  $ hg resolve -q file1
+  warning: conflicts during merge.
+  merging file1 incomplete! (edit conflicts, then use 'hg resolve --mark')
+  [1]
+  $ grep -q '<<<' file1
+
+resolve <file> should do nothing if 'file' was marked resolved
+  $ echo resolved > file1
+  $ hg resolve -m file1
+  $ hg resolve -q file1
+  $ cat file1
+  resolved
+
 test crashed merge with empty mergestate
 
   $ hg up -qC 1