Patchwork [2,of,5] test-resolve: add test resolving one of two files

login
register
mail settings
Submitter Martin von Zweigbergk
Date Oct. 10, 2014, 4:14 p.m.
Message ID <92cd0aa103261ca361ea.1412957662@handduk2.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/6183/
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 1412827650 25200
#      Wed Oct 08 21:07:30 2014 -0700
# Node ID 92cd0aa103261ca361ea99e118e1456d8d6052f9
# Parent  0c8c43d9366c1b9a7a87b8df56f689c978ec8a88
test-resolve: add test resolving one of two files

The tests for resolve are missing a lot of cases. Let's start by
adding another file to the test repo, so we can test resolving one of
two files.

Patch

diff --git a/tests/test-resolve.t b/tests/test-resolve.t
--- a/tests/test-resolve.t
+++ b/tests/test-resolve.t
@@ -3,33 +3,37 @@ 
   $ hg init repo
   $ cd repo
 
-  $ echo foo > file
-  $ hg commit -Am 'add file'
-  adding file
+  $ echo foo > file1
+  $ echo foo > file2
+  $ hg commit -Am 'add files'
+  adding file1
+  adding file2
 
-  $ echo bar >> file
-  $ hg commit -Am 'append bar'
-
+  $ echo bar >> file1
+  $ echo bar >> file2
+  $ hg commit -Am 'append bar to files'
 
 create a second head
 
   $ hg up -C 0
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ echo baz >> file
-  $ hg commit -Am 'append baz'
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo baz >> file1
+  $ echo baz >> file2
+  $ hg commit -Am 'append baz to files'
   created new head
 
 failing merge
 
   $ hg merge --tool=internal:fail
-  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  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 -l should contain an unresolved entry
+resolve -l should contain unresolved entries
 
   $ hg resolve -l
-  U file
+  U file1
+  U file2
 
 resolving an unknown path should emit a warning
 
@@ -38,8 +42,18 @@ 
 
 resolve the failure
 
-  $ echo resolved > file
-  $ hg resolve -m file
+  $ echo resolved > file1
+  $ hg resolve -m file1
+
+resolve -l should show resolved file as resolved
+
+  $ hg resolve -l
+  R file1
+  U file2
+
+resolve -m without paths should mark all resolved
+
+  $ hg resolve -m
   (no more unresolved files)
   $ hg commit -m 'resolved'