##// END OF EJS Templates
test-resolve.t: use redirection to /dev/null instead of grep -q
Augie Fackler -
r23025:b8dd8432 default
parent child Browse files
Show More
@@ -1,149 +1,149 b''
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 > file1
6 $ echo foo > file1
7 $ echo foo > file2
7 $ echo foo > file2
8 $ hg commit -Am 'add files'
8 $ hg commit -Am 'add files'
9 adding file1
9 adding file1
10 adding file2
10 adding file2
11
11
12 $ echo bar >> file1
12 $ echo bar >> file1
13 $ echo bar >> file2
13 $ echo bar >> file2
14 $ hg commit -Am 'append bar to files'
14 $ hg commit -Am 'append bar to files'
15
15
16 create a second head with conflicting edits
16 create a second head with conflicting edits
17
17
18 $ hg up -C 0
18 $ hg up -C 0
19 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
19 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
20 $ echo baz >> file1
20 $ echo baz >> file1
21 $ echo baz >> file2
21 $ echo baz >> file2
22 $ hg commit -Am 'append baz to files'
22 $ hg commit -Am 'append baz to files'
23 created new head
23 created new head
24
24
25 create a third head with no conflicting edits
25 create a third head with no conflicting edits
26 $ hg up -qC 0
26 $ hg up -qC 0
27 $ echo foo > file3
27 $ echo foo > file3
28 $ hg commit -Am 'add non-conflicting file'
28 $ hg commit -Am 'add non-conflicting file'
29 adding file3
29 adding file3
30 created new head
30 created new head
31
31
32 failing merge
32 failing merge
33
33
34 $ hg up -qC 2
34 $ hg up -qC 2
35 $ hg merge --tool=internal:fail 1
35 $ hg merge --tool=internal:fail 1
36 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
36 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
37 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
37 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
38 [1]
38 [1]
39
39
40 resolve -l should contain unresolved entries
40 resolve -l should contain unresolved entries
41
41
42 $ hg resolve -l
42 $ hg resolve -l
43 U file1
43 U file1
44 U file2
44 U file2
45
45
46 resolving an unknown path should emit a warning
46 resolving an unknown path should emit a warning
47
47
48 $ hg resolve -m does-not-exist
48 $ hg resolve -m does-not-exist
49 arguments do not match paths that need resolving
49 arguments do not match paths that need resolving
50
50
51 resolve the failure
51 resolve the failure
52
52
53 $ echo resolved > file1
53 $ echo resolved > file1
54 $ hg resolve -m file1
54 $ hg resolve -m file1
55
55
56 resolve -l should show resolved file as resolved
56 resolve -l should show resolved file as resolved
57
57
58 $ hg resolve -l
58 $ hg resolve -l
59 R file1
59 R file1
60 U file2
60 U file2
61
61
62 resolve -m without paths should mark all resolved
62 resolve -m without paths should mark all resolved
63
63
64 $ hg resolve -m
64 $ hg resolve -m
65 (no more unresolved files)
65 (no more unresolved files)
66 $ hg commit -m 'resolved'
66 $ hg commit -m 'resolved'
67
67
68 resolve -l should be empty after commit
68 resolve -l should be empty after commit
69
69
70 $ hg resolve -l
70 $ hg resolve -l
71
71
72 resolve --all should abort when no merge in progress
72 resolve --all should abort when no merge in progress
73
73
74 $ hg resolve --all
74 $ hg resolve --all
75 abort: resolve command not applicable when not merging
75 abort: resolve command not applicable when not merging
76 [255]
76 [255]
77
77
78 resolve -m should abort when no merge in progress
78 resolve -m should abort when no merge in progress
79
79
80 $ hg resolve -m
80 $ hg resolve -m
81 abort: resolve command not applicable when not merging
81 abort: resolve command not applicable when not merging
82 [255]
82 [255]
83
83
84 set up conflict-free merge
84 set up conflict-free merge
85
85
86 $ hg up -qC 3
86 $ hg up -qC 3
87 $ hg merge 1
87 $ hg merge 1
88 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
88 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 (branch merge, don't forget to commit)
89 (branch merge, don't forget to commit)
90
90
91 resolve --all should do nothing in merge without conflicts
91 resolve --all should do nothing in merge without conflicts
92 $ hg resolve --all
92 $ hg resolve --all
93 (no more unresolved files)
93 (no more unresolved files)
94
94
95 resolve -m should do nothing in merge without conflicts
95 resolve -m should do nothing in merge without conflicts
96
96
97 $ hg resolve -m
97 $ hg resolve -m
98 (no more unresolved files)
98 (no more unresolved files)
99
99
100 get back to conflicting state
100 get back to conflicting state
101
101
102 $ hg up -qC 2
102 $ hg up -qC 2
103 $ hg merge --tool=internal:fail 1
103 $ hg merge --tool=internal:fail 1
104 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
104 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
105 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
105 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
106 [1]
106 [1]
107
107
108 resolve without arguments should suggest --all
108 resolve without arguments should suggest --all
109 $ hg resolve
109 $ hg resolve
110 abort: no files or directories specified
110 abort: no files or directories specified
111 (use --all to remerge all files)
111 (use --all to remerge all files)
112 [255]
112 [255]
113
113
114 resolve --all should re-merge all unresolved files
114 resolve --all should re-merge all unresolved files
115 $ hg resolve -q --all
115 $ hg resolve -q --all
116 warning: conflicts during merge.
116 warning: conflicts during merge.
117 merging file1 incomplete! (edit conflicts, then use 'hg resolve --mark')
117 merging file1 incomplete! (edit conflicts, then use 'hg resolve --mark')
118 warning: conflicts during merge.
118 warning: conflicts during merge.
119 merging file2 incomplete! (edit conflicts, then use 'hg resolve --mark')
119 merging file2 incomplete! (edit conflicts, then use 'hg resolve --mark')
120 [1]
120 [1]
121 $ grep -q '<<<' file1
121 $ grep '<<<' file1 > /dev/null
122 $ grep -q '<<<' file2
122 $ grep '<<<' file2 > /dev/null
123
123
124 resolve <file> should re-merge file
124 resolve <file> should re-merge file
125 $ echo resolved > file1
125 $ echo resolved > file1
126 $ hg resolve -q file1
126 $ hg resolve -q file1
127 warning: conflicts during merge.
127 warning: conflicts during merge.
128 merging file1 incomplete! (edit conflicts, then use 'hg resolve --mark')
128 merging file1 incomplete! (edit conflicts, then use 'hg resolve --mark')
129 [1]
129 [1]
130 $ grep -q '<<<' file1
130 $ grep '<<<' file1 > /dev/null
131
131
132 resolve <file> should do nothing if 'file' was marked resolved
132 resolve <file> should do nothing if 'file' was marked resolved
133 $ echo resolved > file1
133 $ echo resolved > file1
134 $ hg resolve -m file1
134 $ hg resolve -m file1
135 $ hg resolve -q file1
135 $ hg resolve -q file1
136 $ cat file1
136 $ cat file1
137 resolved
137 resolved
138
138
139 test crashed merge with empty mergestate
139 test crashed merge with empty mergestate
140
140
141 $ hg up -qC 1
141 $ hg up -qC 1
142 $ mkdir .hg/merge
142 $ mkdir .hg/merge
143 $ touch .hg/merge/state
143 $ touch .hg/merge/state
144
144
145 resolve -l should be empty
145 resolve -l should be empty
146
146
147 $ hg resolve -l
147 $ hg resolve -l
148
148
149 $ cd ..
149 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now