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