comparison tests/test-resolve.t @ 23021:41770cee3c6a

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.
author Martin von Zweigbergk <martinvonz@gmail.com>
date Wed, 08 Oct 2014 21:07:30 -0700
parents dfad19274d85
children ace380a0619b
comparison
equal deleted inserted replaced
23020:dfad19274d85 23021:41770cee3c6a
1 test that a commit clears the merge state. 1 test that a commit clears the merge state.
2 2
3 $ hg init repo 3 $ hg init repo
4 $ cd repo 4 $ cd repo
5 5
6 $ echo foo > file 6 $ echo foo > file1
7 $ hg commit -Am 'add file' 7 $ echo foo > file2
8 adding file 8 $ hg commit -Am 'add files'
9 adding file1
10 adding file2
9 11
10 $ echo bar >> file 12 $ echo bar >> file1
11 $ hg commit -Am 'append bar' 13 $ echo bar >> file2
12 14 $ hg commit -Am 'append bar to files'
13 15
14 create a second head 16 create a second head
15 17
16 $ hg up -C 0 18 $ hg up -C 0
17 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 19 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
18 $ echo baz >> file 20 $ echo baz >> file1
19 $ hg commit -Am 'append baz' 21 $ echo baz >> file2
22 $ hg commit -Am 'append baz to files'
20 created new head 23 created new head
21 24
22 failing merge 25 failing merge
23 26
24 $ hg merge --tool=internal:fail 27 $ hg merge --tool=internal:fail
25 0 files updated, 0 files merged, 0 files removed, 1 files unresolved 28 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
26 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon 29 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
27 [1] 30 [1]
28 31
29 resolve -l should contain an unresolved entry 32 resolve -l should contain unresolved entries
30 33
31 $ hg resolve -l 34 $ hg resolve -l
32 U file 35 U file1
36 U file2
33 37
34 resolving an unknown path should emit a warning 38 resolving an unknown path should emit a warning
35 39
36 $ hg resolve -m does-not-exist 40 $ hg resolve -m does-not-exist
37 arguments do not match paths that need resolving 41 arguments do not match paths that need resolving
38 42
39 resolve the failure 43 resolve the failure
40 44
41 $ echo resolved > file 45 $ echo resolved > file1
42 $ hg resolve -m file 46 $ hg resolve -m file1
47
48 resolve -l should show resolved file as resolved
49
50 $ hg resolve -l
51 R file1
52 U file2
53
54 resolve -m without paths should mark all resolved
55
56 $ hg resolve -m
43 (no more unresolved files) 57 (no more unresolved files)
44 $ hg commit -m 'resolved' 58 $ hg commit -m 'resolved'
45 59
46 resolve -l should be empty after commit 60 resolve -l should be empty after commit
47 61