changeset 23023:63c9088bebad

test-resolve: add tests for re-merge
author Martin von Zweigbergk <martinvonz@gmail.com>
date Wed, 08 Oct 2014 22:16:18 -0700
parents ace380a0619b
children ec36969497de
files tests/test-resolve.t
diffstat 1 files changed, 39 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-resolve.t	Wed Oct 08 22:19:08 2014 -0700
+++ b/tests/test-resolve.t	Wed Oct 08 22:16:18 2014 -0700
@@ -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