Show More
@@ -1,908 +1,941 b'' | |||||
1 | test merge-tools configuration - mostly exercising filemerge.py |
|
1 | test merge-tools configuration - mostly exercising filemerge.py | |
2 |
|
2 | |||
3 | $ unset HGMERGE # make sure HGMERGE doesn't interfere with the test |
|
3 | $ unset HGMERGE # make sure HGMERGE doesn't interfere with the test | |
4 | $ hg init |
|
4 | $ hg init | |
5 |
|
5 | |||
6 | revision 0 |
|
6 | revision 0 | |
7 |
|
7 | |||
8 | $ echo "revision 0" > f |
|
8 | $ echo "revision 0" > f | |
9 | $ echo "space" >> f |
|
9 | $ echo "space" >> f | |
10 | $ hg commit -Am "revision 0" |
|
10 | $ hg commit -Am "revision 0" | |
11 | adding f |
|
11 | adding f | |
12 |
|
12 | |||
13 | revision 1 |
|
13 | revision 1 | |
14 |
|
14 | |||
15 | $ echo "revision 1" > f |
|
15 | $ echo "revision 1" > f | |
16 | $ echo "space" >> f |
|
16 | $ echo "space" >> f | |
17 | $ hg commit -Am "revision 1" |
|
17 | $ hg commit -Am "revision 1" | |
18 | $ hg update 0 > /dev/null |
|
18 | $ hg update 0 > /dev/null | |
19 |
|
19 | |||
20 | revision 2 |
|
20 | revision 2 | |
21 |
|
21 | |||
22 | $ echo "revision 2" > f |
|
22 | $ echo "revision 2" > f | |
23 | $ echo "space" >> f |
|
23 | $ echo "space" >> f | |
24 | $ hg commit -Am "revision 2" |
|
24 | $ hg commit -Am "revision 2" | |
25 | created new head |
|
25 | created new head | |
26 | $ hg update 0 > /dev/null |
|
26 | $ hg update 0 > /dev/null | |
27 |
|
27 | |||
28 | revision 3 - simple to merge |
|
28 | revision 3 - simple to merge | |
29 |
|
29 | |||
30 | $ echo "revision 3" >> f |
|
30 | $ echo "revision 3" >> f | |
31 | $ hg commit -Am "revision 3" |
|
31 | $ hg commit -Am "revision 3" | |
32 | created new head |
|
32 | created new head | |
33 |
|
33 | |||
34 | revision 4 - hard to merge |
|
34 | revision 4 - hard to merge | |
35 |
|
35 | |||
36 | $ hg update 0 > /dev/null |
|
36 | $ hg update 0 > /dev/null | |
37 | $ echo "revision 4" > f |
|
37 | $ echo "revision 4" > f | |
38 | $ hg commit -Am "revision 4" |
|
38 | $ hg commit -Am "revision 4" | |
39 | created new head |
|
39 | created new head | |
40 |
|
40 | |||
41 | $ echo "[merge-tools]" > .hg/hgrc |
|
41 | $ echo "[merge-tools]" > .hg/hgrc | |
42 |
|
42 | |||
43 | $ beforemerge() { |
|
43 | $ beforemerge() { | |
44 | > cat .hg/hgrc |
|
44 | > cat .hg/hgrc | |
45 | > echo "# hg update -C 1" |
|
45 | > echo "# hg update -C 1" | |
46 | > hg update -C 1 > /dev/null |
|
46 | > hg update -C 1 > /dev/null | |
47 | > } |
|
47 | > } | |
48 | $ aftermerge() { |
|
48 | $ aftermerge() { | |
49 | > echo "# cat f" |
|
49 | > echo "# cat f" | |
50 | > cat f |
|
50 | > cat f | |
51 | > echo "# hg stat" |
|
51 | > echo "# hg stat" | |
52 | > hg stat |
|
52 | > hg stat | |
53 | > rm -f f.orig |
|
53 | > rm -f f.orig | |
54 | > } |
|
54 | > } | |
55 |
|
55 | |||
56 | Tool selection |
|
56 | Tool selection | |
57 |
|
57 | |||
58 | default is internal merge: |
|
58 | default is internal merge: | |
59 |
|
59 | |||
60 | $ beforemerge |
|
60 | $ beforemerge | |
61 | [merge-tools] |
|
61 | [merge-tools] | |
62 | # hg update -C 1 |
|
62 | # hg update -C 1 | |
63 |
|
63 | |||
64 | hg merge -r 2 |
|
64 | hg merge -r 2 | |
65 | override $PATH to ensure hgmerge not visible; use $PYTHON in case we're |
|
65 | override $PATH to ensure hgmerge not visible; use $PYTHON in case we're | |
66 | running from a devel copy, not a temp installation |
|
66 | running from a devel copy, not a temp installation | |
67 |
|
67 | |||
68 | $ PATH="$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2 |
|
68 | $ PATH="$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2 | |
69 | merging f |
|
69 | merging f | |
70 | warning: conflicts during merge. |
|
70 | warning: conflicts during merge. | |
71 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
71 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') | |
72 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
72 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
73 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
73 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
74 | [1] |
|
74 | [1] | |
75 | $ aftermerge |
|
75 | $ aftermerge | |
76 | # cat f |
|
76 | # cat f | |
77 | <<<<<<< local: ef83787e2614 - test: revision 1 |
|
77 | <<<<<<< local: ef83787e2614 - test: revision 1 | |
78 | revision 1 |
|
78 | revision 1 | |
79 | ======= |
|
79 | ======= | |
80 | revision 2 |
|
80 | revision 2 | |
81 | >>>>>>> other: 0185f4e0cf02 - test: revision 2 |
|
81 | >>>>>>> other: 0185f4e0cf02 - test: revision 2 | |
82 | space |
|
82 | space | |
83 | # hg stat |
|
83 | # hg stat | |
84 | M f |
|
84 | M f | |
85 | ? f.orig |
|
85 | ? f.orig | |
86 |
|
86 | |||
87 | simplest hgrc using false for merge: |
|
87 | simplest hgrc using false for merge: | |
88 |
|
88 | |||
89 | $ echo "false.whatever=" >> .hg/hgrc |
|
89 | $ echo "false.whatever=" >> .hg/hgrc | |
90 | $ beforemerge |
|
90 | $ beforemerge | |
91 | [merge-tools] |
|
91 | [merge-tools] | |
92 | false.whatever= |
|
92 | false.whatever= | |
93 | # hg update -C 1 |
|
93 | # hg update -C 1 | |
94 | $ hg merge -r 2 |
|
94 | $ hg merge -r 2 | |
95 | merging f |
|
95 | merging f | |
96 | merging f failed! |
|
96 | merging f failed! | |
97 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
97 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
98 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
98 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
99 | [1] |
|
99 | [1] | |
100 | $ aftermerge |
|
100 | $ aftermerge | |
101 | # cat f |
|
101 | # cat f | |
102 | revision 1 |
|
102 | revision 1 | |
103 | space |
|
103 | space | |
104 | # hg stat |
|
104 | # hg stat | |
105 | M f |
|
105 | M f | |
106 | ? f.orig |
|
106 | ? f.orig | |
107 |
|
107 | |||
108 | unexecutable file in $PATH shouldn't be found: |
|
108 | unexecutable file in $PATH shouldn't be found: | |
109 |
|
109 | |||
110 | $ touch false |
|
110 | $ touch false | |
111 | $ hg up -qC 1 |
|
111 | $ hg up -qC 1 | |
112 | $ PATH="`pwd`:$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2 |
|
112 | $ PATH="`pwd`:$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2 | |
113 | merging f |
|
113 | merging f | |
114 | warning: conflicts during merge. |
|
114 | warning: conflicts during merge. | |
115 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
115 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') | |
116 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
116 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
117 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
117 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
118 | [1] |
|
118 | [1] | |
119 | $ rm false |
|
119 | $ rm false | |
120 |
|
120 | |||
121 | executable directory in $PATH shouldn't be found: |
|
121 | executable directory in $PATH shouldn't be found: | |
122 |
|
122 | |||
123 | $ mkdir false |
|
123 | $ mkdir false | |
124 | $ hg up -qC 1 |
|
124 | $ hg up -qC 1 | |
125 | $ PATH="`pwd`:$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2 |
|
125 | $ PATH="`pwd`:$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2 | |
126 | merging f |
|
126 | merging f | |
127 | warning: conflicts during merge. |
|
127 | warning: conflicts during merge. | |
128 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
128 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') | |
129 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
129 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
130 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
130 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
131 | [1] |
|
131 | [1] | |
132 | $ rmdir false |
|
132 | $ rmdir false | |
133 |
|
133 | |||
134 | true with higher .priority gets precedence: |
|
134 | true with higher .priority gets precedence: | |
135 |
|
135 | |||
136 | $ echo "true.priority=1" >> .hg/hgrc |
|
136 | $ echo "true.priority=1" >> .hg/hgrc | |
137 | $ beforemerge |
|
137 | $ beforemerge | |
138 | [merge-tools] |
|
138 | [merge-tools] | |
139 | false.whatever= |
|
139 | false.whatever= | |
140 | true.priority=1 |
|
140 | true.priority=1 | |
141 | # hg update -C 1 |
|
141 | # hg update -C 1 | |
142 | $ hg merge -r 2 |
|
142 | $ hg merge -r 2 | |
143 | merging f |
|
143 | merging f | |
144 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
144 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
145 | (branch merge, don't forget to commit) |
|
145 | (branch merge, don't forget to commit) | |
146 | $ aftermerge |
|
146 | $ aftermerge | |
147 | # cat f |
|
147 | # cat f | |
148 | revision 1 |
|
148 | revision 1 | |
149 | space |
|
149 | space | |
150 | # hg stat |
|
150 | # hg stat | |
151 | M f |
|
151 | M f | |
152 |
|
152 | |||
153 | unless lowered on command line: |
|
153 | unless lowered on command line: | |
154 |
|
154 | |||
155 | $ beforemerge |
|
155 | $ beforemerge | |
156 | [merge-tools] |
|
156 | [merge-tools] | |
157 | false.whatever= |
|
157 | false.whatever= | |
158 | true.priority=1 |
|
158 | true.priority=1 | |
159 | # hg update -C 1 |
|
159 | # hg update -C 1 | |
160 | $ hg merge -r 2 --config merge-tools.true.priority=-7 |
|
160 | $ hg merge -r 2 --config merge-tools.true.priority=-7 | |
161 | merging f |
|
161 | merging f | |
162 | merging f failed! |
|
162 | merging f failed! | |
163 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
163 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
164 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
164 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
165 | [1] |
|
165 | [1] | |
166 | $ aftermerge |
|
166 | $ aftermerge | |
167 | # cat f |
|
167 | # cat f | |
168 | revision 1 |
|
168 | revision 1 | |
169 | space |
|
169 | space | |
170 | # hg stat |
|
170 | # hg stat | |
171 | M f |
|
171 | M f | |
172 | ? f.orig |
|
172 | ? f.orig | |
173 |
|
173 | |||
174 | or false set higher on command line: |
|
174 | or false set higher on command line: | |
175 |
|
175 | |||
176 | $ beforemerge |
|
176 | $ beforemerge | |
177 | [merge-tools] |
|
177 | [merge-tools] | |
178 | false.whatever= |
|
178 | false.whatever= | |
179 | true.priority=1 |
|
179 | true.priority=1 | |
180 | # hg update -C 1 |
|
180 | # hg update -C 1 | |
181 | $ hg merge -r 2 --config merge-tools.false.priority=117 |
|
181 | $ hg merge -r 2 --config merge-tools.false.priority=117 | |
182 | merging f |
|
182 | merging f | |
183 | merging f failed! |
|
183 | merging f failed! | |
184 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
184 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
185 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
185 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
186 | [1] |
|
186 | [1] | |
187 | $ aftermerge |
|
187 | $ aftermerge | |
188 | # cat f |
|
188 | # cat f | |
189 | revision 1 |
|
189 | revision 1 | |
190 | space |
|
190 | space | |
191 | # hg stat |
|
191 | # hg stat | |
192 | M f |
|
192 | M f | |
193 | ? f.orig |
|
193 | ? f.orig | |
194 |
|
194 | |||
195 | or true.executable not found in PATH: |
|
195 | or true.executable not found in PATH: | |
196 |
|
196 | |||
197 | $ beforemerge |
|
197 | $ beforemerge | |
198 | [merge-tools] |
|
198 | [merge-tools] | |
199 | false.whatever= |
|
199 | false.whatever= | |
200 | true.priority=1 |
|
200 | true.priority=1 | |
201 | # hg update -C 1 |
|
201 | # hg update -C 1 | |
202 | $ hg merge -r 2 --config merge-tools.true.executable=nonexistentmergetool |
|
202 | $ hg merge -r 2 --config merge-tools.true.executable=nonexistentmergetool | |
203 | merging f |
|
203 | merging f | |
204 | merging f failed! |
|
204 | merging f failed! | |
205 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
205 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
206 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
206 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
207 | [1] |
|
207 | [1] | |
208 | $ aftermerge |
|
208 | $ aftermerge | |
209 | # cat f |
|
209 | # cat f | |
210 | revision 1 |
|
210 | revision 1 | |
211 | space |
|
211 | space | |
212 | # hg stat |
|
212 | # hg stat | |
213 | M f |
|
213 | M f | |
214 | ? f.orig |
|
214 | ? f.orig | |
215 |
|
215 | |||
216 | or true.executable with bogus path: |
|
216 | or true.executable with bogus path: | |
217 |
|
217 | |||
218 | $ beforemerge |
|
218 | $ beforemerge | |
219 | [merge-tools] |
|
219 | [merge-tools] | |
220 | false.whatever= |
|
220 | false.whatever= | |
221 | true.priority=1 |
|
221 | true.priority=1 | |
222 | # hg update -C 1 |
|
222 | # hg update -C 1 | |
223 | $ hg merge -r 2 --config merge-tools.true.executable=/nonexistent/mergetool |
|
223 | $ hg merge -r 2 --config merge-tools.true.executable=/nonexistent/mergetool | |
224 | merging f |
|
224 | merging f | |
225 | merging f failed! |
|
225 | merging f failed! | |
226 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
226 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
227 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
227 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
228 | [1] |
|
228 | [1] | |
229 | $ aftermerge |
|
229 | $ aftermerge | |
230 | # cat f |
|
230 | # cat f | |
231 | revision 1 |
|
231 | revision 1 | |
232 | space |
|
232 | space | |
233 | # hg stat |
|
233 | # hg stat | |
234 | M f |
|
234 | M f | |
235 | ? f.orig |
|
235 | ? f.orig | |
236 |
|
236 | |||
237 | but true.executable set to cat found in PATH works: |
|
237 | but true.executable set to cat found in PATH works: | |
238 |
|
238 | |||
239 | $ echo "true.executable=cat" >> .hg/hgrc |
|
239 | $ echo "true.executable=cat" >> .hg/hgrc | |
240 | $ beforemerge |
|
240 | $ beforemerge | |
241 | [merge-tools] |
|
241 | [merge-tools] | |
242 | false.whatever= |
|
242 | false.whatever= | |
243 | true.priority=1 |
|
243 | true.priority=1 | |
244 | true.executable=cat |
|
244 | true.executable=cat | |
245 | # hg update -C 1 |
|
245 | # hg update -C 1 | |
246 | $ hg merge -r 2 |
|
246 | $ hg merge -r 2 | |
247 | merging f |
|
247 | merging f | |
248 | revision 1 |
|
248 | revision 1 | |
249 | space |
|
249 | space | |
250 | revision 0 |
|
250 | revision 0 | |
251 | space |
|
251 | space | |
252 | revision 2 |
|
252 | revision 2 | |
253 | space |
|
253 | space | |
254 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
254 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
255 | (branch merge, don't forget to commit) |
|
255 | (branch merge, don't forget to commit) | |
256 | $ aftermerge |
|
256 | $ aftermerge | |
257 | # cat f |
|
257 | # cat f | |
258 | revision 1 |
|
258 | revision 1 | |
259 | space |
|
259 | space | |
260 | # hg stat |
|
260 | # hg stat | |
261 | M f |
|
261 | M f | |
262 |
|
262 | |||
263 | and true.executable set to cat with path works: |
|
263 | and true.executable set to cat with path works: | |
264 |
|
264 | |||
265 | $ beforemerge |
|
265 | $ beforemerge | |
266 | [merge-tools] |
|
266 | [merge-tools] | |
267 | false.whatever= |
|
267 | false.whatever= | |
268 | true.priority=1 |
|
268 | true.priority=1 | |
269 | true.executable=cat |
|
269 | true.executable=cat | |
270 | # hg update -C 1 |
|
270 | # hg update -C 1 | |
271 | $ hg merge -r 2 --config merge-tools.true.executable=cat |
|
271 | $ hg merge -r 2 --config merge-tools.true.executable=cat | |
272 | merging f |
|
272 | merging f | |
273 | revision 1 |
|
273 | revision 1 | |
274 | space |
|
274 | space | |
275 | revision 0 |
|
275 | revision 0 | |
276 | space |
|
276 | space | |
277 | revision 2 |
|
277 | revision 2 | |
278 | space |
|
278 | space | |
279 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
279 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
280 | (branch merge, don't forget to commit) |
|
280 | (branch merge, don't forget to commit) | |
281 | $ aftermerge |
|
281 | $ aftermerge | |
282 | # cat f |
|
282 | # cat f | |
283 | revision 1 |
|
283 | revision 1 | |
284 | space |
|
284 | space | |
285 | # hg stat |
|
285 | # hg stat | |
286 | M f |
|
286 | M f | |
287 |
|
287 | |||
288 | #if unix-permissions |
|
288 | #if unix-permissions | |
289 |
|
289 | |||
290 | environment variables in true.executable are handled: |
|
290 | environment variables in true.executable are handled: | |
291 |
|
291 | |||
292 | $ echo 'echo "custom merge tool"' > .hg/merge.sh |
|
292 | $ echo 'echo "custom merge tool"' > .hg/merge.sh | |
293 | $ beforemerge |
|
293 | $ beforemerge | |
294 | [merge-tools] |
|
294 | [merge-tools] | |
295 | false.whatever= |
|
295 | false.whatever= | |
296 | true.priority=1 |
|
296 | true.priority=1 | |
297 | true.executable=cat |
|
297 | true.executable=cat | |
298 | # hg update -C 1 |
|
298 | # hg update -C 1 | |
299 | $ hg --config merge-tools.true.executable='sh' \ |
|
299 | $ hg --config merge-tools.true.executable='sh' \ | |
300 | > --config merge-tools.true.args=.hg/merge.sh \ |
|
300 | > --config merge-tools.true.args=.hg/merge.sh \ | |
301 | > merge -r 2 |
|
301 | > merge -r 2 | |
302 | merging f |
|
302 | merging f | |
303 | custom merge tool |
|
303 | custom merge tool | |
304 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
304 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
305 | (branch merge, don't forget to commit) |
|
305 | (branch merge, don't forget to commit) | |
306 | $ aftermerge |
|
306 | $ aftermerge | |
307 | # cat f |
|
307 | # cat f | |
308 | revision 1 |
|
308 | revision 1 | |
309 | space |
|
309 | space | |
310 | # hg stat |
|
310 | # hg stat | |
311 | M f |
|
311 | M f | |
312 |
|
312 | |||
313 | #endif |
|
313 | #endif | |
314 |
|
314 | |||
315 | Tool selection and merge-patterns |
|
315 | Tool selection and merge-patterns | |
316 |
|
316 | |||
317 | merge-patterns specifies new tool false: |
|
317 | merge-patterns specifies new tool false: | |
318 |
|
318 | |||
319 | $ beforemerge |
|
319 | $ beforemerge | |
320 | [merge-tools] |
|
320 | [merge-tools] | |
321 | false.whatever= |
|
321 | false.whatever= | |
322 | true.priority=1 |
|
322 | true.priority=1 | |
323 | true.executable=cat |
|
323 | true.executable=cat | |
324 | # hg update -C 1 |
|
324 | # hg update -C 1 | |
325 | $ hg merge -r 2 --config merge-patterns.f=false |
|
325 | $ hg merge -r 2 --config merge-patterns.f=false | |
326 | merging f |
|
326 | merging f | |
327 | merging f failed! |
|
327 | merging f failed! | |
328 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
328 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
329 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
329 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
330 | [1] |
|
330 | [1] | |
331 | $ aftermerge |
|
331 | $ aftermerge | |
332 | # cat f |
|
332 | # cat f | |
333 | revision 1 |
|
333 | revision 1 | |
334 | space |
|
334 | space | |
335 | # hg stat |
|
335 | # hg stat | |
336 | M f |
|
336 | M f | |
337 | ? f.orig |
|
337 | ? f.orig | |
338 |
|
338 | |||
339 | merge-patterns specifies executable not found in PATH and gets warning: |
|
339 | merge-patterns specifies executable not found in PATH and gets warning: | |
340 |
|
340 | |||
341 | $ beforemerge |
|
341 | $ beforemerge | |
342 | [merge-tools] |
|
342 | [merge-tools] | |
343 | false.whatever= |
|
343 | false.whatever= | |
344 | true.priority=1 |
|
344 | true.priority=1 | |
345 | true.executable=cat |
|
345 | true.executable=cat | |
346 | # hg update -C 1 |
|
346 | # hg update -C 1 | |
347 | $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool |
|
347 | $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool | |
348 | couldn't find merge tool true specified for f |
|
348 | couldn't find merge tool true specified for f | |
349 | merging f |
|
349 | merging f | |
350 | merging f failed! |
|
350 | merging f failed! | |
351 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
351 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
352 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
352 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
353 | [1] |
|
353 | [1] | |
354 | $ aftermerge |
|
354 | $ aftermerge | |
355 | # cat f |
|
355 | # cat f | |
356 | revision 1 |
|
356 | revision 1 | |
357 | space |
|
357 | space | |
358 | # hg stat |
|
358 | # hg stat | |
359 | M f |
|
359 | M f | |
360 | ? f.orig |
|
360 | ? f.orig | |
361 |
|
361 | |||
362 | merge-patterns specifies executable with bogus path and gets warning: |
|
362 | merge-patterns specifies executable with bogus path and gets warning: | |
363 |
|
363 | |||
364 | $ beforemerge |
|
364 | $ beforemerge | |
365 | [merge-tools] |
|
365 | [merge-tools] | |
366 | false.whatever= |
|
366 | false.whatever= | |
367 | true.priority=1 |
|
367 | true.priority=1 | |
368 | true.executable=cat |
|
368 | true.executable=cat | |
369 | # hg update -C 1 |
|
369 | # hg update -C 1 | |
370 | $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexistent/mergetool |
|
370 | $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexistent/mergetool | |
371 | couldn't find merge tool true specified for f |
|
371 | couldn't find merge tool true specified for f | |
372 | merging f |
|
372 | merging f | |
373 | merging f failed! |
|
373 | merging f failed! | |
374 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
374 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
375 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
375 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
376 | [1] |
|
376 | [1] | |
377 | $ aftermerge |
|
377 | $ aftermerge | |
378 | # cat f |
|
378 | # cat f | |
379 | revision 1 |
|
379 | revision 1 | |
380 | space |
|
380 | space | |
381 | # hg stat |
|
381 | # hg stat | |
382 | M f |
|
382 | M f | |
383 | ? f.orig |
|
383 | ? f.orig | |
384 |
|
384 | |||
385 | ui.merge overrules priority |
|
385 | ui.merge overrules priority | |
386 |
|
386 | |||
387 | ui.merge specifies false: |
|
387 | ui.merge specifies false: | |
388 |
|
388 | |||
389 | $ beforemerge |
|
389 | $ beforemerge | |
390 | [merge-tools] |
|
390 | [merge-tools] | |
391 | false.whatever= |
|
391 | false.whatever= | |
392 | true.priority=1 |
|
392 | true.priority=1 | |
393 | true.executable=cat |
|
393 | true.executable=cat | |
394 | # hg update -C 1 |
|
394 | # hg update -C 1 | |
395 | $ hg merge -r 2 --config ui.merge=false |
|
395 | $ hg merge -r 2 --config ui.merge=false | |
396 | merging f |
|
396 | merging f | |
397 | merging f failed! |
|
397 | merging f failed! | |
398 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
398 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
399 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
399 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
400 | [1] |
|
400 | [1] | |
401 | $ aftermerge |
|
401 | $ aftermerge | |
402 | # cat f |
|
402 | # cat f | |
403 | revision 1 |
|
403 | revision 1 | |
404 | space |
|
404 | space | |
405 | # hg stat |
|
405 | # hg stat | |
406 | M f |
|
406 | M f | |
407 | ? f.orig |
|
407 | ? f.orig | |
408 |
|
408 | |||
409 | ui.merge specifies internal:fail: |
|
409 | ui.merge specifies internal:fail: | |
410 |
|
410 | |||
411 | $ beforemerge |
|
411 | $ beforemerge | |
412 | [merge-tools] |
|
412 | [merge-tools] | |
413 | false.whatever= |
|
413 | false.whatever= | |
414 | true.priority=1 |
|
414 | true.priority=1 | |
415 | true.executable=cat |
|
415 | true.executable=cat | |
416 | # hg update -C 1 |
|
416 | # hg update -C 1 | |
417 | $ hg merge -r 2 --config ui.merge=internal:fail |
|
417 | $ hg merge -r 2 --config ui.merge=internal:fail | |
418 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
418 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
419 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
419 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
420 | [1] |
|
420 | [1] | |
421 | $ aftermerge |
|
421 | $ aftermerge | |
422 | # cat f |
|
422 | # cat f | |
423 | revision 1 |
|
423 | revision 1 | |
424 | space |
|
424 | space | |
425 | # hg stat |
|
425 | # hg stat | |
426 | M f |
|
426 | M f | |
427 |
|
427 | |||
428 | ui.merge specifies internal:local: |
|
428 | ui.merge specifies internal:local: | |
429 |
|
429 | |||
430 | $ beforemerge |
|
430 | $ beforemerge | |
431 | [merge-tools] |
|
431 | [merge-tools] | |
432 | false.whatever= |
|
432 | false.whatever= | |
433 | true.priority=1 |
|
433 | true.priority=1 | |
434 | true.executable=cat |
|
434 | true.executable=cat | |
435 | # hg update -C 1 |
|
435 | # hg update -C 1 | |
436 | $ hg merge -r 2 --config ui.merge=internal:local |
|
436 | $ hg merge -r 2 --config ui.merge=internal:local | |
437 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
437 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
438 | (branch merge, don't forget to commit) |
|
438 | (branch merge, don't forget to commit) | |
439 | $ aftermerge |
|
439 | $ aftermerge | |
440 | # cat f |
|
440 | # cat f | |
441 | revision 1 |
|
441 | revision 1 | |
442 | space |
|
442 | space | |
443 | # hg stat |
|
443 | # hg stat | |
444 | M f |
|
444 | M f | |
445 |
|
445 | |||
446 | ui.merge specifies internal:other: |
|
446 | ui.merge specifies internal:other: | |
447 |
|
447 | |||
448 | $ beforemerge |
|
448 | $ beforemerge | |
449 | [merge-tools] |
|
449 | [merge-tools] | |
450 | false.whatever= |
|
450 | false.whatever= | |
451 | true.priority=1 |
|
451 | true.priority=1 | |
452 | true.executable=cat |
|
452 | true.executable=cat | |
453 | # hg update -C 1 |
|
453 | # hg update -C 1 | |
454 | $ hg merge -r 2 --config ui.merge=internal:other |
|
454 | $ hg merge -r 2 --config ui.merge=internal:other | |
455 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
455 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
456 | (branch merge, don't forget to commit) |
|
456 | (branch merge, don't forget to commit) | |
457 | $ aftermerge |
|
457 | $ aftermerge | |
458 | # cat f |
|
458 | # cat f | |
459 | revision 2 |
|
459 | revision 2 | |
460 | space |
|
460 | space | |
461 | # hg stat |
|
461 | # hg stat | |
462 | M f |
|
462 | M f | |
463 |
|
463 | |||
464 | ui.merge specifies internal:prompt: |
|
464 | ui.merge specifies internal:prompt: | |
465 |
|
465 | |||
466 | $ beforemerge |
|
466 | $ beforemerge | |
467 | [merge-tools] |
|
467 | [merge-tools] | |
468 | false.whatever= |
|
468 | false.whatever= | |
469 | true.priority=1 |
|
469 | true.priority=1 | |
470 | true.executable=cat |
|
470 | true.executable=cat | |
471 | # hg update -C 1 |
|
471 | # hg update -C 1 | |
472 | $ hg merge -r 2 --config ui.merge=internal:prompt |
|
472 | $ hg merge -r 2 --config ui.merge=internal:prompt | |
473 | no tool found to merge f |
|
473 | no tool found to merge f | |
474 | keep (l)ocal or take (o)ther? l |
|
474 | keep (l)ocal or take (o)ther? l | |
475 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
475 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
476 | (branch merge, don't forget to commit) |
|
476 | (branch merge, don't forget to commit) | |
477 | $ aftermerge |
|
477 | $ aftermerge | |
478 | # cat f |
|
478 | # cat f | |
479 | revision 1 |
|
479 | revision 1 | |
480 | space |
|
480 | space | |
481 | # hg stat |
|
481 | # hg stat | |
482 | M f |
|
482 | M f | |
483 |
|
483 | |||
484 | ui.merge specifies internal:dump: |
|
484 | ui.merge specifies internal:dump: | |
485 |
|
485 | |||
486 | $ beforemerge |
|
486 | $ beforemerge | |
487 | [merge-tools] |
|
487 | [merge-tools] | |
488 | false.whatever= |
|
488 | false.whatever= | |
489 | true.priority=1 |
|
489 | true.priority=1 | |
490 | true.executable=cat |
|
490 | true.executable=cat | |
491 | # hg update -C 1 |
|
491 | # hg update -C 1 | |
492 | $ hg merge -r 2 --config ui.merge=internal:dump |
|
492 | $ hg merge -r 2 --config ui.merge=internal:dump | |
493 | merging f |
|
493 | merging f | |
494 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
494 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
495 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
495 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
496 | [1] |
|
496 | [1] | |
497 | $ aftermerge |
|
497 | $ aftermerge | |
498 | # cat f |
|
498 | # cat f | |
499 | revision 1 |
|
499 | revision 1 | |
500 | space |
|
500 | space | |
501 | # hg stat |
|
501 | # hg stat | |
502 | M f |
|
502 | M f | |
503 | ? f.base |
|
503 | ? f.base | |
504 | ? f.local |
|
504 | ? f.local | |
505 | ? f.orig |
|
505 | ? f.orig | |
506 | ? f.other |
|
506 | ? f.other | |
507 |
|
507 | |||
508 | f.base: |
|
508 | f.base: | |
509 |
|
509 | |||
510 | $ cat f.base |
|
510 | $ cat f.base | |
511 | revision 0 |
|
511 | revision 0 | |
512 | space |
|
512 | space | |
513 |
|
513 | |||
514 | f.local: |
|
514 | f.local: | |
515 |
|
515 | |||
516 | $ cat f.local |
|
516 | $ cat f.local | |
517 | revision 1 |
|
517 | revision 1 | |
518 | space |
|
518 | space | |
519 |
|
519 | |||
520 | f.other: |
|
520 | f.other: | |
521 |
|
521 | |||
522 | $ cat f.other |
|
522 | $ cat f.other | |
523 | revision 2 |
|
523 | revision 2 | |
524 | space |
|
524 | space | |
525 | $ rm f.base f.local f.other |
|
525 | $ rm f.base f.local f.other | |
526 |
|
526 | |||
527 | ui.merge specifies internal:other but is overruled by pattern for false: |
|
527 | ui.merge specifies internal:other but is overruled by pattern for false: | |
528 |
|
528 | |||
529 | $ beforemerge |
|
529 | $ beforemerge | |
530 | [merge-tools] |
|
530 | [merge-tools] | |
531 | false.whatever= |
|
531 | false.whatever= | |
532 | true.priority=1 |
|
532 | true.priority=1 | |
533 | true.executable=cat |
|
533 | true.executable=cat | |
534 | # hg update -C 1 |
|
534 | # hg update -C 1 | |
535 | $ hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false |
|
535 | $ hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false | |
536 | merging f |
|
536 | merging f | |
537 | merging f failed! |
|
537 | merging f failed! | |
538 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
538 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
539 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
539 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
540 | [1] |
|
540 | [1] | |
541 | $ aftermerge |
|
541 | $ aftermerge | |
542 | # cat f |
|
542 | # cat f | |
543 | revision 1 |
|
543 | revision 1 | |
544 | space |
|
544 | space | |
545 | # hg stat |
|
545 | # hg stat | |
546 | M f |
|
546 | M f | |
547 | ? f.orig |
|
547 | ? f.orig | |
548 |
|
548 | |||
549 | Premerge |
|
549 | Premerge | |
550 |
|
550 | |||
551 | ui.merge specifies internal:other but is overruled by --tool=false |
|
551 | ui.merge specifies internal:other but is overruled by --tool=false | |
552 |
|
552 | |||
553 | $ beforemerge |
|
553 | $ beforemerge | |
554 | [merge-tools] |
|
554 | [merge-tools] | |
555 | false.whatever= |
|
555 | false.whatever= | |
556 | true.priority=1 |
|
556 | true.priority=1 | |
557 | true.executable=cat |
|
557 | true.executable=cat | |
558 | # hg update -C 1 |
|
558 | # hg update -C 1 | |
559 | $ hg merge -r 2 --config ui.merge=internal:other --tool=false |
|
559 | $ hg merge -r 2 --config ui.merge=internal:other --tool=false | |
560 | merging f |
|
560 | merging f | |
561 | merging f failed! |
|
561 | merging f failed! | |
562 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
562 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
563 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
563 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
564 | [1] |
|
564 | [1] | |
565 | $ aftermerge |
|
565 | $ aftermerge | |
566 | # cat f |
|
566 | # cat f | |
567 | revision 1 |
|
567 | revision 1 | |
568 | space |
|
568 | space | |
569 | # hg stat |
|
569 | # hg stat | |
570 | M f |
|
570 | M f | |
571 | ? f.orig |
|
571 | ? f.orig | |
572 |
|
572 | |||
573 | HGMERGE specifies internal:other but is overruled by --tool=false |
|
573 | HGMERGE specifies internal:other but is overruled by --tool=false | |
574 |
|
574 | |||
575 | $ HGMERGE=internal:other ; export HGMERGE |
|
575 | $ HGMERGE=internal:other ; export HGMERGE | |
576 | $ beforemerge |
|
576 | $ beforemerge | |
577 | [merge-tools] |
|
577 | [merge-tools] | |
578 | false.whatever= |
|
578 | false.whatever= | |
579 | true.priority=1 |
|
579 | true.priority=1 | |
580 | true.executable=cat |
|
580 | true.executable=cat | |
581 | # hg update -C 1 |
|
581 | # hg update -C 1 | |
582 | $ hg merge -r 2 --tool=false |
|
582 | $ hg merge -r 2 --tool=false | |
583 | merging f |
|
583 | merging f | |
584 | merging f failed! |
|
584 | merging f failed! | |
585 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
585 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
586 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
586 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
587 | [1] |
|
587 | [1] | |
588 | $ aftermerge |
|
588 | $ aftermerge | |
589 | # cat f |
|
589 | # cat f | |
590 | revision 1 |
|
590 | revision 1 | |
591 | space |
|
591 | space | |
592 | # hg stat |
|
592 | # hg stat | |
593 | M f |
|
593 | M f | |
594 | ? f.orig |
|
594 | ? f.orig | |
595 |
|
595 | |||
596 | $ unset HGMERGE # make sure HGMERGE doesn't interfere with remaining tests |
|
596 | $ unset HGMERGE # make sure HGMERGE doesn't interfere with remaining tests | |
597 |
|
597 | |||
598 | update is a merge ... |
|
598 | update is a merge ... | |
599 |
|
599 | |||
600 | $ beforemerge |
|
600 | $ beforemerge | |
601 | [merge-tools] |
|
601 | [merge-tools] | |
602 | false.whatever= |
|
602 | false.whatever= | |
603 | true.priority=1 |
|
603 | true.priority=1 | |
604 | true.executable=cat |
|
604 | true.executable=cat | |
605 | # hg update -C 1 |
|
605 | # hg update -C 1 | |
606 | $ hg debugsetparent 0 |
|
606 | $ hg debugsetparent 0 | |
607 | $ hg update -r 2 |
|
607 | $ hg update -r 2 | |
608 | merging f |
|
608 | merging f | |
609 | revision 1 |
|
609 | revision 1 | |
610 | space |
|
610 | space | |
611 | revision 0 |
|
611 | revision 0 | |
612 | space |
|
612 | space | |
613 | revision 2 |
|
613 | revision 2 | |
614 | space |
|
614 | space | |
615 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
615 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
616 | $ aftermerge |
|
616 | $ aftermerge | |
617 | # cat f |
|
617 | # cat f | |
618 | revision 1 |
|
618 | revision 1 | |
619 | space |
|
619 | space | |
620 | # hg stat |
|
620 | # hg stat | |
621 | M f |
|
621 | M f | |
622 |
|
622 | |||
623 | update should also have --tool |
|
623 | update should also have --tool | |
624 |
|
624 | |||
625 | $ beforemerge |
|
625 | $ beforemerge | |
626 | [merge-tools] |
|
626 | [merge-tools] | |
627 | false.whatever= |
|
627 | false.whatever= | |
628 | true.priority=1 |
|
628 | true.priority=1 | |
629 | true.executable=cat |
|
629 | true.executable=cat | |
630 | # hg update -C 1 |
|
630 | # hg update -C 1 | |
631 | $ hg debugsetparent 0 |
|
631 | $ hg debugsetparent 0 | |
632 | $ hg update -r 2 --tool false |
|
632 | $ hg update -r 2 --tool false | |
633 | merging f |
|
633 | merging f | |
634 | merging f failed! |
|
634 | merging f failed! | |
635 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
635 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
636 | use 'hg resolve' to retry unresolved file merges |
|
636 | use 'hg resolve' to retry unresolved file merges | |
637 | [1] |
|
637 | [1] | |
638 | $ aftermerge |
|
638 | $ aftermerge | |
639 | # cat f |
|
639 | # cat f | |
640 | revision 1 |
|
640 | revision 1 | |
641 | space |
|
641 | space | |
642 | # hg stat |
|
642 | # hg stat | |
643 | M f |
|
643 | M f | |
644 | ? f.orig |
|
644 | ? f.orig | |
645 |
|
645 | |||
646 | Default is silent simplemerge: |
|
646 | Default is silent simplemerge: | |
647 |
|
647 | |||
648 | $ beforemerge |
|
648 | $ beforemerge | |
649 | [merge-tools] |
|
649 | [merge-tools] | |
650 | false.whatever= |
|
650 | false.whatever= | |
651 | true.priority=1 |
|
651 | true.priority=1 | |
652 | true.executable=cat |
|
652 | true.executable=cat | |
653 | # hg update -C 1 |
|
653 | # hg update -C 1 | |
654 | $ hg merge -r 3 |
|
654 | $ hg merge -r 3 | |
655 | merging f |
|
655 | merging f | |
656 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
656 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
657 | (branch merge, don't forget to commit) |
|
657 | (branch merge, don't forget to commit) | |
658 | $ aftermerge |
|
658 | $ aftermerge | |
659 | # cat f |
|
659 | # cat f | |
660 | revision 1 |
|
660 | revision 1 | |
661 | space |
|
661 | space | |
662 | revision 3 |
|
662 | revision 3 | |
663 | # hg stat |
|
663 | # hg stat | |
664 | M f |
|
664 | M f | |
665 |
|
665 | |||
666 | .premerge=True is same: |
|
666 | .premerge=True is same: | |
667 |
|
667 | |||
668 | $ beforemerge |
|
668 | $ beforemerge | |
669 | [merge-tools] |
|
669 | [merge-tools] | |
670 | false.whatever= |
|
670 | false.whatever= | |
671 | true.priority=1 |
|
671 | true.priority=1 | |
672 | true.executable=cat |
|
672 | true.executable=cat | |
673 | # hg update -C 1 |
|
673 | # hg update -C 1 | |
674 | $ hg merge -r 3 --config merge-tools.true.premerge=True |
|
674 | $ hg merge -r 3 --config merge-tools.true.premerge=True | |
675 | merging f |
|
675 | merging f | |
676 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
676 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
677 | (branch merge, don't forget to commit) |
|
677 | (branch merge, don't forget to commit) | |
678 | $ aftermerge |
|
678 | $ aftermerge | |
679 | # cat f |
|
679 | # cat f | |
680 | revision 1 |
|
680 | revision 1 | |
681 | space |
|
681 | space | |
682 | revision 3 |
|
682 | revision 3 | |
683 | # hg stat |
|
683 | # hg stat | |
684 | M f |
|
684 | M f | |
685 |
|
685 | |||
686 | .premerge=False executes merge-tool: |
|
686 | .premerge=False executes merge-tool: | |
687 |
|
687 | |||
688 | $ beforemerge |
|
688 | $ beforemerge | |
689 | [merge-tools] |
|
689 | [merge-tools] | |
690 | false.whatever= |
|
690 | false.whatever= | |
691 | true.priority=1 |
|
691 | true.priority=1 | |
692 | true.executable=cat |
|
692 | true.executable=cat | |
693 | # hg update -C 1 |
|
693 | # hg update -C 1 | |
694 | $ hg merge -r 3 --config merge-tools.true.premerge=False |
|
694 | $ hg merge -r 3 --config merge-tools.true.premerge=False | |
695 | merging f |
|
695 | merging f | |
696 | revision 1 |
|
696 | revision 1 | |
697 | space |
|
697 | space | |
698 | revision 0 |
|
698 | revision 0 | |
699 | space |
|
699 | space | |
700 | revision 0 |
|
700 | revision 0 | |
701 | space |
|
701 | space | |
702 | revision 3 |
|
702 | revision 3 | |
703 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
703 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
704 | (branch merge, don't forget to commit) |
|
704 | (branch merge, don't forget to commit) | |
705 | $ aftermerge |
|
705 | $ aftermerge | |
706 | # cat f |
|
706 | # cat f | |
707 | revision 1 |
|
707 | revision 1 | |
708 | space |
|
708 | space | |
709 | # hg stat |
|
709 | # hg stat | |
710 | M f |
|
710 | M f | |
711 |
|
711 | |||
|
712 | premerge=keep keeps conflict markers in: | |||
|
713 | ||||
|
714 | $ beforemerge | |||
|
715 | [merge-tools] | |||
|
716 | false.whatever= | |||
|
717 | true.priority=1 | |||
|
718 | true.executable=cat | |||
|
719 | # hg update -C 1 | |||
|
720 | $ hg merge -r 4 --config merge-tools.true.premerge=keep | |||
|
721 | merging f | |||
|
722 | <<<<<<< local: ef83787e2614 - test: revision 1 | |||
|
723 | revision 1 | |||
|
724 | space | |||
|
725 | ======= | |||
|
726 | revision 4 | |||
|
727 | >>>>>>> other: 81448d39c9a0 - test: revision 4 | |||
|
728 | revision 0 | |||
|
729 | space | |||
|
730 | revision 4 | |||
|
731 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |||
|
732 | (branch merge, don't forget to commit) | |||
|
733 | $ aftermerge | |||
|
734 | # cat f | |||
|
735 | <<<<<<< local: ef83787e2614 - test: revision 1 | |||
|
736 | revision 1 | |||
|
737 | space | |||
|
738 | ======= | |||
|
739 | revision 4 | |||
|
740 | >>>>>>> other: 81448d39c9a0 - test: revision 4 | |||
|
741 | # hg stat | |||
|
742 | M f | |||
|
743 | ||||
|
744 | ||||
712 | Tool execution |
|
745 | Tool execution | |
713 |
|
746 | |||
714 | set tools.args explicit to include $base $local $other $output: |
|
747 | set tools.args explicit to include $base $local $other $output: | |
715 |
|
748 | |||
716 | $ beforemerge |
|
749 | $ beforemerge | |
717 | [merge-tools] |
|
750 | [merge-tools] | |
718 | false.whatever= |
|
751 | false.whatever= | |
719 | true.priority=1 |
|
752 | true.priority=1 | |
720 | true.executable=cat |
|
753 | true.executable=cat | |
721 | # hg update -C 1 |
|
754 | # hg update -C 1 | |
722 |
$ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$ |
|
755 | $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \ | |
723 |
> | sed ' |
|
756 | > | sed 's,==> .* <==,==> ... <==,g' | |
724 | merging f |
|
757 | merging f | |
725 |
==> ... <== |
|
758 | ==> ... <== | |
726 | revision 0 |
|
759 | revision 0 | |
727 | space |
|
760 | space | |
728 |
|
761 | |||
729 |
== |
|
762 | ==> ... <== | |
730 | revision 1 |
|
763 | revision 1 | |
731 | space |
|
764 | space | |
732 |
|
765 | |||
733 |
== |
|
766 | ==> ... <== | |
734 | revision 2 |
|
767 | revision 2 | |
735 | space |
|
768 | space | |
736 |
|
769 | |||
737 |
== |
|
770 | ==> ... <== | |
738 | revision 1 |
|
771 | revision 1 | |
739 | space |
|
772 | space | |
740 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
773 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
741 | (branch merge, don't forget to commit) |
|
774 | (branch merge, don't forget to commit) | |
742 | $ aftermerge |
|
775 | $ aftermerge | |
743 |
|
|
776 | # cat f | |
744 | revision 1 |
|
777 | revision 1 | |
745 | space |
|
778 | space | |
746 |
|
|
779 | # hg stat | |
747 | M f |
|
780 | M f | |
748 |
|
781 | |||
749 | Merge with "echo mergeresult > $local": |
|
782 | Merge with "echo mergeresult > $local": | |
750 |
|
783 | |||
751 | $ beforemerge |
|
784 | $ beforemerge | |
752 | [merge-tools] |
|
785 | [merge-tools] | |
753 | false.whatever= |
|
786 | false.whatever= | |
754 | true.priority=1 |
|
787 | true.priority=1 | |
755 | true.executable=cat |
|
788 | true.executable=cat | |
756 |
|
|
789 | # hg update -C 1 | |
757 |
$ |
|
790 | $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local' | |
758 |
|
|
791 | merging f | |
759 |
|
|
792 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
760 |
(branch |
|
793 | (branch merge, don't forget to commit) | |
761 | $ aftermerge |
|
794 | $ aftermerge | |
762 | # cat f |
|
795 | # cat f | |
763 | mergeresult |
|
796 | mergeresult | |
764 | # hg stat |
|
797 | # hg stat | |
765 | M f |
|
798 | M f | |
766 |
|
799 | |||
767 | - and $local is the file f: |
|
800 | - and $local is the file f: | |
768 |
|
801 | |||
769 | $ beforemerge |
|
802 | $ beforemerge | |
770 | [merge-tools] |
|
803 | [merge-tools] | |
771 | false.whatever= |
|
804 | false.whatever= | |
772 | true.priority=1 |
|
805 | true.priority=1 | |
773 | true.executable=cat |
|
806 | true.executable=cat | |
774 | # hg update -C 1 |
|
807 | # hg update -C 1 | |
775 |
$ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args=' |
|
808 | $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f' | |
776 | merging f |
|
809 | merging f | |
777 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
810 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
778 |
(branch merge, don' |
|
811 | (branch merge, don't forget to commit) | |
779 |
|
|
812 | $ aftermerge | |
780 | # cat f |
|
813 | # cat f | |
781 |
|
|
814 | mergeresult | |
782 | # hg stat |
|
815 | # hg stat | |
783 |
|
|
816 | M f | |
784 |
|
817 | |||
785 |
|
|
818 | Merge with "echo mergeresult > $output" - the variable is a bit magic: | |
786 |
|
819 | |||
787 |
|
|
820 | $ beforemerge | |
788 | [merge-tools] |
|
821 | [merge-tools] | |
789 |
|
|
822 | false.whatever= | |
790 | true.priority=1 |
|
823 | true.priority=1 | |
791 |
|
|
824 | true.executable=cat | |
792 | # hg update -C 1 |
|
825 | # hg update -C 1 | |
793 |
$ hg |
|
826 | $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output' | |
794 |
|
|
827 | merging f | |
795 |
|
|
828 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
796 |
(branch |
|
829 | (branch merge, don't forget to commit) | |
797 | $ aftermerge |
|
830 | $ aftermerge | |
798 | # cat f |
|
831 | # cat f | |
799 | mergeresult |
|
832 | mergeresult | |
800 | # hg stat |
|
833 | # hg stat | |
801 | M f |
|
834 | M f | |
802 |
|
835 | |||
803 | Merge using tool with a path that must be quoted: |
|
836 | Merge using tool with a path that must be quoted: | |
804 |
|
837 | |||
805 | $ beforemerge |
|
838 | $ beforemerge | |
806 | [merge-tools] |
|
839 | [merge-tools] | |
807 | false.whatever= |
|
840 | false.whatever= | |
808 | true.priority=1 |
|
841 | true.priority=1 | |
809 | true.executable=cat |
|
842 | true.executable=cat | |
810 | # hg update -C 1 |
|
843 | # hg update -C 1 | |
811 | $ cat <<EOF > 'my merge tool' |
|
844 | $ cat <<EOF > 'my merge tool' | |
812 | > cat "\$1" "\$2" "\$3" > "\$4" |
|
845 | > cat "\$1" "\$2" "\$3" > "\$4" | |
813 | > EOF |
|
846 | > EOF | |
814 | $ hg --config merge-tools.true.executable='sh' \ |
|
847 | $ hg --config merge-tools.true.executable='sh' \ | |
815 | > --config merge-tools.true.args='"./my merge tool" $base $local $other $output' \ |
|
848 | > --config merge-tools.true.args='"./my merge tool" $base $local $other $output' \ | |
816 | > merge -r 2 |
|
849 | > merge -r 2 | |
817 | merging f |
|
850 | merging f | |
818 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
851 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
819 | (branch merge, don't forget to commit) |
|
852 | (branch merge, don't forget to commit) | |
820 | $ rm -f 'my merge tool' |
|
853 | $ rm -f 'my merge tool' | |
821 | $ aftermerge |
|
854 | $ aftermerge | |
822 | # cat f |
|
855 | # cat f | |
823 | revision 0 |
|
856 | revision 0 | |
824 | space |
|
857 | space | |
825 | revision 1 |
|
858 | revision 1 | |
826 | space |
|
859 | space | |
827 | revision 2 |
|
860 | revision 2 | |
828 | space |
|
861 | space | |
829 | # hg stat |
|
862 | # hg stat | |
830 | M f |
|
863 | M f | |
831 |
|
864 | |||
832 | Issue3581: Merging a filename that needs to be quoted |
|
865 | Issue3581: Merging a filename that needs to be quoted | |
833 | (This test doesn't work on Windows filesystems even on Linux, so check |
|
866 | (This test doesn't work on Windows filesystems even on Linux, so check | |
834 | for Unix-like permission) |
|
867 | for Unix-like permission) | |
835 |
|
868 | |||
836 | #if unix-permissions |
|
869 | #if unix-permissions | |
837 | $ beforemerge |
|
870 | $ beforemerge | |
838 | [merge-tools] |
|
871 | [merge-tools] | |
839 | false.whatever= |
|
872 | false.whatever= | |
840 | true.priority=1 |
|
873 | true.priority=1 | |
841 | true.executable=cat |
|
874 | true.executable=cat | |
842 | # hg update -C 1 |
|
875 | # hg update -C 1 | |
843 | $ echo "revision 5" > '"; exit 1; echo "' |
|
876 | $ echo "revision 5" > '"; exit 1; echo "' | |
844 | $ hg commit -Am "revision 5" |
|
877 | $ hg commit -Am "revision 5" | |
845 | adding "; exit 1; echo " |
|
878 | adding "; exit 1; echo " | |
846 | warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "' |
|
879 | warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "' | |
847 | $ hg update -C 1 > /dev/null |
|
880 | $ hg update -C 1 > /dev/null | |
848 | $ echo "revision 6" > '"; exit 1; echo "' |
|
881 | $ echo "revision 6" > '"; exit 1; echo "' | |
849 | $ hg commit -Am "revision 6" |
|
882 | $ hg commit -Am "revision 6" | |
850 | adding "; exit 1; echo " |
|
883 | adding "; exit 1; echo " | |
851 | warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "' |
|
884 | warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "' | |
852 | created new head |
|
885 | created new head | |
853 | $ hg merge --config merge-tools.true.executable="true" -r 5 |
|
886 | $ hg merge --config merge-tools.true.executable="true" -r 5 | |
854 | merging "; exit 1; echo " |
|
887 | merging "; exit 1; echo " | |
855 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
888 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
856 | (branch merge, don't forget to commit) |
|
889 | (branch merge, don't forget to commit) | |
857 | $ hg update -C 1 > /dev/null |
|
890 | $ hg update -C 1 > /dev/null | |
858 | #endif |
|
891 | #endif | |
859 |
|
892 | |||
860 | Merge post-processing |
|
893 | Merge post-processing | |
861 |
|
894 | |||
862 | cat is a bad merge-tool and doesn't change: |
|
895 | cat is a bad merge-tool and doesn't change: | |
863 |
|
896 | |||
864 | $ beforemerge |
|
897 | $ beforemerge | |
865 | [merge-tools] |
|
898 | [merge-tools] | |
866 | false.whatever= |
|
899 | false.whatever= | |
867 | true.priority=1 |
|
900 | true.priority=1 | |
868 | true.executable=cat |
|
901 | true.executable=cat | |
869 | # hg update -C 1 |
|
902 | # hg update -C 1 | |
870 | $ hg merge -y -r 2 --config merge-tools.true.checkchanged=1 |
|
903 | $ hg merge -y -r 2 --config merge-tools.true.checkchanged=1 | |
871 | merging f |
|
904 | merging f | |
872 | revision 1 |
|
905 | revision 1 | |
873 | space |
|
906 | space | |
874 | revision 0 |
|
907 | revision 0 | |
875 | space |
|
908 | space | |
876 | revision 2 |
|
909 | revision 2 | |
877 | space |
|
910 | space | |
878 | output file f appears unchanged |
|
911 | output file f appears unchanged | |
879 | was merge successful (yn)? n |
|
912 | was merge successful (yn)? n | |
880 | merging f failed! |
|
913 | merging f failed! | |
881 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
914 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
882 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
915 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
883 | [1] |
|
916 | [1] | |
884 | $ aftermerge |
|
917 | $ aftermerge | |
885 | # cat f |
|
918 | # cat f | |
886 | revision 1 |
|
919 | revision 1 | |
887 | space |
|
920 | space | |
888 | # hg stat |
|
921 | # hg stat | |
889 | M f |
|
922 | M f | |
890 | ? f.orig |
|
923 | ? f.orig | |
891 |
|
924 | |||
892 | #if symlink |
|
925 | #if symlink | |
893 |
|
926 | |||
894 | internal merge cannot handle symlinks and shouldn't try: |
|
927 | internal merge cannot handle symlinks and shouldn't try: | |
895 |
|
928 | |||
896 | $ hg update -q -C 1 |
|
929 | $ hg update -q -C 1 | |
897 | $ rm f |
|
930 | $ rm f | |
898 | $ ln -s symlink f |
|
931 | $ ln -s symlink f | |
899 | $ hg commit -qm 'f is symlink' |
|
932 | $ hg commit -qm 'f is symlink' | |
900 | $ hg merge -r 2 --tool internal:merge |
|
933 | $ hg merge -r 2 --tool internal:merge | |
901 | merging f |
|
934 | merging f | |
902 | warning: internal:merge cannot merge symlinks for f |
|
935 | warning: internal:merge cannot merge symlinks for f | |
903 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
936 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') | |
904 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
937 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
905 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
938 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
906 | [1] |
|
939 | [1] | |
907 |
|
940 | |||
908 | #endif |
|
941 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now