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