annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12117
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
1 test that a commit clears the merge state.
7734
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
2
12117
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
3 $ hg init repo
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
4 $ cd repo
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
5
23021
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
6 $ echo foo > file1
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
7 $ echo foo > file2
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
8 $ hg commit -Am 'add files'
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
9 adding file1
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
10 adding file2
7734
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
11
23021
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
12 $ echo bar >> file1
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
13 $ echo bar >> file2
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
14 $ hg commit -Am 'append bar to files'
12117
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
15
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
16 create a second head
7734
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
17
12117
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
18 $ hg up -C 0
23021
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
19 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
20 $ echo baz >> file1
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
21 $ echo baz >> file2
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
22 $ hg commit -Am 'append baz to files'
12117
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
23 created new head
7734
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
24
12117
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
25 failing merge
7734
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
26
12788
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12316
diff changeset
27 $ hg merge --tool=internal:fail
23021
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
28 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
12314
f2daa6ab514a merge: suggest 'hg up -C .' for discarding changes, not 'hg up -C'
Brodie Rao <brodie@bitheap.org>
parents: 12117
diff changeset
29 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12314
diff changeset
30 [1]
12117
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
31
23021
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
32 resolve -l should contain unresolved entries
21263
f3e37409ecd3 resolve: split test
Gregory Szorc <gregory.szorc@gmail.com>
parents: 16913
diff changeset
33
f3e37409ecd3 resolve: split test
Gregory Szorc <gregory.szorc@gmail.com>
parents: 16913
diff changeset
34 $ hg resolve -l
23021
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
35 U file1
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
36 U file2
21263
f3e37409ecd3 resolve: split test
Gregory Szorc <gregory.szorc@gmail.com>
parents: 16913
diff changeset
37
23020
dfad19274d85 test-resolve: clarify test descriptions and consistently use "should"
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 21947
diff changeset
38 resolving an unknown path should emit a warning
dfad19274d85 test-resolve: clarify test descriptions and consistently use "should"
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 21947
diff changeset
39
21265
232de244ab6f resolve: print warning when no work performed (issue4208)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21264
diff changeset
40 $ hg resolve -m does-not-exist
21721
6539c4e9c874 resolve: fix grammar of no matching files message
Matt Mackall <mpm@selenic.com>
parents: 21541
diff changeset
41 arguments do not match paths that need resolving
21265
232de244ab6f resolve: print warning when no work performed (issue4208)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21264
diff changeset
42
21263
f3e37409ecd3 resolve: split test
Gregory Szorc <gregory.szorc@gmail.com>
parents: 16913
diff changeset
43 resolve the failure
f3e37409ecd3 resolve: split test
Gregory Szorc <gregory.szorc@gmail.com>
parents: 16913
diff changeset
44
23021
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
45 $ echo resolved > file1
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
46 $ hg resolve -m file1
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
47
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
48 resolve -l should show resolved file as resolved
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
49
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
50 $ hg resolve -l
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
51 R file1
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
52 U file2
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
53
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
54 resolve -m without paths should mark all resolved
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
55
41770cee3c6a test-resolve: add test resolving one of two files
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 23020
diff changeset
56 $ hg resolve -m
21947
b081decd9062 resolve: add parenthesis around "no more unresolved files" message
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21721
diff changeset
57 (no more unresolved files)
12117
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
58 $ hg commit -m 'resolved'
7734
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
59
23020
dfad19274d85 test-resolve: clarify test descriptions and consistently use "should"
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 21947
diff changeset
60 resolve -l should be empty after commit
12117
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
61
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
62 $ hg resolve -l
21541
6062593d8b06 resolve: don't abort resolve -l even when no merge is in progress
Siddharth Agarwal <sid0@fb.com>
parents: 21267
diff changeset
63
23020
dfad19274d85 test-resolve: clarify test descriptions and consistently use "should"
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 21947
diff changeset
64 resolve -m should abort when no merge in progress
dfad19274d85 test-resolve: clarify test descriptions and consistently use "should"
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 21947
diff changeset
65
21541
6062593d8b06 resolve: don't abort resolve -l even when no merge is in progress
Siddharth Agarwal <sid0@fb.com>
parents: 21267
diff changeset
66 $ hg resolve -m
21264
4e932dc5c113 resolve: abort when not applicable (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21263
diff changeset
67 abort: resolve command not applicable when not merging
4e932dc5c113 resolve: abort when not applicable (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21263
diff changeset
68 [255]
12117
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
69
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
70 test crashed merge with empty mergestate
7734
9f73bddb9d0b reset mergestate after commit
Martin Geisler <mg@daimi.au.dk>
parents:
diff changeset
71
12117
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
72 $ mkdir .hg/merge
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
73 $ touch .hg/merge/state
11451
51021f4c80b5 resolve: do not crash on empty mergestate
Martin Geisler <mg@lazybytes.net>
parents: 8167
diff changeset
74
23020
dfad19274d85 test-resolve: clarify test descriptions and consistently use "should"
Martin von Zweigbergk <martinvonz@gmail.com>
parents: 21947
diff changeset
75 resolve -l should be empty
12117
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
76
a40372c1c731 tests: unify test-resolve
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11451
diff changeset
77 $ hg resolve -l
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 12788
diff changeset
78
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 12788
diff changeset
79 $ cd ..