##// END OF EJS Templates
tests: demonstrate that no requested merge tool is ignored if missing...
Martin von Zweigbergk -
r38986:6bfd1054 default
parent child Browse files
Show More
@@ -1,1850 +1,1872 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 repo
4 $ hg init repo
5 $ cd repo
5 $ cd repo
6
6
7 revision 0
7 revision 0
8
8
9 $ echo "revision 0" > f
9 $ echo "revision 0" > f
10 $ echo "space" >> f
10 $ echo "space" >> f
11 $ hg commit -Am "revision 0"
11 $ hg commit -Am "revision 0"
12 adding f
12 adding f
13
13
14 revision 1
14 revision 1
15
15
16 $ echo "revision 1" > f
16 $ echo "revision 1" > f
17 $ echo "space" >> f
17 $ echo "space" >> f
18 $ hg commit -Am "revision 1"
18 $ hg commit -Am "revision 1"
19 $ hg update 0 > /dev/null
19 $ hg update 0 > /dev/null
20
20
21 revision 2
21 revision 2
22
22
23 $ echo "revision 2" > f
23 $ echo "revision 2" > f
24 $ echo "space" >> f
24 $ echo "space" >> f
25 $ hg commit -Am "revision 2"
25 $ hg commit -Am "revision 2"
26 created new head
26 created new head
27 $ hg update 0 > /dev/null
27 $ hg update 0 > /dev/null
28
28
29 revision 3 - simple to merge
29 revision 3 - simple to merge
30
30
31 $ echo "revision 3" >> f
31 $ echo "revision 3" >> f
32 $ hg commit -Am "revision 3"
32 $ hg commit -Am "revision 3"
33 created new head
33 created new head
34
34
35 revision 4 - hard to merge
35 revision 4 - hard to merge
36
36
37 $ hg update 0 > /dev/null
37 $ hg update 0 > /dev/null
38 $ echo "revision 4" > f
38 $ echo "revision 4" > f
39 $ hg commit -Am "revision 4"
39 $ hg commit -Am "revision 4"
40 created new head
40 created new head
41
41
42 $ echo "[merge-tools]" > .hg/hgrc
42 $ echo "[merge-tools]" > .hg/hgrc
43
43
44 $ beforemerge() {
44 $ beforemerge() {
45 > cat .hg/hgrc
45 > cat .hg/hgrc
46 > echo "# hg update -C 1"
46 > echo "# hg update -C 1"
47 > hg update -C 1 > /dev/null
47 > hg update -C 1 > /dev/null
48 > }
48 > }
49 $ aftermerge() {
49 $ aftermerge() {
50 > echo "# cat f"
50 > echo "# cat f"
51 > cat f
51 > cat f
52 > echo "# hg stat"
52 > echo "# hg stat"
53 > hg stat
53 > hg stat
54 > echo "# hg resolve --list"
54 > echo "# hg resolve --list"
55 > hg resolve --list
55 > hg resolve --list
56 > rm -f f.orig
56 > rm -f f.orig
57 > }
57 > }
58
58
59 Tool selection
59 Tool selection
60
60
61 default is internal merge:
61 default is internal merge:
62
62
63 $ beforemerge
63 $ beforemerge
64 [merge-tools]
64 [merge-tools]
65 # hg update -C 1
65 # hg update -C 1
66
66
67 hg merge -r 2
67 hg merge -r 2
68 override $PATH to ensure hgmerge not visible; use $PYTHON in case we're
68 override $PATH to ensure hgmerge not visible; use $PYTHON in case we're
69 running from a devel copy, not a temp installation
69 running from a devel copy, not a temp installation
70
70
71 $ PATH="$BINDIR:/usr/sbin" $PYTHON "$BINDIR"/hg merge -r 2
71 $ PATH="$BINDIR:/usr/sbin" $PYTHON "$BINDIR"/hg merge -r 2
72 merging f
72 merging f
73 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
73 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
74 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
74 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
75 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
75 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
76 [1]
76 [1]
77 $ aftermerge
77 $ aftermerge
78 # cat f
78 # cat f
79 <<<<<<< working copy: ef83787e2614 - test: revision 1
79 <<<<<<< working copy: ef83787e2614 - test: revision 1
80 revision 1
80 revision 1
81 =======
81 =======
82 revision 2
82 revision 2
83 >>>>>>> merge rev: 0185f4e0cf02 - test: revision 2
83 >>>>>>> merge rev: 0185f4e0cf02 - test: revision 2
84 space
84 space
85 # hg stat
85 # hg stat
86 M f
86 M f
87 ? f.orig
87 ? f.orig
88 # hg resolve --list
88 # hg resolve --list
89 U f
89 U f
90
90
91 simplest hgrc using false for merge:
91 simplest hgrc using false for merge:
92
92
93 $ echo "false.whatever=" >> .hg/hgrc
93 $ echo "false.whatever=" >> .hg/hgrc
94 $ beforemerge
94 $ beforemerge
95 [merge-tools]
95 [merge-tools]
96 false.whatever=
96 false.whatever=
97 # hg update -C 1
97 # hg update -C 1
98 $ hg merge -r 2
98 $ hg merge -r 2
99 merging f
99 merging f
100 merging f failed!
100 merging f failed!
101 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
101 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
102 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
102 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
103 [1]
103 [1]
104 $ aftermerge
104 $ aftermerge
105 # cat f
105 # cat f
106 revision 1
106 revision 1
107 space
107 space
108 # hg stat
108 # hg stat
109 M f
109 M f
110 ? f.orig
110 ? f.orig
111 # hg resolve --list
111 # hg resolve --list
112 U f
112 U f
113
113
114 #if unix-permissions
114 #if unix-permissions
115
115
116 unexecutable file in $PATH shouldn't be found:
116 unexecutable file in $PATH shouldn't be found:
117
117
118 $ echo "echo fail" > false
118 $ echo "echo fail" > false
119 $ hg up -qC 1
119 $ hg up -qC 1
120 $ PATH="`pwd`:$BINDIR:/usr/sbin" $PYTHON "$BINDIR"/hg merge -r 2
120 $ PATH="`pwd`:$BINDIR:/usr/sbin" $PYTHON "$BINDIR"/hg merge -r 2
121 merging f
121 merging f
122 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
122 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
123 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
123 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
124 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
124 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
125 [1]
125 [1]
126 $ rm false
126 $ rm false
127
127
128 #endif
128 #endif
129
129
130 executable directory in $PATH shouldn't be found:
130 executable directory in $PATH shouldn't be found:
131
131
132 $ mkdir false
132 $ mkdir false
133 $ hg up -qC 1
133 $ hg up -qC 1
134 $ PATH="`pwd`:$BINDIR:/usr/sbin" $PYTHON "$BINDIR"/hg merge -r 2
134 $ PATH="`pwd`:$BINDIR:/usr/sbin" $PYTHON "$BINDIR"/hg merge -r 2
135 merging f
135 merging f
136 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
136 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
137 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
137 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
138 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
138 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
139 [1]
139 [1]
140 $ rmdir false
140 $ rmdir false
141
141
142 true with higher .priority gets precedence:
142 true with higher .priority gets precedence:
143
143
144 $ echo "true.priority=1" >> .hg/hgrc
144 $ echo "true.priority=1" >> .hg/hgrc
145 $ beforemerge
145 $ beforemerge
146 [merge-tools]
146 [merge-tools]
147 false.whatever=
147 false.whatever=
148 true.priority=1
148 true.priority=1
149 # hg update -C 1
149 # hg update -C 1
150 $ hg merge -r 2
150 $ hg merge -r 2
151 merging f
151 merging f
152 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
152 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
153 (branch merge, don't forget to commit)
153 (branch merge, don't forget to commit)
154 $ aftermerge
154 $ aftermerge
155 # cat f
155 # cat f
156 revision 1
156 revision 1
157 space
157 space
158 # hg stat
158 # hg stat
159 M f
159 M f
160 # hg resolve --list
160 # hg resolve --list
161 R f
161 R f
162
162
163 unless lowered on command line:
163 unless lowered on command line:
164
164
165 $ beforemerge
165 $ beforemerge
166 [merge-tools]
166 [merge-tools]
167 false.whatever=
167 false.whatever=
168 true.priority=1
168 true.priority=1
169 # hg update -C 1
169 # hg update -C 1
170 $ hg merge -r 2 --config merge-tools.true.priority=-7
170 $ hg merge -r 2 --config merge-tools.true.priority=-7
171 merging f
171 merging f
172 merging f failed!
172 merging f failed!
173 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
173 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
174 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
174 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
175 [1]
175 [1]
176 $ aftermerge
176 $ aftermerge
177 # cat f
177 # cat f
178 revision 1
178 revision 1
179 space
179 space
180 # hg stat
180 # hg stat
181 M f
181 M f
182 ? f.orig
182 ? f.orig
183 # hg resolve --list
183 # hg resolve --list
184 U f
184 U f
185
185
186 or false set higher on command line:
186 or false set higher on command line:
187
187
188 $ beforemerge
188 $ beforemerge
189 [merge-tools]
189 [merge-tools]
190 false.whatever=
190 false.whatever=
191 true.priority=1
191 true.priority=1
192 # hg update -C 1
192 # hg update -C 1
193 $ hg merge -r 2 --config merge-tools.false.priority=117
193 $ hg merge -r 2 --config merge-tools.false.priority=117
194 merging f
194 merging f
195 merging f failed!
195 merging f failed!
196 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
196 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
197 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
197 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
198 [1]
198 [1]
199 $ aftermerge
199 $ aftermerge
200 # cat f
200 # cat f
201 revision 1
201 revision 1
202 space
202 space
203 # hg stat
203 # hg stat
204 M f
204 M f
205 ? f.orig
205 ? f.orig
206 # hg resolve --list
206 # hg resolve --list
207 U f
207 U f
208
208
209 or true set to disabled:
209 or true set to disabled:
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.disabled=yes
215 $ hg merge -r 2 --config merge-tools.true.disabled=yes
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 merge --abort' to abandon
219 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' 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 # hg resolve --list
228 # hg resolve --list
229 U f
229 U f
230
230
231 or true.executable not found in PATH:
231 or true.executable not found in PATH:
232
232
233 $ beforemerge
233 $ beforemerge
234 [merge-tools]
234 [merge-tools]
235 false.whatever=
235 false.whatever=
236 true.priority=1
236 true.priority=1
237 # hg update -C 1
237 # hg update -C 1
238 $ hg merge -r 2 --config merge-tools.true.executable=nonexistentmergetool
238 $ hg merge -r 2 --config merge-tools.true.executable=nonexistentmergetool
239 merging f
239 merging f
240 merging f failed!
240 merging f failed!
241 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
241 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
242 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
242 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
243 [1]
243 [1]
244 $ aftermerge
244 $ aftermerge
245 # cat f
245 # cat f
246 revision 1
246 revision 1
247 space
247 space
248 # hg stat
248 # hg stat
249 M f
249 M f
250 ? f.orig
250 ? f.orig
251 # hg resolve --list
251 # hg resolve --list
252 U f
252 U f
253
253
254 or true.executable with bogus path:
254 or true.executable with bogus path:
255
255
256 $ beforemerge
256 $ beforemerge
257 [merge-tools]
257 [merge-tools]
258 false.whatever=
258 false.whatever=
259 true.priority=1
259 true.priority=1
260 # hg update -C 1
260 # hg update -C 1
261 $ hg merge -r 2 --config merge-tools.true.executable=/nonexistent/mergetool
261 $ hg merge -r 2 --config merge-tools.true.executable=/nonexistent/mergetool
262 merging f
262 merging f
263 merging f failed!
263 merging f failed!
264 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
264 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
265 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
265 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
266 [1]
266 [1]
267 $ aftermerge
267 $ aftermerge
268 # cat f
268 # cat f
269 revision 1
269 revision 1
270 space
270 space
271 # hg stat
271 # hg stat
272 M f
272 M f
273 ? f.orig
273 ? f.orig
274 # hg resolve --list
274 # hg resolve --list
275 U f
275 U f
276
276
277 but true.executable set to cat found in PATH works:
277 but true.executable set to cat found in PATH works:
278
278
279 $ echo "true.executable=cat" >> .hg/hgrc
279 $ echo "true.executable=cat" >> .hg/hgrc
280 $ beforemerge
280 $ beforemerge
281 [merge-tools]
281 [merge-tools]
282 false.whatever=
282 false.whatever=
283 true.priority=1
283 true.priority=1
284 true.executable=cat
284 true.executable=cat
285 # hg update -C 1
285 # hg update -C 1
286 $ hg merge -r 2
286 $ hg merge -r 2
287 merging f
287 merging f
288 revision 1
288 revision 1
289 space
289 space
290 revision 0
290 revision 0
291 space
291 space
292 revision 2
292 revision 2
293 space
293 space
294 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
294 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
295 (branch merge, don't forget to commit)
295 (branch merge, don't forget to commit)
296 $ aftermerge
296 $ aftermerge
297 # cat f
297 # cat f
298 revision 1
298 revision 1
299 space
299 space
300 # hg stat
300 # hg stat
301 M f
301 M f
302 # hg resolve --list
302 # hg resolve --list
303 R f
303 R f
304
304
305 and true.executable set to cat with path works:
305 and true.executable set to cat with path works:
306
306
307 $ beforemerge
307 $ beforemerge
308 [merge-tools]
308 [merge-tools]
309 false.whatever=
309 false.whatever=
310 true.priority=1
310 true.priority=1
311 true.executable=cat
311 true.executable=cat
312 # hg update -C 1
312 # hg update -C 1
313 $ hg merge -r 2 --config merge-tools.true.executable=cat
313 $ hg merge -r 2 --config merge-tools.true.executable=cat
314 merging f
314 merging f
315 revision 1
315 revision 1
316 space
316 space
317 revision 0
317 revision 0
318 space
318 space
319 revision 2
319 revision 2
320 space
320 space
321 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
321 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
322 (branch merge, don't forget to commit)
322 (branch merge, don't forget to commit)
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 # hg resolve --list
329 # hg resolve --list
330 R f
330 R f
331
331
332 executable set to python script that succeeds:
332 executable set to python script that succeeds:
333
333
334 $ cat > "$TESTTMP/myworkingmerge.py" <<EOF
334 $ cat > "$TESTTMP/myworkingmerge.py" <<EOF
335 > def myworkingmergefn(ui, repo, args, **kwargs):
335 > def myworkingmergefn(ui, repo, args, **kwargs):
336 > return False
336 > return False
337 > EOF
337 > EOF
338 $ beforemerge
338 $ beforemerge
339 [merge-tools]
339 [merge-tools]
340 false.whatever=
340 false.whatever=
341 true.priority=1
341 true.priority=1
342 true.executable=cat
342 true.executable=cat
343 # hg update -C 1
343 # hg update -C 1
344 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py:myworkingmergefn"
344 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py:myworkingmergefn"
345 merging f
345 merging f
346 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
346 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
347 (branch merge, don't forget to commit)
347 (branch merge, don't forget to commit)
348 $ aftermerge
348 $ aftermerge
349 # cat f
349 # cat f
350 revision 1
350 revision 1
351 space
351 space
352 # hg stat
352 # hg stat
353 M f
353 M f
354 # hg resolve --list
354 # hg resolve --list
355 R f
355 R f
356
356
357 executable set to python script that fails:
357 executable set to python script that fails:
358
358
359 $ cat > "$TESTTMP/mybrokenmerge.py" <<EOF
359 $ cat > "$TESTTMP/mybrokenmerge.py" <<EOF
360 > def mybrokenmergefn(ui, repo, args, **kwargs):
360 > def mybrokenmergefn(ui, repo, args, **kwargs):
361 > ui.write(b"some fail message\n")
361 > ui.write(b"some fail message\n")
362 > return True
362 > return True
363 > EOF
363 > EOF
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-tools.true.executable="python:$TESTTMP/mybrokenmerge.py:mybrokenmergefn"
370 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/mybrokenmerge.py:mybrokenmergefn"
371 merging f
371 merging f
372 some fail message
372 some fail message
373 abort: $TESTTMP/mybrokenmerge.py hook failed
373 abort: $TESTTMP/mybrokenmerge.py hook failed
374 [255]
374 [255]
375 $ aftermerge
375 $ aftermerge
376 # cat f
376 # cat f
377 revision 1
377 revision 1
378 space
378 space
379 # hg stat
379 # hg stat
380 ? f.orig
380 ? f.orig
381 # hg resolve --list
381 # hg resolve --list
382 U f
382 U f
383
383
384 executable set to python script that is missing function:
384 executable set to python script that is missing function:
385
385
386 $ beforemerge
386 $ beforemerge
387 [merge-tools]
387 [merge-tools]
388 false.whatever=
388 false.whatever=
389 true.priority=1
389 true.priority=1
390 true.executable=cat
390 true.executable=cat
391 # hg update -C 1
391 # hg update -C 1
392 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py:missingFunction"
392 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py:missingFunction"
393 merging f
393 merging f
394 abort: $TESTTMP/myworkingmerge.py does not have function: missingFunction
394 abort: $TESTTMP/myworkingmerge.py does not have function: missingFunction
395 [255]
395 [255]
396 $ aftermerge
396 $ aftermerge
397 # cat f
397 # cat f
398 revision 1
398 revision 1
399 space
399 space
400 # hg stat
400 # hg stat
401 ? f.orig
401 ? f.orig
402 # hg resolve --list
402 # hg resolve --list
403 U f
403 U f
404
404
405 executable set to missing python script:
405 executable set to missing python script:
406
406
407 $ beforemerge
407 $ beforemerge
408 [merge-tools]
408 [merge-tools]
409 false.whatever=
409 false.whatever=
410 true.priority=1
410 true.priority=1
411 true.executable=cat
411 true.executable=cat
412 # hg update -C 1
412 # hg update -C 1
413 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/missingpythonscript.py:mergefn"
413 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/missingpythonscript.py:mergefn"
414 merging f
414 merging f
415 abort: loading python merge script failed: $TESTTMP/missingpythonscript.py
415 abort: loading python merge script failed: $TESTTMP/missingpythonscript.py
416 [255]
416 [255]
417 $ aftermerge
417 $ aftermerge
418 # cat f
418 # cat f
419 revision 1
419 revision 1
420 space
420 space
421 # hg stat
421 # hg stat
422 ? f.orig
422 ? f.orig
423 # hg resolve --list
423 # hg resolve --list
424 U f
424 U f
425
425
426 executable set to python script but callable function is missing:
426 executable set to python script but callable function is missing:
427
427
428 $ beforemerge
428 $ beforemerge
429 [merge-tools]
429 [merge-tools]
430 false.whatever=
430 false.whatever=
431 true.priority=1
431 true.priority=1
432 true.executable=cat
432 true.executable=cat
433 # hg update -C 1
433 # hg update -C 1
434 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py"
434 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py"
435 abort: invalid 'python:' syntax: python:$TESTTMP/myworkingmerge.py
435 abort: invalid 'python:' syntax: python:$TESTTMP/myworkingmerge.py
436 [255]
436 [255]
437 $ aftermerge
437 $ aftermerge
438 # cat f
438 # cat f
439 revision 1
439 revision 1
440 space
440 space
441 # hg stat
441 # hg stat
442 # hg resolve --list
442 # hg resolve --list
443 U f
443 U f
444
444
445 executable set to python script but callable function is empty string:
445 executable set to python script but callable function is empty string:
446
446
447 $ beforemerge
447 $ beforemerge
448 [merge-tools]
448 [merge-tools]
449 false.whatever=
449 false.whatever=
450 true.priority=1
450 true.priority=1
451 true.executable=cat
451 true.executable=cat
452 # hg update -C 1
452 # hg update -C 1
453 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py:"
453 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py:"
454 abort: invalid 'python:' syntax: python:$TESTTMP/myworkingmerge.py:
454 abort: invalid 'python:' syntax: python:$TESTTMP/myworkingmerge.py:
455 [255]
455 [255]
456 $ aftermerge
456 $ aftermerge
457 # cat f
457 # cat f
458 revision 1
458 revision 1
459 space
459 space
460 # hg stat
460 # hg stat
461 # hg resolve --list
461 # hg resolve --list
462 U f
462 U f
463
463
464 executable set to python script but callable function is missing and path contains colon:
464 executable set to python script but callable function is missing and path contains colon:
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 merge-tools.true.executable="python:$TESTTMP/some:dir/myworkingmerge.py"
472 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/some:dir/myworkingmerge.py"
473 abort: invalid 'python:' syntax: python:$TESTTMP/some:dir/myworkingmerge.py
473 abort: invalid 'python:' syntax: python:$TESTTMP/some:dir/myworkingmerge.py
474 [255]
474 [255]
475 $ aftermerge
475 $ aftermerge
476 # cat f
476 # cat f
477 revision 1
477 revision 1
478 space
478 space
479 # hg stat
479 # hg stat
480 # hg resolve --list
480 # hg resolve --list
481 U f
481 U f
482
482
483 executable set to python script filename that contains spaces:
483 executable set to python script filename that contains spaces:
484
484
485 $ mkdir -p "$TESTTMP/my path"
485 $ mkdir -p "$TESTTMP/my path"
486 $ cat > "$TESTTMP/my path/my working merge with spaces in filename.py" <<EOF
486 $ cat > "$TESTTMP/my path/my working merge with spaces in filename.py" <<EOF
487 > def myworkingmergefn(ui, repo, args, **kwargs):
487 > def myworkingmergefn(ui, repo, args, **kwargs):
488 > return False
488 > return False
489 > EOF
489 > EOF
490 $ beforemerge
490 $ beforemerge
491 [merge-tools]
491 [merge-tools]
492 false.whatever=
492 false.whatever=
493 true.priority=1
493 true.priority=1
494 true.executable=cat
494 true.executable=cat
495 # hg update -C 1
495 # hg update -C 1
496 $ hg merge -r 2 --config "merge-tools.true.executable=python:$TESTTMP/my path/my working merge with spaces in filename.py:myworkingmergefn"
496 $ hg merge -r 2 --config "merge-tools.true.executable=python:$TESTTMP/my path/my working merge with spaces in filename.py:myworkingmergefn"
497 merging f
497 merging f
498 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
498 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
499 (branch merge, don't forget to commit)
499 (branch merge, don't forget to commit)
500 $ aftermerge
500 $ aftermerge
501 # cat f
501 # cat f
502 revision 1
502 revision 1
503 space
503 space
504 # hg stat
504 # hg stat
505 M f
505 M f
506 # hg resolve --list
506 # hg resolve --list
507 R f
507 R f
508
508
509 #if unix-permissions
509 #if unix-permissions
510
510
511 environment variables in true.executable are handled:
511 environment variables in true.executable are handled:
512
512
513 $ echo 'echo "custom merge tool"' > .hg/merge.sh
513 $ echo 'echo "custom merge tool"' > .hg/merge.sh
514 $ beforemerge
514 $ beforemerge
515 [merge-tools]
515 [merge-tools]
516 false.whatever=
516 false.whatever=
517 true.priority=1
517 true.priority=1
518 true.executable=cat
518 true.executable=cat
519 # hg update -C 1
519 # hg update -C 1
520 $ hg --config merge-tools.true.executable='sh' \
520 $ hg --config merge-tools.true.executable='sh' \
521 > --config merge-tools.true.args=.hg/merge.sh \
521 > --config merge-tools.true.args=.hg/merge.sh \
522 > merge -r 2
522 > merge -r 2
523 merging f
523 merging f
524 custom merge tool
524 custom merge tool
525 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
525 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
526 (branch merge, don't forget to commit)
526 (branch merge, don't forget to commit)
527 $ aftermerge
527 $ aftermerge
528 # cat f
528 # cat f
529 revision 1
529 revision 1
530 space
530 space
531 # hg stat
531 # hg stat
532 M f
532 M f
533 # hg resolve --list
533 # hg resolve --list
534 R f
534 R f
535
535
536 #endif
536 #endif
537
537
538 Tool selection and merge-patterns
538 Tool selection and merge-patterns
539
539
540 merge-patterns specifies new tool false:
540 merge-patterns specifies new tool false:
541
541
542 $ beforemerge
542 $ beforemerge
543 [merge-tools]
543 [merge-tools]
544 false.whatever=
544 false.whatever=
545 true.priority=1
545 true.priority=1
546 true.executable=cat
546 true.executable=cat
547 # hg update -C 1
547 # hg update -C 1
548 $ hg merge -r 2 --config merge-patterns.f=false
548 $ hg merge -r 2 --config merge-patterns.f=false
549 merging f
549 merging f
550 merging f failed!
550 merging f failed!
551 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
551 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
552 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
552 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
553 [1]
553 [1]
554 $ aftermerge
554 $ aftermerge
555 # cat f
555 # cat f
556 revision 1
556 revision 1
557 space
557 space
558 # hg stat
558 # hg stat
559 M f
559 M f
560 ? f.orig
560 ? f.orig
561 # hg resolve --list
561 # hg resolve --list
562 U f
562 U f
563
563
564 merge-patterns specifies executable not found in PATH and gets warning:
564 merge-patterns specifies executable not found in PATH and gets warning:
565
565
566 $ beforemerge
566 $ beforemerge
567 [merge-tools]
567 [merge-tools]
568 false.whatever=
568 false.whatever=
569 true.priority=1
569 true.priority=1
570 true.executable=cat
570 true.executable=cat
571 # hg update -C 1
571 # hg update -C 1
572 $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool
572 $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool
573 couldn't find merge tool true (for pattern f)
573 couldn't find merge tool true (for pattern f)
574 merging f
574 merging f
575 couldn't find merge tool true (for pattern f)
575 couldn't find merge tool true (for pattern 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 merge --abort' to abandon
578 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' 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 # hg resolve --list
587 # hg resolve --list
588 U f
588 U f
589
589
590 merge-patterns specifies executable with bogus path and gets warning:
590 merge-patterns specifies executable with bogus path and gets warning:
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 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexistent/mergetool
598 $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexistent/mergetool
599 couldn't find merge tool true (for pattern f)
599 couldn't find merge tool true (for pattern f)
600 merging f
600 merging f
601 couldn't find merge tool true (for pattern f)
601 couldn't find merge tool true (for pattern f)
602 merging f failed!
602 merging f failed!
603 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
603 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
604 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
604 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
605 [1]
605 [1]
606 $ aftermerge
606 $ aftermerge
607 # cat f
607 # cat f
608 revision 1
608 revision 1
609 space
609 space
610 # hg stat
610 # hg stat
611 M f
611 M f
612 ? f.orig
612 ? f.orig
613 # hg resolve --list
613 # hg resolve --list
614 U f
614 U f
615
615
616 ui.merge overrules priority
616 ui.merge overrules priority
617
617
618 ui.merge specifies false:
618 ui.merge specifies false:
619
619
620 $ beforemerge
620 $ beforemerge
621 [merge-tools]
621 [merge-tools]
622 false.whatever=
622 false.whatever=
623 true.priority=1
623 true.priority=1
624 true.executable=cat
624 true.executable=cat
625 # hg update -C 1
625 # hg update -C 1
626 $ hg merge -r 2 --config ui.merge=false
626 $ hg merge -r 2 --config ui.merge=false
627 merging f
627 merging f
628 merging f failed!
628 merging f failed!
629 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
629 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
630 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
630 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
631 [1]
631 [1]
632 $ aftermerge
632 $ aftermerge
633 # cat f
633 # cat f
634 revision 1
634 revision 1
635 space
635 space
636 # hg stat
636 # hg stat
637 M f
637 M f
638 ? f.orig
638 ? f.orig
639 # hg resolve --list
639 # hg resolve --list
640 U f
640 U f
641
641
642 ui.merge specifies internal:fail:
642 ui.merge specifies internal:fail:
643
643
644 $ beforemerge
644 $ beforemerge
645 [merge-tools]
645 [merge-tools]
646 false.whatever=
646 false.whatever=
647 true.priority=1
647 true.priority=1
648 true.executable=cat
648 true.executable=cat
649 # hg update -C 1
649 # hg update -C 1
650 $ hg merge -r 2 --config ui.merge=internal:fail
650 $ hg merge -r 2 --config ui.merge=internal:fail
651 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
651 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
652 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
652 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
653 [1]
653 [1]
654 $ aftermerge
654 $ aftermerge
655 # cat f
655 # cat f
656 revision 1
656 revision 1
657 space
657 space
658 # hg stat
658 # hg stat
659 M f
659 M f
660 # hg resolve --list
660 # hg resolve --list
661 U f
661 U f
662
662
663 ui.merge specifies :local (without internal prefix):
663 ui.merge specifies :local (without internal prefix):
664
664
665 $ beforemerge
665 $ beforemerge
666 [merge-tools]
666 [merge-tools]
667 false.whatever=
667 false.whatever=
668 true.priority=1
668 true.priority=1
669 true.executable=cat
669 true.executable=cat
670 # hg update -C 1
670 # hg update -C 1
671 $ hg merge -r 2 --config ui.merge=:local
671 $ hg merge -r 2 --config ui.merge=:local
672 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
672 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
673 (branch merge, don't forget to commit)
673 (branch merge, don't forget to commit)
674 $ aftermerge
674 $ aftermerge
675 # cat f
675 # cat f
676 revision 1
676 revision 1
677 space
677 space
678 # hg stat
678 # hg stat
679 M f
679 M f
680 # hg resolve --list
680 # hg resolve --list
681 R f
681 R f
682
682
683 ui.merge specifies internal:other:
683 ui.merge specifies internal:other:
684
684
685 $ beforemerge
685 $ beforemerge
686 [merge-tools]
686 [merge-tools]
687 false.whatever=
687 false.whatever=
688 true.priority=1
688 true.priority=1
689 true.executable=cat
689 true.executable=cat
690 # hg update -C 1
690 # hg update -C 1
691 $ hg merge -r 2 --config ui.merge=internal:other
691 $ hg merge -r 2 --config ui.merge=internal:other
692 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
692 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
693 (branch merge, don't forget to commit)
693 (branch merge, don't forget to commit)
694 $ aftermerge
694 $ aftermerge
695 # cat f
695 # cat f
696 revision 2
696 revision 2
697 space
697 space
698 # hg stat
698 # hg stat
699 M f
699 M f
700 # hg resolve --list
700 # hg resolve --list
701 R f
701 R f
702
702
703 ui.merge specifies internal:prompt:
703 ui.merge specifies internal:prompt:
704
704
705 $ beforemerge
705 $ beforemerge
706 [merge-tools]
706 [merge-tools]
707 false.whatever=
707 false.whatever=
708 true.priority=1
708 true.priority=1
709 true.executable=cat
709 true.executable=cat
710 # hg update -C 1
710 # hg update -C 1
711 $ hg merge -r 2 --config ui.merge=internal:prompt
711 $ hg merge -r 2 --config ui.merge=internal:prompt
712 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
712 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
713 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
713 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
714 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
714 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
715 [1]
715 [1]
716 $ aftermerge
716 $ aftermerge
717 # cat f
717 # cat f
718 revision 1
718 revision 1
719 space
719 space
720 # hg stat
720 # hg stat
721 M f
721 M f
722 # hg resolve --list
722 # hg resolve --list
723 U f
723 U f
724
724
725 ui.merge specifies :prompt, with 'leave unresolved' chosen
725 ui.merge specifies :prompt, with 'leave unresolved' chosen
726
726
727 $ beforemerge
727 $ beforemerge
728 [merge-tools]
728 [merge-tools]
729 false.whatever=
729 false.whatever=
730 true.priority=1
730 true.priority=1
731 true.executable=cat
731 true.executable=cat
732 # hg update -C 1
732 # hg update -C 1
733 $ hg merge -r 2 --config ui.merge=:prompt --config ui.interactive=True << EOF
733 $ hg merge -r 2 --config ui.merge=:prompt --config ui.interactive=True << EOF
734 > u
734 > u
735 > EOF
735 > EOF
736 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
736 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
737 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
737 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
738 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
738 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
739 [1]
739 [1]
740 $ aftermerge
740 $ aftermerge
741 # cat f
741 # cat f
742 revision 1
742 revision 1
743 space
743 space
744 # hg stat
744 # hg stat
745 M f
745 M f
746 # hg resolve --list
746 # hg resolve --list
747 U f
747 U f
748
748
749 prompt with EOF
749 prompt with EOF
750
750
751 $ beforemerge
751 $ beforemerge
752 [merge-tools]
752 [merge-tools]
753 false.whatever=
753 false.whatever=
754 true.priority=1
754 true.priority=1
755 true.executable=cat
755 true.executable=cat
756 # hg update -C 1
756 # hg update -C 1
757 $ hg merge -r 2 --config ui.merge=internal:prompt --config ui.interactive=true
757 $ hg merge -r 2 --config ui.merge=internal:prompt --config ui.interactive=true
758 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f?
758 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f?
759 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
759 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
760 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
760 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
761 [1]
761 [1]
762 $ aftermerge
762 $ aftermerge
763 # cat f
763 # cat f
764 revision 1
764 revision 1
765 space
765 space
766 # hg stat
766 # hg stat
767 M f
767 M f
768 # hg resolve --list
768 # hg resolve --list
769 U f
769 U f
770 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true
770 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true
771 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f?
771 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f?
772 [1]
772 [1]
773 $ aftermerge
773 $ aftermerge
774 # cat f
774 # cat f
775 revision 1
775 revision 1
776 space
776 space
777 # hg stat
777 # hg stat
778 M f
778 M f
779 ? f.orig
779 ? f.orig
780 # hg resolve --list
780 # hg resolve --list
781 U f
781 U f
782 $ rm f
782 $ rm f
783 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true
783 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true
784 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f?
784 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f?
785 [1]
785 [1]
786 $ aftermerge
786 $ aftermerge
787 # cat f
787 # cat f
788 revision 1
788 revision 1
789 space
789 space
790 # hg stat
790 # hg stat
791 M f
791 M f
792 # hg resolve --list
792 # hg resolve --list
793 U f
793 U f
794 $ hg resolve --all --config ui.merge=internal:prompt
794 $ hg resolve --all --config ui.merge=internal:prompt
795 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
795 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u
796 [1]
796 [1]
797 $ aftermerge
797 $ aftermerge
798 # cat f
798 # cat f
799 revision 1
799 revision 1
800 space
800 space
801 # hg stat
801 # hg stat
802 M f
802 M f
803 ? f.orig
803 ? f.orig
804 # hg resolve --list
804 # hg resolve --list
805 U f
805 U f
806
806
807 ui.merge specifies internal:dump:
807 ui.merge specifies internal:dump:
808
808
809 $ beforemerge
809 $ beforemerge
810 [merge-tools]
810 [merge-tools]
811 false.whatever=
811 false.whatever=
812 true.priority=1
812 true.priority=1
813 true.executable=cat
813 true.executable=cat
814 # hg update -C 1
814 # hg update -C 1
815 $ hg merge -r 2 --config ui.merge=internal:dump
815 $ hg merge -r 2 --config ui.merge=internal:dump
816 merging f
816 merging f
817 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
817 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
818 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
818 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
819 [1]
819 [1]
820 $ aftermerge
820 $ aftermerge
821 # cat f
821 # cat f
822 revision 1
822 revision 1
823 space
823 space
824 # hg stat
824 # hg stat
825 M f
825 M f
826 ? f.base
826 ? f.base
827 ? f.local
827 ? f.local
828 ? f.orig
828 ? f.orig
829 ? f.other
829 ? f.other
830 # hg resolve --list
830 # hg resolve --list
831 U f
831 U f
832
832
833 f.base:
833 f.base:
834
834
835 $ cat f.base
835 $ cat f.base
836 revision 0
836 revision 0
837 space
837 space
838
838
839 f.local:
839 f.local:
840
840
841 $ cat f.local
841 $ cat f.local
842 revision 1
842 revision 1
843 space
843 space
844
844
845 f.other:
845 f.other:
846
846
847 $ cat f.other
847 $ cat f.other
848 revision 2
848 revision 2
849 space
849 space
850 $ rm f.base f.local f.other
850 $ rm f.base f.local f.other
851
851
852 check that internal:dump doesn't dump files if premerge runs
852 check that internal:dump doesn't dump files if premerge runs
853 successfully
853 successfully
854
854
855 $ beforemerge
855 $ beforemerge
856 [merge-tools]
856 [merge-tools]
857 false.whatever=
857 false.whatever=
858 true.priority=1
858 true.priority=1
859 true.executable=cat
859 true.executable=cat
860 # hg update -C 1
860 # hg update -C 1
861 $ hg merge -r 3 --config ui.merge=internal:dump
861 $ hg merge -r 3 --config ui.merge=internal:dump
862 merging f
862 merging f
863 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
863 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
864 (branch merge, don't forget to commit)
864 (branch merge, don't forget to commit)
865
865
866 $ aftermerge
866 $ aftermerge
867 # cat f
867 # cat f
868 revision 1
868 revision 1
869 space
869 space
870 revision 3
870 revision 3
871 # hg stat
871 # hg stat
872 M f
872 M f
873 # hg resolve --list
873 # hg resolve --list
874 R f
874 R f
875
875
876 check that internal:forcedump dumps files, even if local and other can
876 check that internal:forcedump dumps files, even if local and other can
877 be merged easily
877 be merged easily
878
878
879 $ beforemerge
879 $ beforemerge
880 [merge-tools]
880 [merge-tools]
881 false.whatever=
881 false.whatever=
882 true.priority=1
882 true.priority=1
883 true.executable=cat
883 true.executable=cat
884 # hg update -C 1
884 # hg update -C 1
885 $ hg merge -r 3 --config ui.merge=internal:forcedump
885 $ hg merge -r 3 --config ui.merge=internal:forcedump
886 merging f
886 merging f
887 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
887 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
888 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
888 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
889 [1]
889 [1]
890 $ aftermerge
890 $ aftermerge
891 # cat f
891 # cat f
892 revision 1
892 revision 1
893 space
893 space
894 # hg stat
894 # hg stat
895 M f
895 M f
896 ? f.base
896 ? f.base
897 ? f.local
897 ? f.local
898 ? f.orig
898 ? f.orig
899 ? f.other
899 ? f.other
900 # hg resolve --list
900 # hg resolve --list
901 U f
901 U f
902
902
903 $ cat f.base
903 $ cat f.base
904 revision 0
904 revision 0
905 space
905 space
906
906
907 $ cat f.local
907 $ cat f.local
908 revision 1
908 revision 1
909 space
909 space
910
910
911 $ cat f.other
911 $ cat f.other
912 revision 0
912 revision 0
913 space
913 space
914 revision 3
914 revision 3
915
915
916 $ rm -f f.base f.local f.other
916 $ rm -f f.base f.local f.other
917
917
918 ui.merge specifies internal:other but is overruled by pattern for false:
918 ui.merge specifies internal:other but is overruled by pattern for false:
919
919
920 $ beforemerge
920 $ beforemerge
921 [merge-tools]
921 [merge-tools]
922 false.whatever=
922 false.whatever=
923 true.priority=1
923 true.priority=1
924 true.executable=cat
924 true.executable=cat
925 # hg update -C 1
925 # hg update -C 1
926 $ hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
926 $ hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
927 merging f
927 merging f
928 merging f failed!
928 merging f failed!
929 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
929 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
930 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
930 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
931 [1]
931 [1]
932 $ aftermerge
932 $ aftermerge
933 # cat f
933 # cat f
934 revision 1
934 revision 1
935 space
935 space
936 # hg stat
936 # hg stat
937 M f
937 M f
938 ? f.orig
938 ? f.orig
939 # hg resolve --list
939 # hg resolve --list
940 U f
940 U f
941
941
942 Premerge
942 Premerge
943
943
944 ui.merge specifies internal:other but is overruled by --tool=false
944 ui.merge specifies internal:other but is overruled by --tool=false
945
945
946 $ beforemerge
946 $ beforemerge
947 [merge-tools]
947 [merge-tools]
948 false.whatever=
948 false.whatever=
949 true.priority=1
949 true.priority=1
950 true.executable=cat
950 true.executable=cat
951 # hg update -C 1
951 # hg update -C 1
952 $ hg merge -r 2 --config ui.merge=internal:other --tool=false
952 $ hg merge -r 2 --config ui.merge=internal:other --tool=false
953 merging f
953 merging f
954 merging f failed!
954 merging f failed!
955 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
955 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
956 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
956 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
957 [1]
957 [1]
958 $ aftermerge
958 $ aftermerge
959 # cat f
959 # cat f
960 revision 1
960 revision 1
961 space
961 space
962 # hg stat
962 # hg stat
963 M f
963 M f
964 ? f.orig
964 ? f.orig
965 # hg resolve --list
965 # hg resolve --list
966 U f
966 U f
967
967
968 HGMERGE specifies internal:other but is overruled by --tool=false
968 HGMERGE specifies internal:other but is overruled by --tool=false
969
969
970 $ HGMERGE=internal:other ; export HGMERGE
970 $ HGMERGE=internal:other ; export HGMERGE
971 $ beforemerge
971 $ beforemerge
972 [merge-tools]
972 [merge-tools]
973 false.whatever=
973 false.whatever=
974 true.priority=1
974 true.priority=1
975 true.executable=cat
975 true.executable=cat
976 # hg update -C 1
976 # hg update -C 1
977 $ hg merge -r 2 --tool=false
977 $ hg merge -r 2 --tool=false
978 merging f
978 merging f
979 merging f failed!
979 merging f failed!
980 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
980 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
981 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
981 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
982 [1]
982 [1]
983 $ aftermerge
983 $ aftermerge
984 # cat f
984 # cat f
985 revision 1
985 revision 1
986 space
986 space
987 # hg stat
987 # hg stat
988 M f
988 M f
989 ? f.orig
989 ? f.orig
990 # hg resolve --list
990 # hg resolve --list
991 U f
991 U f
992
992
993 $ unset HGMERGE # make sure HGMERGE doesn't interfere with remaining tests
993 $ unset HGMERGE # make sure HGMERGE doesn't interfere with remaining tests
994
994
995 update is a merge ...
995 update is a merge ...
996
996
997 (this also tests that files reverted with '--rev REV' are treated as
997 (this also tests that files reverted with '--rev REV' are treated as
998 "modified", even if none of mode, size and timestamp of them isn't
998 "modified", even if none of mode, size and timestamp of them isn't
999 changed on the filesystem (see also issue4583))
999 changed on the filesystem (see also issue4583))
1000
1000
1001 $ cat >> $HGRCPATH <<EOF
1001 $ cat >> $HGRCPATH <<EOF
1002 > [fakedirstatewritetime]
1002 > [fakedirstatewritetime]
1003 > # emulate invoking dirstate.write() via repo.status()
1003 > # emulate invoking dirstate.write() via repo.status()
1004 > # at 2000-01-01 00:00
1004 > # at 2000-01-01 00:00
1005 > fakenow = 200001010000
1005 > fakenow = 200001010000
1006 > EOF
1006 > EOF
1007
1007
1008 $ beforemerge
1008 $ beforemerge
1009 [merge-tools]
1009 [merge-tools]
1010 false.whatever=
1010 false.whatever=
1011 true.priority=1
1011 true.priority=1
1012 true.executable=cat
1012 true.executable=cat
1013 # hg update -C 1
1013 # hg update -C 1
1014 $ hg update -q 0
1014 $ hg update -q 0
1015 $ f -s f
1015 $ f -s f
1016 f: size=17
1016 f: size=17
1017 $ touch -t 200001010000 f
1017 $ touch -t 200001010000 f
1018 $ hg debugrebuildstate
1018 $ hg debugrebuildstate
1019 $ cat >> $HGRCPATH <<EOF
1019 $ cat >> $HGRCPATH <<EOF
1020 > [extensions]
1020 > [extensions]
1021 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
1021 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
1022 > EOF
1022 > EOF
1023 $ hg revert -q -r 1 .
1023 $ hg revert -q -r 1 .
1024 $ cat >> $HGRCPATH <<EOF
1024 $ cat >> $HGRCPATH <<EOF
1025 > [extensions]
1025 > [extensions]
1026 > fakedirstatewritetime = !
1026 > fakedirstatewritetime = !
1027 > EOF
1027 > EOF
1028 $ f -s f
1028 $ f -s f
1029 f: size=17
1029 f: size=17
1030 $ touch -t 200001010000 f
1030 $ touch -t 200001010000 f
1031 $ hg status f
1031 $ hg status f
1032 M f
1032 M f
1033 $ hg update -r 2
1033 $ hg update -r 2
1034 merging f
1034 merging f
1035 revision 1
1035 revision 1
1036 space
1036 space
1037 revision 0
1037 revision 0
1038 space
1038 space
1039 revision 2
1039 revision 2
1040 space
1040 space
1041 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1041 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1042 $ aftermerge
1042 $ aftermerge
1043 # cat f
1043 # cat f
1044 revision 1
1044 revision 1
1045 space
1045 space
1046 # hg stat
1046 # hg stat
1047 M f
1047 M f
1048 # hg resolve --list
1048 # hg resolve --list
1049 R f
1049 R f
1050
1050
1051 update should also have --tool
1051 update should also have --tool
1052
1052
1053 $ beforemerge
1053 $ beforemerge
1054 [merge-tools]
1054 [merge-tools]
1055 false.whatever=
1055 false.whatever=
1056 true.priority=1
1056 true.priority=1
1057 true.executable=cat
1057 true.executable=cat
1058 # hg update -C 1
1058 # hg update -C 1
1059 $ hg update -q 0
1059 $ hg update -q 0
1060 $ f -s f
1060 $ f -s f
1061 f: size=17
1061 f: size=17
1062 $ touch -t 200001010000 f
1062 $ touch -t 200001010000 f
1063 $ hg debugrebuildstate
1063 $ hg debugrebuildstate
1064 $ cat >> $HGRCPATH <<EOF
1064 $ cat >> $HGRCPATH <<EOF
1065 > [extensions]
1065 > [extensions]
1066 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
1066 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
1067 > EOF
1067 > EOF
1068 $ hg revert -q -r 1 .
1068 $ hg revert -q -r 1 .
1069 $ cat >> $HGRCPATH <<EOF
1069 $ cat >> $HGRCPATH <<EOF
1070 > [extensions]
1070 > [extensions]
1071 > fakedirstatewritetime = !
1071 > fakedirstatewritetime = !
1072 > EOF
1072 > EOF
1073 $ f -s f
1073 $ f -s f
1074 f: size=17
1074 f: size=17
1075 $ touch -t 200001010000 f
1075 $ touch -t 200001010000 f
1076 $ hg status f
1076 $ hg status f
1077 M f
1077 M f
1078 $ hg update -r 2 --tool false
1078 $ hg update -r 2 --tool false
1079 merging f
1079 merging f
1080 merging f failed!
1080 merging f failed!
1081 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1081 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1082 use 'hg resolve' to retry unresolved file merges
1082 use 'hg resolve' to retry unresolved file merges
1083 [1]
1083 [1]
1084 $ aftermerge
1084 $ aftermerge
1085 # cat f
1085 # cat f
1086 revision 1
1086 revision 1
1087 space
1087 space
1088 # hg stat
1088 # hg stat
1089 M f
1089 M f
1090 ? f.orig
1090 ? f.orig
1091 # hg resolve --list
1091 # hg resolve --list
1092 U f
1092 U f
1093
1093
1094 Default is silent simplemerge:
1094 Default is silent simplemerge:
1095
1095
1096 $ beforemerge
1096 $ beforemerge
1097 [merge-tools]
1097 [merge-tools]
1098 false.whatever=
1098 false.whatever=
1099 true.priority=1
1099 true.priority=1
1100 true.executable=cat
1100 true.executable=cat
1101 # hg update -C 1
1101 # hg update -C 1
1102 $ hg merge -r 3
1102 $ hg merge -r 3
1103 merging f
1103 merging f
1104 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1104 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1105 (branch merge, don't forget to commit)
1105 (branch merge, don't forget to commit)
1106 $ aftermerge
1106 $ aftermerge
1107 # cat f
1107 # cat f
1108 revision 1
1108 revision 1
1109 space
1109 space
1110 revision 3
1110 revision 3
1111 # hg stat
1111 # hg stat
1112 M f
1112 M f
1113 # hg resolve --list
1113 # hg resolve --list
1114 R f
1114 R f
1115
1115
1116 .premerge=True is same:
1116 .premerge=True is same:
1117
1117
1118 $ beforemerge
1118 $ beforemerge
1119 [merge-tools]
1119 [merge-tools]
1120 false.whatever=
1120 false.whatever=
1121 true.priority=1
1121 true.priority=1
1122 true.executable=cat
1122 true.executable=cat
1123 # hg update -C 1
1123 # hg update -C 1
1124 $ hg merge -r 3 --config merge-tools.true.premerge=True
1124 $ hg merge -r 3 --config merge-tools.true.premerge=True
1125 merging f
1125 merging f
1126 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1126 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1127 (branch merge, don't forget to commit)
1127 (branch merge, don't forget to commit)
1128 $ aftermerge
1128 $ aftermerge
1129 # cat f
1129 # cat f
1130 revision 1
1130 revision 1
1131 space
1131 space
1132 revision 3
1132 revision 3
1133 # hg stat
1133 # hg stat
1134 M f
1134 M f
1135 # hg resolve --list
1135 # hg resolve --list
1136 R f
1136 R f
1137
1137
1138 .premerge=False executes merge-tool:
1138 .premerge=False executes merge-tool:
1139
1139
1140 $ beforemerge
1140 $ beforemerge
1141 [merge-tools]
1141 [merge-tools]
1142 false.whatever=
1142 false.whatever=
1143 true.priority=1
1143 true.priority=1
1144 true.executable=cat
1144 true.executable=cat
1145 # hg update -C 1
1145 # hg update -C 1
1146 $ hg merge -r 3 --config merge-tools.true.premerge=False
1146 $ hg merge -r 3 --config merge-tools.true.premerge=False
1147 merging f
1147 merging f
1148 revision 1
1148 revision 1
1149 space
1149 space
1150 revision 0
1150 revision 0
1151 space
1151 space
1152 revision 0
1152 revision 0
1153 space
1153 space
1154 revision 3
1154 revision 3
1155 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1155 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1156 (branch merge, don't forget to commit)
1156 (branch merge, don't forget to commit)
1157 $ aftermerge
1157 $ aftermerge
1158 # cat f
1158 # cat f
1159 revision 1
1159 revision 1
1160 space
1160 space
1161 # hg stat
1161 # hg stat
1162 M f
1162 M f
1163 # hg resolve --list
1163 # hg resolve --list
1164 R f
1164 R f
1165
1165
1166 premerge=keep keeps conflict markers in:
1166 premerge=keep keeps conflict markers in:
1167
1167
1168 $ beforemerge
1168 $ beforemerge
1169 [merge-tools]
1169 [merge-tools]
1170 false.whatever=
1170 false.whatever=
1171 true.priority=1
1171 true.priority=1
1172 true.executable=cat
1172 true.executable=cat
1173 # hg update -C 1
1173 # hg update -C 1
1174 $ hg merge -r 4 --config merge-tools.true.premerge=keep
1174 $ hg merge -r 4 --config merge-tools.true.premerge=keep
1175 merging f
1175 merging f
1176 <<<<<<< working copy: ef83787e2614 - test: revision 1
1176 <<<<<<< working copy: ef83787e2614 - test: revision 1
1177 revision 1
1177 revision 1
1178 space
1178 space
1179 =======
1179 =======
1180 revision 4
1180 revision 4
1181 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1181 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1182 revision 0
1182 revision 0
1183 space
1183 space
1184 revision 4
1184 revision 4
1185 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1185 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1186 (branch merge, don't forget to commit)
1186 (branch merge, don't forget to commit)
1187 $ aftermerge
1187 $ aftermerge
1188 # cat f
1188 # cat f
1189 <<<<<<< working copy: ef83787e2614 - test: revision 1
1189 <<<<<<< working copy: ef83787e2614 - test: revision 1
1190 revision 1
1190 revision 1
1191 space
1191 space
1192 =======
1192 =======
1193 revision 4
1193 revision 4
1194 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1194 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1195 # hg stat
1195 # hg stat
1196 M f
1196 M f
1197 # hg resolve --list
1197 # hg resolve --list
1198 R f
1198 R f
1199
1199
1200 premerge=keep-merge3 keeps conflict markers with base content:
1200 premerge=keep-merge3 keeps conflict markers with base content:
1201
1201
1202 $ beforemerge
1202 $ beforemerge
1203 [merge-tools]
1203 [merge-tools]
1204 false.whatever=
1204 false.whatever=
1205 true.priority=1
1205 true.priority=1
1206 true.executable=cat
1206 true.executable=cat
1207 # hg update -C 1
1207 # hg update -C 1
1208 $ hg merge -r 4 --config merge-tools.true.premerge=keep-merge3
1208 $ hg merge -r 4 --config merge-tools.true.premerge=keep-merge3
1209 merging f
1209 merging f
1210 <<<<<<< working copy: ef83787e2614 - test: revision 1
1210 <<<<<<< working copy: ef83787e2614 - test: revision 1
1211 revision 1
1211 revision 1
1212 space
1212 space
1213 ||||||| base
1213 ||||||| base
1214 revision 0
1214 revision 0
1215 space
1215 space
1216 =======
1216 =======
1217 revision 4
1217 revision 4
1218 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1218 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1219 revision 0
1219 revision 0
1220 space
1220 space
1221 revision 4
1221 revision 4
1222 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1222 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1223 (branch merge, don't forget to commit)
1223 (branch merge, don't forget to commit)
1224 $ aftermerge
1224 $ aftermerge
1225 # cat f
1225 # cat f
1226 <<<<<<< working copy: ef83787e2614 - test: revision 1
1226 <<<<<<< working copy: ef83787e2614 - test: revision 1
1227 revision 1
1227 revision 1
1228 space
1228 space
1229 ||||||| base
1229 ||||||| base
1230 revision 0
1230 revision 0
1231 space
1231 space
1232 =======
1232 =======
1233 revision 4
1233 revision 4
1234 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1234 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1235 # hg stat
1235 # hg stat
1236 M f
1236 M f
1237 # hg resolve --list
1237 # hg resolve --list
1238 R f
1238 R f
1239
1239
1240 premerge=keep respects ui.mergemarkers=basic:
1240 premerge=keep respects ui.mergemarkers=basic:
1241
1241
1242 $ beforemerge
1242 $ beforemerge
1243 [merge-tools]
1243 [merge-tools]
1244 false.whatever=
1244 false.whatever=
1245 true.priority=1
1245 true.priority=1
1246 true.executable=cat
1246 true.executable=cat
1247 # hg update -C 1
1247 # hg update -C 1
1248 $ hg merge -r 4 --config merge-tools.true.premerge=keep --config ui.mergemarkers=basic
1248 $ hg merge -r 4 --config merge-tools.true.premerge=keep --config ui.mergemarkers=basic
1249 merging f
1249 merging f
1250 <<<<<<< working copy
1250 <<<<<<< working copy
1251 revision 1
1251 revision 1
1252 space
1252 space
1253 =======
1253 =======
1254 revision 4
1254 revision 4
1255 >>>>>>> merge rev
1255 >>>>>>> merge rev
1256 revision 0
1256 revision 0
1257 space
1257 space
1258 revision 4
1258 revision 4
1259 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1259 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1260 (branch merge, don't forget to commit)
1260 (branch merge, don't forget to commit)
1261 $ aftermerge
1261 $ aftermerge
1262 # cat f
1262 # cat f
1263 <<<<<<< working copy
1263 <<<<<<< working copy
1264 revision 1
1264 revision 1
1265 space
1265 space
1266 =======
1266 =======
1267 revision 4
1267 revision 4
1268 >>>>>>> merge rev
1268 >>>>>>> merge rev
1269 # hg stat
1269 # hg stat
1270 M f
1270 M f
1271 # hg resolve --list
1271 # hg resolve --list
1272 R f
1272 R f
1273
1273
1274 premerge=keep ignores ui.mergemarkers=basic if true.mergemarkers=detailed:
1274 premerge=keep ignores ui.mergemarkers=basic if true.mergemarkers=detailed:
1275
1275
1276 $ beforemerge
1276 $ beforemerge
1277 [merge-tools]
1277 [merge-tools]
1278 false.whatever=
1278 false.whatever=
1279 true.priority=1
1279 true.priority=1
1280 true.executable=cat
1280 true.executable=cat
1281 # hg update -C 1
1281 # hg update -C 1
1282 $ hg merge -r 4 --config merge-tools.true.premerge=keep \
1282 $ hg merge -r 4 --config merge-tools.true.premerge=keep \
1283 > --config ui.mergemarkers=basic \
1283 > --config ui.mergemarkers=basic \
1284 > --config merge-tools.true.mergemarkers=detailed
1284 > --config merge-tools.true.mergemarkers=detailed
1285 merging f
1285 merging f
1286 <<<<<<< working copy: ef83787e2614 - test: revision 1
1286 <<<<<<< working copy: ef83787e2614 - test: revision 1
1287 revision 1
1287 revision 1
1288 space
1288 space
1289 =======
1289 =======
1290 revision 4
1290 revision 4
1291 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1291 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1292 revision 0
1292 revision 0
1293 space
1293 space
1294 revision 4
1294 revision 4
1295 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1295 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1296 (branch merge, don't forget to commit)
1296 (branch merge, don't forget to commit)
1297 $ aftermerge
1297 $ aftermerge
1298 # cat f
1298 # cat f
1299 <<<<<<< working copy: ef83787e2614 - test: revision 1
1299 <<<<<<< working copy: ef83787e2614 - test: revision 1
1300 revision 1
1300 revision 1
1301 space
1301 space
1302 =======
1302 =======
1303 revision 4
1303 revision 4
1304 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1304 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1305 # hg stat
1305 # hg stat
1306 M f
1306 M f
1307 # hg resolve --list
1307 # hg resolve --list
1308 R f
1308 R f
1309
1309
1310 premerge=keep respects ui.mergemarkertemplate instead of
1310 premerge=keep respects ui.mergemarkertemplate instead of
1311 true.mergemarkertemplate if true.mergemarkers=basic:
1311 true.mergemarkertemplate if true.mergemarkers=basic:
1312
1312
1313 $ beforemerge
1313 $ beforemerge
1314 [merge-tools]
1314 [merge-tools]
1315 false.whatever=
1315 false.whatever=
1316 true.priority=1
1316 true.priority=1
1317 true.executable=cat
1317 true.executable=cat
1318 # hg update -C 1
1318 # hg update -C 1
1319 $ hg merge -r 4 --config merge-tools.true.premerge=keep \
1319 $ hg merge -r 4 --config merge-tools.true.premerge=keep \
1320 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1320 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1321 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}'
1321 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}'
1322 merging f
1322 merging f
1323 <<<<<<< working copy: uitmpl 1
1323 <<<<<<< working copy: uitmpl 1
1324 revision 1
1324 revision 1
1325 space
1325 space
1326 =======
1326 =======
1327 revision 4
1327 revision 4
1328 >>>>>>> merge rev: uitmpl 4
1328 >>>>>>> merge rev: uitmpl 4
1329 revision 0
1329 revision 0
1330 space
1330 space
1331 revision 4
1331 revision 4
1332 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1332 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1333 (branch merge, don't forget to commit)
1333 (branch merge, don't forget to commit)
1334 $ aftermerge
1334 $ aftermerge
1335 # cat f
1335 # cat f
1336 <<<<<<< working copy: uitmpl 1
1336 <<<<<<< working copy: uitmpl 1
1337 revision 1
1337 revision 1
1338 space
1338 space
1339 =======
1339 =======
1340 revision 4
1340 revision 4
1341 >>>>>>> merge rev: uitmpl 4
1341 >>>>>>> merge rev: uitmpl 4
1342 # hg stat
1342 # hg stat
1343 M f
1343 M f
1344 # hg resolve --list
1344 # hg resolve --list
1345 R f
1345 R f
1346
1346
1347 premerge=keep respects true.mergemarkertemplate instead of
1347 premerge=keep respects true.mergemarkertemplate instead of
1348 true.mergemarkertemplate if true.mergemarkers=detailed:
1348 true.mergemarkertemplate if true.mergemarkers=detailed:
1349
1349
1350 $ beforemerge
1350 $ beforemerge
1351 [merge-tools]
1351 [merge-tools]
1352 false.whatever=
1352 false.whatever=
1353 true.priority=1
1353 true.priority=1
1354 true.executable=cat
1354 true.executable=cat
1355 # hg update -C 1
1355 # hg update -C 1
1356 $ hg merge -r 4 --config merge-tools.true.premerge=keep \
1356 $ hg merge -r 4 --config merge-tools.true.premerge=keep \
1357 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1357 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1358 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1358 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1359 > --config merge-tools.true.mergemarkers=detailed
1359 > --config merge-tools.true.mergemarkers=detailed
1360 merging f
1360 merging f
1361 <<<<<<< working copy: tooltmpl ef83787e2614
1361 <<<<<<< working copy: tooltmpl ef83787e2614
1362 revision 1
1362 revision 1
1363 space
1363 space
1364 =======
1364 =======
1365 revision 4
1365 revision 4
1366 >>>>>>> merge rev: tooltmpl 81448d39c9a0
1366 >>>>>>> merge rev: tooltmpl 81448d39c9a0
1367 revision 0
1367 revision 0
1368 space
1368 space
1369 revision 4
1369 revision 4
1370 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1370 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1371 (branch merge, don't forget to commit)
1371 (branch merge, don't forget to commit)
1372 $ aftermerge
1372 $ aftermerge
1373 # cat f
1373 # cat f
1374 <<<<<<< working copy: tooltmpl ef83787e2614
1374 <<<<<<< working copy: tooltmpl ef83787e2614
1375 revision 1
1375 revision 1
1376 space
1376 space
1377 =======
1377 =======
1378 revision 4
1378 revision 4
1379 >>>>>>> merge rev: tooltmpl 81448d39c9a0
1379 >>>>>>> merge rev: tooltmpl 81448d39c9a0
1380 # hg stat
1380 # hg stat
1381 M f
1381 M f
1382 # hg resolve --list
1382 # hg resolve --list
1383 R f
1383 R f
1384
1384
1385 Tool execution
1385 Tool execution
1386
1386
1387 set tools.args explicit to include $base $local $other $output:
1387 set tools.args explicit to include $base $local $other $output:
1388
1388
1389 $ beforemerge
1389 $ beforemerge
1390 [merge-tools]
1390 [merge-tools]
1391 false.whatever=
1391 false.whatever=
1392 true.priority=1
1392 true.priority=1
1393 true.executable=cat
1393 true.executable=cat
1394 # hg update -C 1
1394 # hg update -C 1
1395 $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \
1395 $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \
1396 > | sed 's,==> .* <==,==> ... <==,g'
1396 > | sed 's,==> .* <==,==> ... <==,g'
1397 merging f
1397 merging f
1398 ==> ... <==
1398 ==> ... <==
1399 revision 0
1399 revision 0
1400 space
1400 space
1401
1401
1402 ==> ... <==
1402 ==> ... <==
1403 revision 1
1403 revision 1
1404 space
1404 space
1405
1405
1406 ==> ... <==
1406 ==> ... <==
1407 revision 2
1407 revision 2
1408 space
1408 space
1409
1409
1410 ==> ... <==
1410 ==> ... <==
1411 revision 1
1411 revision 1
1412 space
1412 space
1413 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1413 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1414 (branch merge, don't forget to commit)
1414 (branch merge, don't forget to commit)
1415 $ aftermerge
1415 $ aftermerge
1416 # cat f
1416 # cat f
1417 revision 1
1417 revision 1
1418 space
1418 space
1419 # hg stat
1419 # hg stat
1420 M f
1420 M f
1421 # hg resolve --list
1421 # hg resolve --list
1422 R f
1422 R f
1423
1423
1424 Merge with "echo mergeresult > $local":
1424 Merge with "echo mergeresult > $local":
1425
1425
1426 $ beforemerge
1426 $ beforemerge
1427 [merge-tools]
1427 [merge-tools]
1428 false.whatever=
1428 false.whatever=
1429 true.priority=1
1429 true.priority=1
1430 true.executable=cat
1430 true.executable=cat
1431 # hg update -C 1
1431 # hg update -C 1
1432 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local'
1432 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local'
1433 merging f
1433 merging f
1434 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1434 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1435 (branch merge, don't forget to commit)
1435 (branch merge, don't forget to commit)
1436 $ aftermerge
1436 $ aftermerge
1437 # cat f
1437 # cat f
1438 mergeresult
1438 mergeresult
1439 # hg stat
1439 # hg stat
1440 M f
1440 M f
1441 # hg resolve --list
1441 # hg resolve --list
1442 R f
1442 R f
1443
1443
1444 - and $local is the file f:
1444 - and $local is the file f:
1445
1445
1446 $ beforemerge
1446 $ beforemerge
1447 [merge-tools]
1447 [merge-tools]
1448 false.whatever=
1448 false.whatever=
1449 true.priority=1
1449 true.priority=1
1450 true.executable=cat
1450 true.executable=cat
1451 # hg update -C 1
1451 # hg update -C 1
1452 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f'
1452 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f'
1453 merging f
1453 merging f
1454 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1454 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1455 (branch merge, don't forget to commit)
1455 (branch merge, don't forget to commit)
1456 $ aftermerge
1456 $ aftermerge
1457 # cat f
1457 # cat f
1458 mergeresult
1458 mergeresult
1459 # hg stat
1459 # hg stat
1460 M f
1460 M f
1461 # hg resolve --list
1461 # hg resolve --list
1462 R f
1462 R f
1463
1463
1464 Merge with "echo mergeresult > $output" - the variable is a bit magic:
1464 Merge with "echo mergeresult > $output" - the variable is a bit magic:
1465
1465
1466 $ beforemerge
1466 $ beforemerge
1467 [merge-tools]
1467 [merge-tools]
1468 false.whatever=
1468 false.whatever=
1469 true.priority=1
1469 true.priority=1
1470 true.executable=cat
1470 true.executable=cat
1471 # hg update -C 1
1471 # hg update -C 1
1472 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output'
1472 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output'
1473 merging f
1473 merging f
1474 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1474 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1475 (branch merge, don't forget to commit)
1475 (branch merge, don't forget to commit)
1476 $ aftermerge
1476 $ aftermerge
1477 # cat f
1477 # cat f
1478 mergeresult
1478 mergeresult
1479 # hg stat
1479 # hg stat
1480 M f
1480 M f
1481 # hg resolve --list
1481 # hg resolve --list
1482 R f
1482 R f
1483
1483
1484 Merge using tool with a path that must be quoted:
1484 Merge using tool with a path that must be quoted:
1485
1485
1486 $ beforemerge
1486 $ beforemerge
1487 [merge-tools]
1487 [merge-tools]
1488 false.whatever=
1488 false.whatever=
1489 true.priority=1
1489 true.priority=1
1490 true.executable=cat
1490 true.executable=cat
1491 # hg update -C 1
1491 # hg update -C 1
1492 $ cat <<EOF > 'my merge tool'
1492 $ cat <<EOF > 'my merge tool'
1493 > cat "\$1" "\$2" "\$3" > "\$4"
1493 > cat "\$1" "\$2" "\$3" > "\$4"
1494 > EOF
1494 > EOF
1495 $ hg --config merge-tools.true.executable='sh' \
1495 $ hg --config merge-tools.true.executable='sh' \
1496 > --config merge-tools.true.args='"./my merge tool" $base $local $other $output' \
1496 > --config merge-tools.true.args='"./my merge tool" $base $local $other $output' \
1497 > merge -r 2
1497 > merge -r 2
1498 merging f
1498 merging f
1499 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1499 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1500 (branch merge, don't forget to commit)
1500 (branch merge, don't forget to commit)
1501 $ rm -f 'my merge tool'
1501 $ rm -f 'my merge tool'
1502 $ aftermerge
1502 $ aftermerge
1503 # cat f
1503 # cat f
1504 revision 0
1504 revision 0
1505 space
1505 space
1506 revision 1
1506 revision 1
1507 space
1507 space
1508 revision 2
1508 revision 2
1509 space
1509 space
1510 # hg stat
1510 # hg stat
1511 M f
1511 M f
1512 # hg resolve --list
1512 # hg resolve --list
1513 R f
1513 R f
1514
1514
1515 Merge using a tool that supports labellocal, labelother, and labelbase, checking
1515 Merge using a tool that supports labellocal, labelother, and labelbase, checking
1516 that they're quoted properly as well. This is using the default 'basic'
1516 that they're quoted properly as well. This is using the default 'basic'
1517 mergemarkers even though ui.mergemarkers is 'detailed', so it's ignoring both
1517 mergemarkers even though ui.mergemarkers is 'detailed', so it's ignoring both
1518 mergemarkertemplate settings:
1518 mergemarkertemplate settings:
1519
1519
1520 $ beforemerge
1520 $ beforemerge
1521 [merge-tools]
1521 [merge-tools]
1522 false.whatever=
1522 false.whatever=
1523 true.priority=1
1523 true.priority=1
1524 true.executable=cat
1524 true.executable=cat
1525 # hg update -C 1
1525 # hg update -C 1
1526 $ cat <<EOF > printargs_merge_tool
1526 $ cat <<EOF > printargs_merge_tool
1527 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done
1527 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done
1528 > EOF
1528 > EOF
1529 $ hg --config merge-tools.true.executable='sh' \
1529 $ hg --config merge-tools.true.executable='sh' \
1530 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \
1530 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \
1531 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1531 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1532 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1532 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1533 > --config ui.mergemarkers=detailed \
1533 > --config ui.mergemarkers=detailed \
1534 > merge -r 2
1534 > merge -r 2
1535 merging f
1535 merging f
1536 arg: "ll:working copy"
1536 arg: "ll:working copy"
1537 arg: "lo:"
1537 arg: "lo:"
1538 arg: "merge rev"
1538 arg: "merge rev"
1539 arg: "lb:base: */f~base.*" (glob)
1539 arg: "lb:base: */f~base.*" (glob)
1540 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1540 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1541 (branch merge, don't forget to commit)
1541 (branch merge, don't forget to commit)
1542 $ rm -f 'printargs_merge_tool'
1542 $ rm -f 'printargs_merge_tool'
1543
1543
1544 Same test with experimental.mergetempdirprefix set:
1544 Same test with experimental.mergetempdirprefix set:
1545
1545
1546 $ beforemerge
1546 $ beforemerge
1547 [merge-tools]
1547 [merge-tools]
1548 false.whatever=
1548 false.whatever=
1549 true.priority=1
1549 true.priority=1
1550 true.executable=cat
1550 true.executable=cat
1551 # hg update -C 1
1551 # hg update -C 1
1552 $ cat <<EOF > printargs_merge_tool
1552 $ cat <<EOF > printargs_merge_tool
1553 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done
1553 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done
1554 > EOF
1554 > EOF
1555 $ hg --config experimental.mergetempdirprefix=$TESTTMP/hgmerge. \
1555 $ hg --config experimental.mergetempdirprefix=$TESTTMP/hgmerge. \
1556 > --config merge-tools.true.executable='sh' \
1556 > --config merge-tools.true.executable='sh' \
1557 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \
1557 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \
1558 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1558 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1559 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1559 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1560 > --config ui.mergemarkers=detailed \
1560 > --config ui.mergemarkers=detailed \
1561 > merge -r 2
1561 > merge -r 2
1562 merging f
1562 merging f
1563 arg: "ll:working copy"
1563 arg: "ll:working copy"
1564 arg: "lo:"
1564 arg: "lo:"
1565 arg: "merge rev"
1565 arg: "merge rev"
1566 arg: "lb:base: */hgmerge.*/f~base" (glob)
1566 arg: "lb:base: */hgmerge.*/f~base" (glob)
1567 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1567 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1568 (branch merge, don't forget to commit)
1568 (branch merge, don't forget to commit)
1569 $ rm -f 'printargs_merge_tool'
1569 $ rm -f 'printargs_merge_tool'
1570
1570
1571 Merge using a tool that supports labellocal, labelother, and labelbase, checking
1571 Merge using a tool that supports labellocal, labelother, and labelbase, checking
1572 that they're quoted properly as well. This is using 'detailed' mergemarkers,
1572 that they're quoted properly as well. This is using 'detailed' mergemarkers,
1573 even though ui.mergemarkers is 'basic', and using the tool's
1573 even though ui.mergemarkers is 'basic', and using the tool's
1574 mergemarkertemplate:
1574 mergemarkertemplate:
1575
1575
1576 $ beforemerge
1576 $ beforemerge
1577 [merge-tools]
1577 [merge-tools]
1578 false.whatever=
1578 false.whatever=
1579 true.priority=1
1579 true.priority=1
1580 true.executable=cat
1580 true.executable=cat
1581 # hg update -C 1
1581 # hg update -C 1
1582 $ cat <<EOF > printargs_merge_tool
1582 $ cat <<EOF > printargs_merge_tool
1583 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done
1583 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done
1584 > EOF
1584 > EOF
1585 $ hg --config merge-tools.true.executable='sh' \
1585 $ hg --config merge-tools.true.executable='sh' \
1586 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \
1586 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \
1587 > --config merge-tools.true.mergemarkers=detailed \
1587 > --config merge-tools.true.mergemarkers=detailed \
1588 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1588 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1589 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1589 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1590 > --config ui.mergemarkers=basic \
1590 > --config ui.mergemarkers=basic \
1591 > merge -r 2
1591 > merge -r 2
1592 merging f
1592 merging f
1593 arg: "ll:working copy: tooltmpl ef83787e2614"
1593 arg: "ll:working copy: tooltmpl ef83787e2614"
1594 arg: "lo:"
1594 arg: "lo:"
1595 arg: "merge rev: tooltmpl 0185f4e0cf02"
1595 arg: "merge rev: tooltmpl 0185f4e0cf02"
1596 arg: "lb:base: */f~base.*" (glob)
1596 arg: "lb:base: */f~base.*" (glob)
1597 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1597 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1598 (branch merge, don't forget to commit)
1598 (branch merge, don't forget to commit)
1599 $ rm -f 'printargs_merge_tool'
1599 $ rm -f 'printargs_merge_tool'
1600
1600
1601 The merge tool still gets labellocal and labelother as 'basic' even when
1601 The merge tool still gets labellocal and labelother as 'basic' even when
1602 premerge=keep is used and has 'detailed' markers:
1602 premerge=keep is used and has 'detailed' markers:
1603
1603
1604 $ beforemerge
1604 $ beforemerge
1605 [merge-tools]
1605 [merge-tools]
1606 false.whatever=
1606 false.whatever=
1607 true.priority=1
1607 true.priority=1
1608 true.executable=cat
1608 true.executable=cat
1609 # hg update -C 1
1609 # hg update -C 1
1610 $ cat <<EOF > mytool
1610 $ cat <<EOF > mytool
1611 > echo labellocal: \"\$1\"
1611 > echo labellocal: \"\$1\"
1612 > echo labelother: \"\$2\"
1612 > echo labelother: \"\$2\"
1613 > echo "output (arg)": \"\$3\"
1613 > echo "output (arg)": \"\$3\"
1614 > echo "output (contents)":
1614 > echo "output (contents)":
1615 > cat "\$3"
1615 > cat "\$3"
1616 > EOF
1616 > EOF
1617 $ hg --config merge-tools.true.executable='sh' \
1617 $ hg --config merge-tools.true.executable='sh' \
1618 > --config merge-tools.true.args='mytool $labellocal $labelother $output' \
1618 > --config merge-tools.true.args='mytool $labellocal $labelother $output' \
1619 > --config merge-tools.true.premerge=keep \
1619 > --config merge-tools.true.premerge=keep \
1620 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1620 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1621 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1621 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1622 > --config ui.mergemarkers=detailed \
1622 > --config ui.mergemarkers=detailed \
1623 > merge -r 2
1623 > merge -r 2
1624 merging f
1624 merging f
1625 labellocal: "working copy"
1625 labellocal: "working copy"
1626 labelother: "merge rev"
1626 labelother: "merge rev"
1627 output (arg): "$TESTTMP/repo/f"
1627 output (arg): "$TESTTMP/repo/f"
1628 output (contents):
1628 output (contents):
1629 <<<<<<< working copy: uitmpl 1
1629 <<<<<<< working copy: uitmpl 1
1630 revision 1
1630 revision 1
1631 =======
1631 =======
1632 revision 2
1632 revision 2
1633 >>>>>>> merge rev: uitmpl 2
1633 >>>>>>> merge rev: uitmpl 2
1634 space
1634 space
1635 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1635 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1636 (branch merge, don't forget to commit)
1636 (branch merge, don't forget to commit)
1637 $ rm -f 'mytool'
1637 $ rm -f 'mytool'
1638
1638
1639 premerge=keep uses the *tool's* mergemarkertemplate if tool's
1639 premerge=keep uses the *tool's* mergemarkertemplate if tool's
1640 mergemarkers=detailed; labellocal and labelother also use the tool's template
1640 mergemarkers=detailed; labellocal and labelother also use the tool's template
1641
1641
1642 $ beforemerge
1642 $ beforemerge
1643 [merge-tools]
1643 [merge-tools]
1644 false.whatever=
1644 false.whatever=
1645 true.priority=1
1645 true.priority=1
1646 true.executable=cat
1646 true.executable=cat
1647 # hg update -C 1
1647 # hg update -C 1
1648 $ cat <<EOF > mytool
1648 $ cat <<EOF > mytool
1649 > echo labellocal: \"\$1\"
1649 > echo labellocal: \"\$1\"
1650 > echo labelother: \"\$2\"
1650 > echo labelother: \"\$2\"
1651 > echo "output (arg)": \"\$3\"
1651 > echo "output (arg)": \"\$3\"
1652 > echo "output (contents)":
1652 > echo "output (contents)":
1653 > cat "\$3"
1653 > cat "\$3"
1654 > EOF
1654 > EOF
1655 $ hg --config merge-tools.true.executable='sh' \
1655 $ hg --config merge-tools.true.executable='sh' \
1656 > --config merge-tools.true.args='mytool $labellocal $labelother $output' \
1656 > --config merge-tools.true.args='mytool $labellocal $labelother $output' \
1657 > --config merge-tools.true.premerge=keep \
1657 > --config merge-tools.true.premerge=keep \
1658 > --config merge-tools.true.mergemarkers=detailed \
1658 > --config merge-tools.true.mergemarkers=detailed \
1659 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1659 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1660 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1660 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1661 > --config ui.mergemarkers=detailed \
1661 > --config ui.mergemarkers=detailed \
1662 > merge -r 2
1662 > merge -r 2
1663 merging f
1663 merging f
1664 labellocal: "working copy: tooltmpl ef83787e2614"
1664 labellocal: "working copy: tooltmpl ef83787e2614"
1665 labelother: "merge rev: tooltmpl 0185f4e0cf02"
1665 labelother: "merge rev: tooltmpl 0185f4e0cf02"
1666 output (arg): "$TESTTMP/repo/f"
1666 output (arg): "$TESTTMP/repo/f"
1667 output (contents):
1667 output (contents):
1668 <<<<<<< working copy: tooltmpl ef83787e2614
1668 <<<<<<< working copy: tooltmpl ef83787e2614
1669 revision 1
1669 revision 1
1670 =======
1670 =======
1671 revision 2
1671 revision 2
1672 >>>>>>> merge rev: tooltmpl 0185f4e0cf02
1672 >>>>>>> merge rev: tooltmpl 0185f4e0cf02
1673 space
1673 space
1674 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1674 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1675 (branch merge, don't forget to commit)
1675 (branch merge, don't forget to commit)
1676 $ rm -f 'mytool'
1676 $ rm -f 'mytool'
1677
1677
1678 Issue3581: Merging a filename that needs to be quoted
1678 Issue3581: Merging a filename that needs to be quoted
1679 (This test doesn't work on Windows filesystems even on Linux, so check
1679 (This test doesn't work on Windows filesystems even on Linux, so check
1680 for Unix-like permission)
1680 for Unix-like permission)
1681
1681
1682 #if unix-permissions
1682 #if unix-permissions
1683 $ beforemerge
1683 $ beforemerge
1684 [merge-tools]
1684 [merge-tools]
1685 false.whatever=
1685 false.whatever=
1686 true.priority=1
1686 true.priority=1
1687 true.executable=cat
1687 true.executable=cat
1688 # hg update -C 1
1688 # hg update -C 1
1689 $ echo "revision 5" > '"; exit 1; echo "'
1689 $ echo "revision 5" > '"; exit 1; echo "'
1690 $ hg commit -Am "revision 5"
1690 $ hg commit -Am "revision 5"
1691 adding "; exit 1; echo "
1691 adding "; exit 1; echo "
1692 warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "'
1692 warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "'
1693 $ hg update -C 1 > /dev/null
1693 $ hg update -C 1 > /dev/null
1694 $ echo "revision 6" > '"; exit 1; echo "'
1694 $ echo "revision 6" > '"; exit 1; echo "'
1695 $ hg commit -Am "revision 6"
1695 $ hg commit -Am "revision 6"
1696 adding "; exit 1; echo "
1696 adding "; exit 1; echo "
1697 warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "'
1697 warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "'
1698 created new head
1698 created new head
1699 $ hg merge --config merge-tools.true.executable="true" -r 5
1699 $ hg merge --config merge-tools.true.executable="true" -r 5
1700 merging "; exit 1; echo "
1700 merging "; exit 1; echo "
1701 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1701 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1702 (branch merge, don't forget to commit)
1702 (branch merge, don't forget to commit)
1703 $ hg update -C 1 > /dev/null
1703 $ hg update -C 1 > /dev/null
1704 #endif
1704 #endif
1705
1705
1706 Merge post-processing
1706 Merge post-processing
1707
1707
1708 cat is a bad merge-tool and doesn't change:
1708 cat is a bad merge-tool and doesn't change:
1709
1709
1710 $ beforemerge
1710 $ beforemerge
1711 [merge-tools]
1711 [merge-tools]
1712 false.whatever=
1712 false.whatever=
1713 true.priority=1
1713 true.priority=1
1714 true.executable=cat
1714 true.executable=cat
1715 # hg update -C 1
1715 # hg update -C 1
1716 $ hg merge -y -r 2 --config merge-tools.true.checkchanged=1
1716 $ hg merge -y -r 2 --config merge-tools.true.checkchanged=1
1717 merging f
1717 merging f
1718 revision 1
1718 revision 1
1719 space
1719 space
1720 revision 0
1720 revision 0
1721 space
1721 space
1722 revision 2
1722 revision 2
1723 space
1723 space
1724 output file f appears unchanged
1724 output file f appears unchanged
1725 was merge successful (yn)? n
1725 was merge successful (yn)? n
1726 merging f failed!
1726 merging f failed!
1727 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1727 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1728 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1728 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1729 [1]
1729 [1]
1730 $ aftermerge
1730 $ aftermerge
1731 # cat f
1731 # cat f
1732 revision 1
1732 revision 1
1733 space
1733 space
1734 # hg stat
1734 # hg stat
1735 M f
1735 M f
1736 ? f.orig
1736 ? f.orig
1737 # hg resolve --list
1737 # hg resolve --list
1738 U f
1738 U f
1739
1739
1740 missingbinary is a merge-tool that doesn't exist:
1741
1742 $ echo "missingbinary.executable=doesnotexist" >> .hg/hgrc
1743 $ beforemerge
1744 [merge-tools]
1745 false.whatever=
1746 true.priority=1
1747 true.executable=cat
1748 missingbinary.executable=doesnotexist
1749 # hg update -C 1
1750 $ hg merge -y -r 2 --config ui.merge=missingbinary
1751 merging f
1752 revision 1
1753 space
1754 revision 0
1755 space
1756 revision 2
1757 space
1758 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1759 (branch merge, don't forget to commit)
1760
1740 #if symlink
1761 #if symlink
1741
1762
1742 internal merge cannot handle symlinks and shouldn't try:
1763 internal merge cannot handle symlinks and shouldn't try:
1743
1764
1744 $ hg update -q -C 1
1765 $ hg update -q -C 1
1745 $ rm f
1766 $ rm f
1746 $ ln -s symlink f
1767 $ ln -s symlink f
1747 $ hg commit -qm 'f is symlink'
1768 $ hg commit -qm 'f is symlink'
1748 $ hg merge -r 2 --tool internal:merge
1769 $ hg merge -r 2 --tool internal:merge
1749 merging f
1770 merging f
1750 warning: internal :merge cannot merge symlinks for f
1771 warning: internal :merge cannot merge symlinks for f
1751 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
1772 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
1752 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1773 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1753 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1774 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1754 [1]
1775 [1]
1755
1776
1756 #endif
1777 #endif
1757
1778
1758 Verify naming of temporary files and that extension is preserved:
1779 Verify naming of temporary files and that extension is preserved:
1759
1780
1760 $ hg update -q -C 1
1781 $ hg update -q -C 1
1761 $ hg mv f f.txt
1782 $ hg mv f f.txt
1762 $ hg ci -qm "f.txt"
1783 $ hg ci -qm "f.txt"
1763 $ hg update -q -C 2
1784 $ hg update -q -C 2
1764 $ hg merge -y -r tip --tool echo --config merge-tools.echo.args='$base $local $other $output'
1785 $ hg merge -y -r tip --tool echo --config merge-tools.echo.args='$base $local $other $output'
1765 merging f and f.txt to f.txt
1786 merging f and f.txt to f.txt
1766 */f~base.* */f~local.*.txt */f~other.*.txt $TESTTMP/repo/f.txt (glob)
1787 */f~base.* */f~local.*.txt */f~other.*.txt $TESTTMP/repo/f.txt (glob)
1767 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1788 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1768 (branch merge, don't forget to commit)
1789 (branch merge, don't forget to commit)
1769
1790
1770 Verify naming of temporary files and that extension is preserved
1791 Verify naming of temporary files and that extension is preserved
1771 (experimental.mergetempdirprefix version):
1792 (experimental.mergetempdirprefix version):
1772
1793
1773 $ hg update -q -C 1
1794 $ hg update -q -C 1
1774 $ hg mv f f.txt
1795 $ hg mv f f.txt
1775 $ hg ci -qm "f.txt"
1796 $ hg ci -qm "f.txt"
1776 $ hg update -q -C 2
1797 $ hg update -q -C 2
1777 $ hg merge -y -r tip --tool echo \
1798 $ hg merge -y -r tip --tool echo \
1778 > --config merge-tools.echo.args='$base $local $other $output' \
1799 > --config merge-tools.echo.args='$base $local $other $output' \
1779 > --config experimental.mergetempdirprefix=$TESTTMP/hgmerge.
1800 > --config experimental.mergetempdirprefix=$TESTTMP/hgmerge.
1780 merging f and f.txt to f.txt
1801 merging f and f.txt to f.txt
1781 $TESTTMP/hgmerge.*/f~base $TESTTMP/hgmerge.*/f~local.txt $TESTTMP/hgmerge.*/f~other.txt $TESTTMP/repo/f.txt (glob)
1802 $TESTTMP/hgmerge.*/f~base $TESTTMP/hgmerge.*/f~local.txt $TESTTMP/hgmerge.*/f~other.txt $TESTTMP/repo/f.txt (glob)
1782 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1803 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1783 (branch merge, don't forget to commit)
1804 (branch merge, don't forget to commit)
1784
1805
1785 Check that debugpicktool examines which merge tool is chosen for
1806 Check that debugpicktool examines which merge tool is chosen for
1786 specified file as expected
1807 specified file as expected
1787
1808
1788 $ beforemerge
1809 $ beforemerge
1789 [merge-tools]
1810 [merge-tools]
1790 false.whatever=
1811 false.whatever=
1791 true.priority=1
1812 true.priority=1
1792 true.executable=cat
1813 true.executable=cat
1814 missingbinary.executable=doesnotexist
1793 # hg update -C 1
1815 # hg update -C 1
1794
1816
1795 (default behavior: checking files in the working parent context)
1817 (default behavior: checking files in the working parent context)
1796
1818
1797 $ hg manifest
1819 $ hg manifest
1798 f
1820 f
1799 $ hg debugpickmergetool
1821 $ hg debugpickmergetool
1800 f = true
1822 f = true
1801
1823
1802 (-X/-I and file patterns limmit examination targets)
1824 (-X/-I and file patterns limmit examination targets)
1803
1825
1804 $ hg debugpickmergetool -X f
1826 $ hg debugpickmergetool -X f
1805 $ hg debugpickmergetool unknown
1827 $ hg debugpickmergetool unknown
1806 unknown: no such file in rev ef83787e2614
1828 unknown: no such file in rev ef83787e2614
1807
1829
1808 (--changedelete emulates merging change and delete)
1830 (--changedelete emulates merging change and delete)
1809
1831
1810 $ hg debugpickmergetool --changedelete
1832 $ hg debugpickmergetool --changedelete
1811 f = :prompt
1833 f = :prompt
1812
1834
1813 (-r REV causes checking files in specified revision)
1835 (-r REV causes checking files in specified revision)
1814
1836
1815 $ hg manifest -r tip
1837 $ hg manifest -r tip
1816 f.txt
1838 f.txt
1817 $ hg debugpickmergetool -r tip
1839 $ hg debugpickmergetool -r tip
1818 f.txt = true
1840 f.txt = true
1819
1841
1820 #if symlink
1842 #if symlink
1821
1843
1822 (symlink causes chosing :prompt)
1844 (symlink causes chosing :prompt)
1823
1845
1824 $ hg debugpickmergetool -r 6d00b3726f6e
1846 $ hg debugpickmergetool -r 6d00b3726f6e
1825 f = :prompt
1847 f = :prompt
1826
1848
1827 #endif
1849 #endif
1828
1850
1829 (--verbose shows some configurations)
1851 (--verbose shows some configurations)
1830
1852
1831 $ hg debugpickmergetool --tool foobar -v
1853 $ hg debugpickmergetool --tool foobar -v
1832 with --tool 'foobar'
1854 with --tool 'foobar'
1833 f = foobar
1855 f = foobar
1834
1856
1835 $ HGMERGE=false hg debugpickmergetool -v
1857 $ HGMERGE=false hg debugpickmergetool -v
1836 with HGMERGE='false'
1858 with HGMERGE='false'
1837 f = false
1859 f = false
1838
1860
1839 $ hg debugpickmergetool --config ui.merge=false -v
1861 $ hg debugpickmergetool --config ui.merge=false -v
1840 with ui.merge='false'
1862 with ui.merge='false'
1841 f = false
1863 f = false
1842
1864
1843 (--debug shows errors detected intermediately)
1865 (--debug shows errors detected intermediately)
1844
1866
1845 $ hg debugpickmergetool --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool --debug f
1867 $ hg debugpickmergetool --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool --debug f
1846 couldn't find merge tool true (for pattern f)
1868 couldn't find merge tool true (for pattern f)
1847 couldn't find merge tool true
1869 couldn't find merge tool true
1848 f = false
1870 f = false
1849
1871
1850 $ cd ..
1872 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now