##// END OF EJS Templates
test: don't put $BINDIR in $PATH for test-merge-tools.t...
Julien Cristau -
r44171:558f7585 stable
parent child Browse files
Show More
@@ -1,2088 +1,2088
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="/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`:/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`:/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 file 'f' needs to be resolved.
716 file 'f' needs to be resolved.
717 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
717 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
718 What do you want to do? u
718 What do you want to do? u
719 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
719 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
720 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
720 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
721 [1]
721 [1]
722 $ aftermerge
722 $ aftermerge
723 # cat f
723 # cat f
724 revision 1
724 revision 1
725 space
725 space
726 # hg stat
726 # hg stat
727 M f
727 M f
728 # hg resolve --list
728 # hg resolve --list
729 U f
729 U f
730
730
731 ui.merge specifies :prompt, with 'leave unresolved' chosen
731 ui.merge specifies :prompt, with 'leave unresolved' chosen
732
732
733 $ beforemerge
733 $ beforemerge
734 [merge-tools]
734 [merge-tools]
735 false.whatever=
735 false.whatever=
736 true.priority=1
736 true.priority=1
737 true.executable=cat
737 true.executable=cat
738 # hg update -C 1
738 # hg update -C 1
739 $ hg merge -r 2 --config ui.merge=:prompt --config ui.interactive=True << EOF
739 $ hg merge -r 2 --config ui.merge=:prompt --config ui.interactive=True << EOF
740 > u
740 > u
741 > EOF
741 > EOF
742 file 'f' needs to be resolved.
742 file 'f' needs to be resolved.
743 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
743 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
744 What do you want to do? u
744 What do you want to do? u
745 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
745 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
746 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
746 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
747 [1]
747 [1]
748 $ aftermerge
748 $ aftermerge
749 # cat f
749 # cat f
750 revision 1
750 revision 1
751 space
751 space
752 # hg stat
752 # hg stat
753 M f
753 M f
754 # hg resolve --list
754 # hg resolve --list
755 U f
755 U f
756
756
757 prompt with EOF
757 prompt with EOF
758
758
759 $ beforemerge
759 $ beforemerge
760 [merge-tools]
760 [merge-tools]
761 false.whatever=
761 false.whatever=
762 true.priority=1
762 true.priority=1
763 true.executable=cat
763 true.executable=cat
764 # hg update -C 1
764 # hg update -C 1
765 $ hg merge -r 2 --config ui.merge=internal:prompt --config ui.interactive=true
765 $ hg merge -r 2 --config ui.merge=internal:prompt --config ui.interactive=true
766 file 'f' needs to be resolved.
766 file 'f' needs to be resolved.
767 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
767 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
768 What do you want to do?
768 What do you want to do?
769 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
769 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
770 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
770 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
771 [1]
771 [1]
772 $ aftermerge
772 $ aftermerge
773 # cat f
773 # cat f
774 revision 1
774 revision 1
775 space
775 space
776 # hg stat
776 # hg stat
777 M f
777 M f
778 # hg resolve --list
778 # hg resolve --list
779 U f
779 U f
780 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true
780 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true
781 file 'f' needs to be resolved.
781 file 'f' needs to be resolved.
782 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
782 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
783 What do you want to do?
783 What do you want to do?
784 [1]
784 [1]
785 $ aftermerge
785 $ aftermerge
786 # cat f
786 # cat f
787 revision 1
787 revision 1
788 space
788 space
789 # hg stat
789 # hg stat
790 M f
790 M f
791 ? f.orig
791 ? f.orig
792 # hg resolve --list
792 # hg resolve --list
793 U f
793 U f
794 $ rm f
794 $ rm f
795 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true
795 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true
796 file 'f' needs to be resolved.
796 file 'f' needs to be resolved.
797 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
797 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
798 What do you want to do?
798 What do you want to do?
799 [1]
799 [1]
800 $ aftermerge
800 $ aftermerge
801 # cat f
801 # cat f
802 revision 1
802 revision 1
803 space
803 space
804 # hg stat
804 # hg stat
805 M f
805 M f
806 # hg resolve --list
806 # hg resolve --list
807 U f
807 U f
808 $ hg resolve --all --config ui.merge=internal:prompt
808 $ hg resolve --all --config ui.merge=internal:prompt
809 file 'f' needs to be resolved.
809 file 'f' needs to be resolved.
810 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
810 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
811 What do you want to do? u
811 What do you want to do? u
812 [1]
812 [1]
813 $ aftermerge
813 $ aftermerge
814 # cat f
814 # cat f
815 revision 1
815 revision 1
816 space
816 space
817 # hg stat
817 # hg stat
818 M f
818 M f
819 ? f.orig
819 ? f.orig
820 # hg resolve --list
820 # hg resolve --list
821 U f
821 U f
822
822
823 ui.merge specifies internal:dump:
823 ui.merge specifies internal:dump:
824
824
825 $ beforemerge
825 $ beforemerge
826 [merge-tools]
826 [merge-tools]
827 false.whatever=
827 false.whatever=
828 true.priority=1
828 true.priority=1
829 true.executable=cat
829 true.executable=cat
830 # hg update -C 1
830 # hg update -C 1
831 $ hg merge -r 2 --config ui.merge=internal:dump
831 $ hg merge -r 2 --config ui.merge=internal:dump
832 merging f
832 merging f
833 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
833 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
834 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
834 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
835 [1]
835 [1]
836 $ aftermerge
836 $ aftermerge
837 # cat f
837 # cat f
838 revision 1
838 revision 1
839 space
839 space
840 # hg stat
840 # hg stat
841 M f
841 M f
842 ? f.base
842 ? f.base
843 ? f.local
843 ? f.local
844 ? f.orig
844 ? f.orig
845 ? f.other
845 ? f.other
846 # hg resolve --list
846 # hg resolve --list
847 U f
847 U f
848
848
849 f.base:
849 f.base:
850
850
851 $ cat f.base
851 $ cat f.base
852 revision 0
852 revision 0
853 space
853 space
854
854
855 f.local:
855 f.local:
856
856
857 $ cat f.local
857 $ cat f.local
858 revision 1
858 revision 1
859 space
859 space
860
860
861 f.other:
861 f.other:
862
862
863 $ cat f.other
863 $ cat f.other
864 revision 2
864 revision 2
865 space
865 space
866 $ rm f.base f.local f.other
866 $ rm f.base f.local f.other
867
867
868 check that internal:dump doesn't dump files if premerge runs
868 check that internal:dump doesn't dump files if premerge runs
869 successfully
869 successfully
870
870
871 $ beforemerge
871 $ beforemerge
872 [merge-tools]
872 [merge-tools]
873 false.whatever=
873 false.whatever=
874 true.priority=1
874 true.priority=1
875 true.executable=cat
875 true.executable=cat
876 # hg update -C 1
876 # hg update -C 1
877 $ hg merge -r 3 --config ui.merge=internal:dump
877 $ hg merge -r 3 --config ui.merge=internal:dump
878 merging f
878 merging f
879 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
879 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
880 (branch merge, don't forget to commit)
880 (branch merge, don't forget to commit)
881
881
882 $ aftermerge
882 $ aftermerge
883 # cat f
883 # cat f
884 revision 1
884 revision 1
885 space
885 space
886 revision 3
886 revision 3
887 # hg stat
887 # hg stat
888 M f
888 M f
889 # hg resolve --list
889 # hg resolve --list
890 R f
890 R f
891
891
892 check that internal:forcedump dumps files, even if local and other can
892 check that internal:forcedump dumps files, even if local and other can
893 be merged easily
893 be merged easily
894
894
895 $ beforemerge
895 $ beforemerge
896 [merge-tools]
896 [merge-tools]
897 false.whatever=
897 false.whatever=
898 true.priority=1
898 true.priority=1
899 true.executable=cat
899 true.executable=cat
900 # hg update -C 1
900 # hg update -C 1
901 $ hg merge -r 3 --config ui.merge=internal:forcedump
901 $ hg merge -r 3 --config ui.merge=internal:forcedump
902 merging f
902 merging f
903 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
903 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
904 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
904 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
905 [1]
905 [1]
906 $ aftermerge
906 $ aftermerge
907 # cat f
907 # cat f
908 revision 1
908 revision 1
909 space
909 space
910 # hg stat
910 # hg stat
911 M f
911 M f
912 ? f.base
912 ? f.base
913 ? f.local
913 ? f.local
914 ? f.orig
914 ? f.orig
915 ? f.other
915 ? f.other
916 # hg resolve --list
916 # hg resolve --list
917 U f
917 U f
918
918
919 $ cat f.base
919 $ cat f.base
920 revision 0
920 revision 0
921 space
921 space
922
922
923 $ cat f.local
923 $ cat f.local
924 revision 1
924 revision 1
925 space
925 space
926
926
927 $ cat f.other
927 $ cat f.other
928 revision 0
928 revision 0
929 space
929 space
930 revision 3
930 revision 3
931
931
932 $ rm -f f.base f.local f.other
932 $ rm -f f.base f.local f.other
933
933
934 ui.merge specifies internal:other but is overruled by pattern for false:
934 ui.merge specifies internal:other but is overruled by pattern for false:
935
935
936 $ beforemerge
936 $ beforemerge
937 [merge-tools]
937 [merge-tools]
938 false.whatever=
938 false.whatever=
939 true.priority=1
939 true.priority=1
940 true.executable=cat
940 true.executable=cat
941 # hg update -C 1
941 # hg update -C 1
942 $ hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
942 $ hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
943 merging f
943 merging f
944 merging f failed!
944 merging f failed!
945 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
945 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
946 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
946 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
947 [1]
947 [1]
948 $ aftermerge
948 $ aftermerge
949 # cat f
949 # cat f
950 revision 1
950 revision 1
951 space
951 space
952 # hg stat
952 # hg stat
953 M f
953 M f
954 ? f.orig
954 ? f.orig
955 # hg resolve --list
955 # hg resolve --list
956 U f
956 U f
957
957
958 Premerge
958 Premerge
959
959
960 ui.merge specifies internal:other but is overruled by --tool=false
960 ui.merge specifies internal:other but is overruled by --tool=false
961
961
962 $ beforemerge
962 $ beforemerge
963 [merge-tools]
963 [merge-tools]
964 false.whatever=
964 false.whatever=
965 true.priority=1
965 true.priority=1
966 true.executable=cat
966 true.executable=cat
967 # hg update -C 1
967 # hg update -C 1
968 $ hg merge -r 2 --config ui.merge=internal:other --tool=false
968 $ hg merge -r 2 --config ui.merge=internal:other --tool=false
969 merging f
969 merging f
970 merging f failed!
970 merging f failed!
971 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
971 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
972 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
972 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
973 [1]
973 [1]
974 $ aftermerge
974 $ aftermerge
975 # cat f
975 # cat f
976 revision 1
976 revision 1
977 space
977 space
978 # hg stat
978 # hg stat
979 M f
979 M f
980 ? f.orig
980 ? f.orig
981 # hg resolve --list
981 # hg resolve --list
982 U f
982 U f
983
983
984 HGMERGE specifies internal:other but is overruled by --tool=false
984 HGMERGE specifies internal:other but is overruled by --tool=false
985
985
986 $ HGMERGE=internal:other ; export HGMERGE
986 $ HGMERGE=internal:other ; export HGMERGE
987 $ beforemerge
987 $ beforemerge
988 [merge-tools]
988 [merge-tools]
989 false.whatever=
989 false.whatever=
990 true.priority=1
990 true.priority=1
991 true.executable=cat
991 true.executable=cat
992 # hg update -C 1
992 # hg update -C 1
993 $ hg merge -r 2 --tool=false
993 $ hg merge -r 2 --tool=false
994 merging f
994 merging f
995 merging f failed!
995 merging f failed!
996 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
996 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
997 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
997 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
998 [1]
998 [1]
999 $ aftermerge
999 $ aftermerge
1000 # cat f
1000 # cat f
1001 revision 1
1001 revision 1
1002 space
1002 space
1003 # hg stat
1003 # hg stat
1004 M f
1004 M f
1005 ? f.orig
1005 ? f.orig
1006 # hg resolve --list
1006 # hg resolve --list
1007 U f
1007 U f
1008
1008
1009 $ unset HGMERGE # make sure HGMERGE doesn't interfere with remaining tests
1009 $ unset HGMERGE # make sure HGMERGE doesn't interfere with remaining tests
1010
1010
1011 update is a merge ...
1011 update is a merge ...
1012
1012
1013 (this also tests that files reverted with '--rev REV' are treated as
1013 (this also tests that files reverted with '--rev REV' are treated as
1014 "modified", even if none of mode, size and timestamp of them isn't
1014 "modified", even if none of mode, size and timestamp of them isn't
1015 changed on the filesystem (see also issue4583))
1015 changed on the filesystem (see also issue4583))
1016
1016
1017 $ cat >> $HGRCPATH <<EOF
1017 $ cat >> $HGRCPATH <<EOF
1018 > [fakedirstatewritetime]
1018 > [fakedirstatewritetime]
1019 > # emulate invoking dirstate.write() via repo.status()
1019 > # emulate invoking dirstate.write() via repo.status()
1020 > # at 2000-01-01 00:00
1020 > # at 2000-01-01 00:00
1021 > fakenow = 200001010000
1021 > fakenow = 200001010000
1022 > EOF
1022 > EOF
1023
1023
1024 $ beforemerge
1024 $ beforemerge
1025 [merge-tools]
1025 [merge-tools]
1026 false.whatever=
1026 false.whatever=
1027 true.priority=1
1027 true.priority=1
1028 true.executable=cat
1028 true.executable=cat
1029 # hg update -C 1
1029 # hg update -C 1
1030 $ hg update -q 0
1030 $ hg update -q 0
1031 $ f -s f
1031 $ f -s f
1032 f: size=17
1032 f: size=17
1033 $ touch -t 200001010000 f
1033 $ touch -t 200001010000 f
1034 $ hg debugrebuildstate
1034 $ hg debugrebuildstate
1035 $ cat >> $HGRCPATH <<EOF
1035 $ cat >> $HGRCPATH <<EOF
1036 > [extensions]
1036 > [extensions]
1037 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
1037 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
1038 > EOF
1038 > EOF
1039 $ hg revert -q -r 1 .
1039 $ hg revert -q -r 1 .
1040 $ cat >> $HGRCPATH <<EOF
1040 $ cat >> $HGRCPATH <<EOF
1041 > [extensions]
1041 > [extensions]
1042 > fakedirstatewritetime = !
1042 > fakedirstatewritetime = !
1043 > EOF
1043 > EOF
1044 $ f -s f
1044 $ f -s f
1045 f: size=17
1045 f: size=17
1046 $ touch -t 200001010000 f
1046 $ touch -t 200001010000 f
1047 $ hg status f
1047 $ hg status f
1048 M f
1048 M f
1049 $ hg update -r 2
1049 $ hg update -r 2
1050 merging f
1050 merging f
1051 revision 1
1051 revision 1
1052 space
1052 space
1053 revision 0
1053 revision 0
1054 space
1054 space
1055 revision 2
1055 revision 2
1056 space
1056 space
1057 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1057 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1058 $ aftermerge
1058 $ aftermerge
1059 # cat f
1059 # cat f
1060 revision 1
1060 revision 1
1061 space
1061 space
1062 # hg stat
1062 # hg stat
1063 M f
1063 M f
1064 # hg resolve --list
1064 # hg resolve --list
1065 R f
1065 R f
1066
1066
1067 update should also have --tool
1067 update should also have --tool
1068
1068
1069 $ beforemerge
1069 $ beforemerge
1070 [merge-tools]
1070 [merge-tools]
1071 false.whatever=
1071 false.whatever=
1072 true.priority=1
1072 true.priority=1
1073 true.executable=cat
1073 true.executable=cat
1074 # hg update -C 1
1074 # hg update -C 1
1075 $ hg update -q 0
1075 $ hg update -q 0
1076 $ f -s f
1076 $ f -s f
1077 f: size=17
1077 f: size=17
1078 $ touch -t 200001010000 f
1078 $ touch -t 200001010000 f
1079 $ hg debugrebuildstate
1079 $ hg debugrebuildstate
1080 $ cat >> $HGRCPATH <<EOF
1080 $ cat >> $HGRCPATH <<EOF
1081 > [extensions]
1081 > [extensions]
1082 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
1082 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
1083 > EOF
1083 > EOF
1084 $ hg revert -q -r 1 .
1084 $ hg revert -q -r 1 .
1085 $ cat >> $HGRCPATH <<EOF
1085 $ cat >> $HGRCPATH <<EOF
1086 > [extensions]
1086 > [extensions]
1087 > fakedirstatewritetime = !
1087 > fakedirstatewritetime = !
1088 > EOF
1088 > EOF
1089 $ f -s f
1089 $ f -s f
1090 f: size=17
1090 f: size=17
1091 $ touch -t 200001010000 f
1091 $ touch -t 200001010000 f
1092 $ hg status f
1092 $ hg status f
1093 M f
1093 M f
1094 $ hg update -r 2 --tool false
1094 $ hg update -r 2 --tool false
1095 merging f
1095 merging f
1096 merging f failed!
1096 merging f failed!
1097 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1097 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1098 use 'hg resolve' to retry unresolved file merges
1098 use 'hg resolve' to retry unresolved file merges
1099 [1]
1099 [1]
1100 $ aftermerge
1100 $ aftermerge
1101 # cat f
1101 # cat f
1102 revision 1
1102 revision 1
1103 space
1103 space
1104 # hg stat
1104 # hg stat
1105 M f
1105 M f
1106 ? f.orig
1106 ? f.orig
1107 # hg resolve --list
1107 # hg resolve --list
1108 U f
1108 U f
1109
1109
1110 Default is silent simplemerge:
1110 Default is silent simplemerge:
1111
1111
1112 $ beforemerge
1112 $ beforemerge
1113 [merge-tools]
1113 [merge-tools]
1114 false.whatever=
1114 false.whatever=
1115 true.priority=1
1115 true.priority=1
1116 true.executable=cat
1116 true.executable=cat
1117 # hg update -C 1
1117 # hg update -C 1
1118 $ hg merge -r 3
1118 $ hg merge -r 3
1119 merging f
1119 merging f
1120 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1120 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1121 (branch merge, don't forget to commit)
1121 (branch merge, don't forget to commit)
1122 $ aftermerge
1122 $ aftermerge
1123 # cat f
1123 # cat f
1124 revision 1
1124 revision 1
1125 space
1125 space
1126 revision 3
1126 revision 3
1127 # hg stat
1127 # hg stat
1128 M f
1128 M f
1129 # hg resolve --list
1129 # hg resolve --list
1130 R f
1130 R f
1131
1131
1132 .premerge=True is same:
1132 .premerge=True is same:
1133
1133
1134 $ beforemerge
1134 $ beforemerge
1135 [merge-tools]
1135 [merge-tools]
1136 false.whatever=
1136 false.whatever=
1137 true.priority=1
1137 true.priority=1
1138 true.executable=cat
1138 true.executable=cat
1139 # hg update -C 1
1139 # hg update -C 1
1140 $ hg merge -r 3 --config merge-tools.true.premerge=True
1140 $ hg merge -r 3 --config merge-tools.true.premerge=True
1141 merging f
1141 merging f
1142 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1142 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1143 (branch merge, don't forget to commit)
1143 (branch merge, don't forget to commit)
1144 $ aftermerge
1144 $ aftermerge
1145 # cat f
1145 # cat f
1146 revision 1
1146 revision 1
1147 space
1147 space
1148 revision 3
1148 revision 3
1149 # hg stat
1149 # hg stat
1150 M f
1150 M f
1151 # hg resolve --list
1151 # hg resolve --list
1152 R f
1152 R f
1153
1153
1154 .premerge=False executes merge-tool:
1154 .premerge=False executes merge-tool:
1155
1155
1156 $ beforemerge
1156 $ beforemerge
1157 [merge-tools]
1157 [merge-tools]
1158 false.whatever=
1158 false.whatever=
1159 true.priority=1
1159 true.priority=1
1160 true.executable=cat
1160 true.executable=cat
1161 # hg update -C 1
1161 # hg update -C 1
1162 $ hg merge -r 3 --config merge-tools.true.premerge=False
1162 $ hg merge -r 3 --config merge-tools.true.premerge=False
1163 merging f
1163 merging f
1164 revision 1
1164 revision 1
1165 space
1165 space
1166 revision 0
1166 revision 0
1167 space
1167 space
1168 revision 0
1168 revision 0
1169 space
1169 space
1170 revision 3
1170 revision 3
1171 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1171 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1172 (branch merge, don't forget to commit)
1172 (branch merge, don't forget to commit)
1173 $ aftermerge
1173 $ aftermerge
1174 # cat f
1174 # cat f
1175 revision 1
1175 revision 1
1176 space
1176 space
1177 # hg stat
1177 # hg stat
1178 M f
1178 M f
1179 # hg resolve --list
1179 # hg resolve --list
1180 R f
1180 R f
1181
1181
1182 premerge=keep keeps conflict markers in:
1182 premerge=keep keeps conflict markers in:
1183
1183
1184 $ beforemerge
1184 $ beforemerge
1185 [merge-tools]
1185 [merge-tools]
1186 false.whatever=
1186 false.whatever=
1187 true.priority=1
1187 true.priority=1
1188 true.executable=cat
1188 true.executable=cat
1189 # hg update -C 1
1189 # hg update -C 1
1190 $ hg merge -r 4 --config merge-tools.true.premerge=keep
1190 $ hg merge -r 4 --config merge-tools.true.premerge=keep
1191 merging f
1191 merging f
1192 <<<<<<< working copy: ef83787e2614 - test: revision 1
1192 <<<<<<< working copy: ef83787e2614 - test: revision 1
1193 revision 1
1193 revision 1
1194 space
1194 space
1195 =======
1195 =======
1196 revision 4
1196 revision 4
1197 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1197 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1198 revision 0
1198 revision 0
1199 space
1199 space
1200 revision 4
1200 revision 4
1201 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1201 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1202 (branch merge, don't forget to commit)
1202 (branch merge, don't forget to commit)
1203 $ aftermerge
1203 $ aftermerge
1204 # cat f
1204 # cat f
1205 <<<<<<< working copy: ef83787e2614 - test: revision 1
1205 <<<<<<< working copy: ef83787e2614 - test: revision 1
1206 revision 1
1206 revision 1
1207 space
1207 space
1208 =======
1208 =======
1209 revision 4
1209 revision 4
1210 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1210 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1211 # hg stat
1211 # hg stat
1212 M f
1212 M f
1213 # hg resolve --list
1213 # hg resolve --list
1214 R f
1214 R f
1215
1215
1216 premerge=keep-merge3 keeps conflict markers with base content:
1216 premerge=keep-merge3 keeps conflict markers with base content:
1217
1217
1218 $ beforemerge
1218 $ beforemerge
1219 [merge-tools]
1219 [merge-tools]
1220 false.whatever=
1220 false.whatever=
1221 true.priority=1
1221 true.priority=1
1222 true.executable=cat
1222 true.executable=cat
1223 # hg update -C 1
1223 # hg update -C 1
1224 $ hg merge -r 4 --config merge-tools.true.premerge=keep-merge3
1224 $ hg merge -r 4 --config merge-tools.true.premerge=keep-merge3
1225 merging f
1225 merging f
1226 <<<<<<< working copy: ef83787e2614 - test: revision 1
1226 <<<<<<< working copy: ef83787e2614 - test: revision 1
1227 revision 1
1227 revision 1
1228 space
1228 space
1229 ||||||| base
1229 ||||||| base
1230 revision 0
1230 revision 0
1231 space
1231 space
1232 =======
1232 =======
1233 revision 4
1233 revision 4
1234 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1234 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1235 revision 0
1235 revision 0
1236 space
1236 space
1237 revision 4
1237 revision 4
1238 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1238 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1239 (branch merge, don't forget to commit)
1239 (branch merge, don't forget to commit)
1240 $ aftermerge
1240 $ aftermerge
1241 # cat f
1241 # cat f
1242 <<<<<<< working copy: ef83787e2614 - test: revision 1
1242 <<<<<<< working copy: ef83787e2614 - test: revision 1
1243 revision 1
1243 revision 1
1244 space
1244 space
1245 ||||||| base
1245 ||||||| base
1246 revision 0
1246 revision 0
1247 space
1247 space
1248 =======
1248 =======
1249 revision 4
1249 revision 4
1250 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1250 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1251 # hg stat
1251 # hg stat
1252 M f
1252 M f
1253 # hg resolve --list
1253 # hg resolve --list
1254 R f
1254 R f
1255
1255
1256 premerge=keep respects ui.mergemarkers=basic:
1256 premerge=keep respects ui.mergemarkers=basic:
1257
1257
1258 $ beforemerge
1258 $ beforemerge
1259 [merge-tools]
1259 [merge-tools]
1260 false.whatever=
1260 false.whatever=
1261 true.priority=1
1261 true.priority=1
1262 true.executable=cat
1262 true.executable=cat
1263 # hg update -C 1
1263 # hg update -C 1
1264 $ hg merge -r 4 --config merge-tools.true.premerge=keep --config ui.mergemarkers=basic
1264 $ hg merge -r 4 --config merge-tools.true.premerge=keep --config ui.mergemarkers=basic
1265 merging f
1265 merging f
1266 <<<<<<< working copy
1266 <<<<<<< working copy
1267 revision 1
1267 revision 1
1268 space
1268 space
1269 =======
1269 =======
1270 revision 4
1270 revision 4
1271 >>>>>>> merge rev
1271 >>>>>>> merge rev
1272 revision 0
1272 revision 0
1273 space
1273 space
1274 revision 4
1274 revision 4
1275 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1275 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1276 (branch merge, don't forget to commit)
1276 (branch merge, don't forget to commit)
1277 $ aftermerge
1277 $ aftermerge
1278 # cat f
1278 # cat f
1279 <<<<<<< working copy
1279 <<<<<<< working copy
1280 revision 1
1280 revision 1
1281 space
1281 space
1282 =======
1282 =======
1283 revision 4
1283 revision 4
1284 >>>>>>> merge rev
1284 >>>>>>> merge rev
1285 # hg stat
1285 # hg stat
1286 M f
1286 M f
1287 # hg resolve --list
1287 # hg resolve --list
1288 R f
1288 R f
1289
1289
1290 premerge=keep ignores ui.mergemarkers=basic if true.mergemarkers=detailed:
1290 premerge=keep ignores ui.mergemarkers=basic if true.mergemarkers=detailed:
1291
1291
1292 $ beforemerge
1292 $ beforemerge
1293 [merge-tools]
1293 [merge-tools]
1294 false.whatever=
1294 false.whatever=
1295 true.priority=1
1295 true.priority=1
1296 true.executable=cat
1296 true.executable=cat
1297 # hg update -C 1
1297 # hg update -C 1
1298 $ hg merge -r 4 --config merge-tools.true.premerge=keep \
1298 $ hg merge -r 4 --config merge-tools.true.premerge=keep \
1299 > --config ui.mergemarkers=basic \
1299 > --config ui.mergemarkers=basic \
1300 > --config merge-tools.true.mergemarkers=detailed
1300 > --config merge-tools.true.mergemarkers=detailed
1301 merging f
1301 merging f
1302 <<<<<<< working copy: ef83787e2614 - test: revision 1
1302 <<<<<<< working copy: ef83787e2614 - test: revision 1
1303 revision 1
1303 revision 1
1304 space
1304 space
1305 =======
1305 =======
1306 revision 4
1306 revision 4
1307 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1307 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1308 revision 0
1308 revision 0
1309 space
1309 space
1310 revision 4
1310 revision 4
1311 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1311 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1312 (branch merge, don't forget to commit)
1312 (branch merge, don't forget to commit)
1313 $ aftermerge
1313 $ aftermerge
1314 # cat f
1314 # cat f
1315 <<<<<<< working copy: ef83787e2614 - test: revision 1
1315 <<<<<<< working copy: ef83787e2614 - test: revision 1
1316 revision 1
1316 revision 1
1317 space
1317 space
1318 =======
1318 =======
1319 revision 4
1319 revision 4
1320 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1320 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4
1321 # hg stat
1321 # hg stat
1322 M f
1322 M f
1323 # hg resolve --list
1323 # hg resolve --list
1324 R f
1324 R f
1325
1325
1326 premerge=keep respects ui.mergemarkertemplate instead of
1326 premerge=keep respects ui.mergemarkertemplate instead of
1327 true.mergemarkertemplate if true.mergemarkers=basic:
1327 true.mergemarkertemplate if true.mergemarkers=basic:
1328
1328
1329 $ beforemerge
1329 $ beforemerge
1330 [merge-tools]
1330 [merge-tools]
1331 false.whatever=
1331 false.whatever=
1332 true.priority=1
1332 true.priority=1
1333 true.executable=cat
1333 true.executable=cat
1334 # hg update -C 1
1334 # hg update -C 1
1335 $ hg merge -r 4 --config merge-tools.true.premerge=keep \
1335 $ hg merge -r 4 --config merge-tools.true.premerge=keep \
1336 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1336 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1337 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}'
1337 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}'
1338 merging f
1338 merging f
1339 <<<<<<< working copy: uitmpl 1
1339 <<<<<<< working copy: uitmpl 1
1340 revision 1
1340 revision 1
1341 space
1341 space
1342 =======
1342 =======
1343 revision 4
1343 revision 4
1344 >>>>>>> merge rev: uitmpl 4
1344 >>>>>>> merge rev: uitmpl 4
1345 revision 0
1345 revision 0
1346 space
1346 space
1347 revision 4
1347 revision 4
1348 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1348 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1349 (branch merge, don't forget to commit)
1349 (branch merge, don't forget to commit)
1350 $ aftermerge
1350 $ aftermerge
1351 # cat f
1351 # cat f
1352 <<<<<<< working copy: uitmpl 1
1352 <<<<<<< working copy: uitmpl 1
1353 revision 1
1353 revision 1
1354 space
1354 space
1355 =======
1355 =======
1356 revision 4
1356 revision 4
1357 >>>>>>> merge rev: uitmpl 4
1357 >>>>>>> merge rev: uitmpl 4
1358 # hg stat
1358 # hg stat
1359 M f
1359 M f
1360 # hg resolve --list
1360 # hg resolve --list
1361 R f
1361 R f
1362
1362
1363 premerge=keep respects true.mergemarkertemplate instead of
1363 premerge=keep respects true.mergemarkertemplate instead of
1364 true.mergemarkertemplate if true.mergemarkers=detailed:
1364 true.mergemarkertemplate if true.mergemarkers=detailed:
1365
1365
1366 $ beforemerge
1366 $ beforemerge
1367 [merge-tools]
1367 [merge-tools]
1368 false.whatever=
1368 false.whatever=
1369 true.priority=1
1369 true.priority=1
1370 true.executable=cat
1370 true.executable=cat
1371 # hg update -C 1
1371 # hg update -C 1
1372 $ hg merge -r 4 --config merge-tools.true.premerge=keep \
1372 $ hg merge -r 4 --config merge-tools.true.premerge=keep \
1373 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1373 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1374 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1374 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1375 > --config merge-tools.true.mergemarkers=detailed
1375 > --config merge-tools.true.mergemarkers=detailed
1376 merging f
1376 merging f
1377 <<<<<<< working copy: tooltmpl ef83787e2614
1377 <<<<<<< working copy: tooltmpl ef83787e2614
1378 revision 1
1378 revision 1
1379 space
1379 space
1380 =======
1380 =======
1381 revision 4
1381 revision 4
1382 >>>>>>> merge rev: tooltmpl 81448d39c9a0
1382 >>>>>>> merge rev: tooltmpl 81448d39c9a0
1383 revision 0
1383 revision 0
1384 space
1384 space
1385 revision 4
1385 revision 4
1386 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1386 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1387 (branch merge, don't forget to commit)
1387 (branch merge, don't forget to commit)
1388 $ aftermerge
1388 $ aftermerge
1389 # cat f
1389 # cat f
1390 <<<<<<< working copy: tooltmpl ef83787e2614
1390 <<<<<<< working copy: tooltmpl ef83787e2614
1391 revision 1
1391 revision 1
1392 space
1392 space
1393 =======
1393 =======
1394 revision 4
1394 revision 4
1395 >>>>>>> merge rev: tooltmpl 81448d39c9a0
1395 >>>>>>> merge rev: tooltmpl 81448d39c9a0
1396 # hg stat
1396 # hg stat
1397 M f
1397 M f
1398 # hg resolve --list
1398 # hg resolve --list
1399 R f
1399 R f
1400
1400
1401 Tool execution
1401 Tool execution
1402
1402
1403 set tools.args explicit to include $base $local $other $output:
1403 set tools.args explicit to include $base $local $other $output:
1404
1404
1405 $ beforemerge
1405 $ beforemerge
1406 [merge-tools]
1406 [merge-tools]
1407 false.whatever=
1407 false.whatever=
1408 true.priority=1
1408 true.priority=1
1409 true.executable=cat
1409 true.executable=cat
1410 # hg update -C 1
1410 # hg update -C 1
1411 $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \
1411 $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \
1412 > | sed 's,==> .* <==,==> ... <==,g'
1412 > | sed 's,==> .* <==,==> ... <==,g'
1413 merging f
1413 merging f
1414 ==> ... <==
1414 ==> ... <==
1415 revision 0
1415 revision 0
1416 space
1416 space
1417
1417
1418 ==> ... <==
1418 ==> ... <==
1419 revision 1
1419 revision 1
1420 space
1420 space
1421
1421
1422 ==> ... <==
1422 ==> ... <==
1423 revision 2
1423 revision 2
1424 space
1424 space
1425
1425
1426 ==> ... <==
1426 ==> ... <==
1427 revision 1
1427 revision 1
1428 space
1428 space
1429 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1429 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1430 (branch merge, don't forget to commit)
1430 (branch merge, don't forget to commit)
1431 $ aftermerge
1431 $ aftermerge
1432 # cat f
1432 # cat f
1433 revision 1
1433 revision 1
1434 space
1434 space
1435 # hg stat
1435 # hg stat
1436 M f
1436 M f
1437 # hg resolve --list
1437 # hg resolve --list
1438 R f
1438 R f
1439
1439
1440 Merge with "echo mergeresult > $local":
1440 Merge with "echo mergeresult > $local":
1441
1441
1442 $ beforemerge
1442 $ beforemerge
1443 [merge-tools]
1443 [merge-tools]
1444 false.whatever=
1444 false.whatever=
1445 true.priority=1
1445 true.priority=1
1446 true.executable=cat
1446 true.executable=cat
1447 # hg update -C 1
1447 # hg update -C 1
1448 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local'
1448 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local'
1449 merging f
1449 merging f
1450 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1450 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1451 (branch merge, don't forget to commit)
1451 (branch merge, don't forget to commit)
1452 $ aftermerge
1452 $ aftermerge
1453 # cat f
1453 # cat f
1454 mergeresult
1454 mergeresult
1455 # hg stat
1455 # hg stat
1456 M f
1456 M f
1457 # hg resolve --list
1457 # hg resolve --list
1458 R f
1458 R f
1459
1459
1460 - and $local is the file f:
1460 - and $local is the file f:
1461
1461
1462 $ beforemerge
1462 $ beforemerge
1463 [merge-tools]
1463 [merge-tools]
1464 false.whatever=
1464 false.whatever=
1465 true.priority=1
1465 true.priority=1
1466 true.executable=cat
1466 true.executable=cat
1467 # hg update -C 1
1467 # hg update -C 1
1468 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f'
1468 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f'
1469 merging f
1469 merging f
1470 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1470 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1471 (branch merge, don't forget to commit)
1471 (branch merge, don't forget to commit)
1472 $ aftermerge
1472 $ aftermerge
1473 # cat f
1473 # cat f
1474 mergeresult
1474 mergeresult
1475 # hg stat
1475 # hg stat
1476 M f
1476 M f
1477 # hg resolve --list
1477 # hg resolve --list
1478 R f
1478 R f
1479
1479
1480 Merge with "echo mergeresult > $output" - the variable is a bit magic:
1480 Merge with "echo mergeresult > $output" - the variable is a bit magic:
1481
1481
1482 $ beforemerge
1482 $ beforemerge
1483 [merge-tools]
1483 [merge-tools]
1484 false.whatever=
1484 false.whatever=
1485 true.priority=1
1485 true.priority=1
1486 true.executable=cat
1486 true.executable=cat
1487 # hg update -C 1
1487 # hg update -C 1
1488 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output'
1488 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output'
1489 merging f
1489 merging f
1490 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1490 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1491 (branch merge, don't forget to commit)
1491 (branch merge, don't forget to commit)
1492 $ aftermerge
1492 $ aftermerge
1493 # cat f
1493 # cat f
1494 mergeresult
1494 mergeresult
1495 # hg stat
1495 # hg stat
1496 M f
1496 M f
1497 # hg resolve --list
1497 # hg resolve --list
1498 R f
1498 R f
1499
1499
1500 Merge using tool with a path that must be quoted:
1500 Merge using tool with a path that must be quoted:
1501
1501
1502 $ beforemerge
1502 $ beforemerge
1503 [merge-tools]
1503 [merge-tools]
1504 false.whatever=
1504 false.whatever=
1505 true.priority=1
1505 true.priority=1
1506 true.executable=cat
1506 true.executable=cat
1507 # hg update -C 1
1507 # hg update -C 1
1508 $ cat <<EOF > 'my merge tool'
1508 $ cat <<EOF > 'my merge tool'
1509 > cat "\$1" "\$2" "\$3" > "\$4"
1509 > cat "\$1" "\$2" "\$3" > "\$4"
1510 > EOF
1510 > EOF
1511 $ hg --config merge-tools.true.executable='sh' \
1511 $ hg --config merge-tools.true.executable='sh' \
1512 > --config merge-tools.true.args='"./my merge tool" $base $local $other $output' \
1512 > --config merge-tools.true.args='"./my merge tool" $base $local $other $output' \
1513 > merge -r 2
1513 > merge -r 2
1514 merging f
1514 merging f
1515 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1515 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1516 (branch merge, don't forget to commit)
1516 (branch merge, don't forget to commit)
1517 $ rm -f 'my merge tool'
1517 $ rm -f 'my merge tool'
1518 $ aftermerge
1518 $ aftermerge
1519 # cat f
1519 # cat f
1520 revision 0
1520 revision 0
1521 space
1521 space
1522 revision 1
1522 revision 1
1523 space
1523 space
1524 revision 2
1524 revision 2
1525 space
1525 space
1526 # hg stat
1526 # hg stat
1527 M f
1527 M f
1528 # hg resolve --list
1528 # hg resolve --list
1529 R f
1529 R f
1530
1530
1531 Merge using a tool that supports labellocal, labelother, and labelbase, checking
1531 Merge using a tool that supports labellocal, labelother, and labelbase, checking
1532 that they're quoted properly as well. This is using the default 'basic'
1532 that they're quoted properly as well. This is using the default 'basic'
1533 mergemarkers even though ui.mergemarkers is 'detailed', so it's ignoring both
1533 mergemarkers even though ui.mergemarkers is 'detailed', so it's ignoring both
1534 mergemarkertemplate settings:
1534 mergemarkertemplate settings:
1535
1535
1536 $ beforemerge
1536 $ beforemerge
1537 [merge-tools]
1537 [merge-tools]
1538 false.whatever=
1538 false.whatever=
1539 true.priority=1
1539 true.priority=1
1540 true.executable=cat
1540 true.executable=cat
1541 # hg update -C 1
1541 # hg update -C 1
1542 $ cat <<EOF > printargs_merge_tool
1542 $ cat <<EOF > printargs_merge_tool
1543 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done
1543 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done
1544 > EOF
1544 > EOF
1545 $ hg --config merge-tools.true.executable='sh' \
1545 $ hg --config merge-tools.true.executable='sh' \
1546 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \
1546 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \
1547 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1547 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1548 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1548 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1549 > --config ui.mergemarkers=detailed \
1549 > --config ui.mergemarkers=detailed \
1550 > merge -r 2
1550 > merge -r 2
1551 merging f
1551 merging f
1552 arg: "ll:working copy"
1552 arg: "ll:working copy"
1553 arg: "lo:"
1553 arg: "lo:"
1554 arg: "merge rev"
1554 arg: "merge rev"
1555 arg: "lb:base: */f~base.*" (glob)
1555 arg: "lb:base: */f~base.*" (glob)
1556 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1556 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1557 (branch merge, don't forget to commit)
1557 (branch merge, don't forget to commit)
1558 $ rm -f 'printargs_merge_tool'
1558 $ rm -f 'printargs_merge_tool'
1559
1559
1560 Same test with experimental.mergetempdirprefix set:
1560 Same test with experimental.mergetempdirprefix set:
1561
1561
1562 $ beforemerge
1562 $ beforemerge
1563 [merge-tools]
1563 [merge-tools]
1564 false.whatever=
1564 false.whatever=
1565 true.priority=1
1565 true.priority=1
1566 true.executable=cat
1566 true.executable=cat
1567 # hg update -C 1
1567 # hg update -C 1
1568 $ cat <<EOF > printargs_merge_tool
1568 $ cat <<EOF > printargs_merge_tool
1569 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done
1569 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done
1570 > EOF
1570 > EOF
1571 $ hg --config experimental.mergetempdirprefix=$TESTTMP/hgmerge. \
1571 $ hg --config experimental.mergetempdirprefix=$TESTTMP/hgmerge. \
1572 > --config merge-tools.true.executable='sh' \
1572 > --config merge-tools.true.executable='sh' \
1573 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \
1573 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \
1574 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1574 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1575 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1575 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1576 > --config ui.mergemarkers=detailed \
1576 > --config ui.mergemarkers=detailed \
1577 > merge -r 2
1577 > merge -r 2
1578 merging f
1578 merging f
1579 arg: "ll:working copy"
1579 arg: "ll:working copy"
1580 arg: "lo:"
1580 arg: "lo:"
1581 arg: "merge rev"
1581 arg: "merge rev"
1582 arg: "lb:base: */hgmerge.*/f~base" (glob)
1582 arg: "lb:base: */hgmerge.*/f~base" (glob)
1583 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1583 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1584 (branch merge, don't forget to commit)
1584 (branch merge, don't forget to commit)
1585 $ rm -f 'printargs_merge_tool'
1585 $ rm -f 'printargs_merge_tool'
1586
1586
1587 Merge using a tool that supports labellocal, labelother, and labelbase, checking
1587 Merge using a tool that supports labellocal, labelother, and labelbase, checking
1588 that they're quoted properly as well. This is using 'detailed' mergemarkers,
1588 that they're quoted properly as well. This is using 'detailed' mergemarkers,
1589 even though ui.mergemarkers is 'basic', and using the tool's
1589 even though ui.mergemarkers is 'basic', and using the tool's
1590 mergemarkertemplate:
1590 mergemarkertemplate:
1591
1591
1592 $ beforemerge
1592 $ beforemerge
1593 [merge-tools]
1593 [merge-tools]
1594 false.whatever=
1594 false.whatever=
1595 true.priority=1
1595 true.priority=1
1596 true.executable=cat
1596 true.executable=cat
1597 # hg update -C 1
1597 # hg update -C 1
1598 $ cat <<EOF > printargs_merge_tool
1598 $ cat <<EOF > printargs_merge_tool
1599 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done
1599 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done
1600 > EOF
1600 > EOF
1601 $ hg --config merge-tools.true.executable='sh' \
1601 $ hg --config merge-tools.true.executable='sh' \
1602 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \
1602 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \
1603 > --config merge-tools.true.mergemarkers=detailed \
1603 > --config merge-tools.true.mergemarkers=detailed \
1604 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1604 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1605 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1605 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1606 > --config ui.mergemarkers=basic \
1606 > --config ui.mergemarkers=basic \
1607 > merge -r 2
1607 > merge -r 2
1608 merging f
1608 merging f
1609 arg: "ll:working copy: tooltmpl ef83787e2614"
1609 arg: "ll:working copy: tooltmpl ef83787e2614"
1610 arg: "lo:"
1610 arg: "lo:"
1611 arg: "merge rev: tooltmpl 0185f4e0cf02"
1611 arg: "merge rev: tooltmpl 0185f4e0cf02"
1612 arg: "lb:base: */f~base.*" (glob)
1612 arg: "lb:base: */f~base.*" (glob)
1613 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1613 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1614 (branch merge, don't forget to commit)
1614 (branch merge, don't forget to commit)
1615 $ rm -f 'printargs_merge_tool'
1615 $ rm -f 'printargs_merge_tool'
1616
1616
1617 The merge tool still gets labellocal and labelother as 'basic' even when
1617 The merge tool still gets labellocal and labelother as 'basic' even when
1618 premerge=keep is used and has 'detailed' markers:
1618 premerge=keep is used and has 'detailed' markers:
1619
1619
1620 $ beforemerge
1620 $ beforemerge
1621 [merge-tools]
1621 [merge-tools]
1622 false.whatever=
1622 false.whatever=
1623 true.priority=1
1623 true.priority=1
1624 true.executable=cat
1624 true.executable=cat
1625 # hg update -C 1
1625 # hg update -C 1
1626 $ cat <<EOF > mytool
1626 $ cat <<EOF > mytool
1627 > echo labellocal: \"\$1\"
1627 > echo labellocal: \"\$1\"
1628 > echo labelother: \"\$2\"
1628 > echo labelother: \"\$2\"
1629 > echo "output (arg)": \"\$3\"
1629 > echo "output (arg)": \"\$3\"
1630 > echo "output (contents)":
1630 > echo "output (contents)":
1631 > cat "\$3"
1631 > cat "\$3"
1632 > EOF
1632 > EOF
1633 $ hg --config merge-tools.true.executable='sh' \
1633 $ hg --config merge-tools.true.executable='sh' \
1634 > --config merge-tools.true.args='mytool $labellocal $labelother $output' \
1634 > --config merge-tools.true.args='mytool $labellocal $labelother $output' \
1635 > --config merge-tools.true.premerge=keep \
1635 > --config merge-tools.true.premerge=keep \
1636 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1636 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1637 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1637 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1638 > --config ui.mergemarkers=detailed \
1638 > --config ui.mergemarkers=detailed \
1639 > merge -r 2
1639 > merge -r 2
1640 merging f
1640 merging f
1641 labellocal: "working copy"
1641 labellocal: "working copy"
1642 labelother: "merge rev"
1642 labelother: "merge rev"
1643 output (arg): "$TESTTMP/repo/f"
1643 output (arg): "$TESTTMP/repo/f"
1644 output (contents):
1644 output (contents):
1645 <<<<<<< working copy: uitmpl 1
1645 <<<<<<< working copy: uitmpl 1
1646 revision 1
1646 revision 1
1647 =======
1647 =======
1648 revision 2
1648 revision 2
1649 >>>>>>> merge rev: uitmpl 2
1649 >>>>>>> merge rev: uitmpl 2
1650 space
1650 space
1651 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1651 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1652 (branch merge, don't forget to commit)
1652 (branch merge, don't forget to commit)
1653 $ rm -f 'mytool'
1653 $ rm -f 'mytool'
1654
1654
1655 premerge=keep uses the *tool's* mergemarkertemplate if tool's
1655 premerge=keep uses the *tool's* mergemarkertemplate if tool's
1656 mergemarkers=detailed; labellocal and labelother also use the tool's template
1656 mergemarkers=detailed; labellocal and labelother also use the tool's template
1657
1657
1658 $ beforemerge
1658 $ beforemerge
1659 [merge-tools]
1659 [merge-tools]
1660 false.whatever=
1660 false.whatever=
1661 true.priority=1
1661 true.priority=1
1662 true.executable=cat
1662 true.executable=cat
1663 # hg update -C 1
1663 # hg update -C 1
1664 $ cat <<EOF > mytool
1664 $ cat <<EOF > mytool
1665 > echo labellocal: \"\$1\"
1665 > echo labellocal: \"\$1\"
1666 > echo labelother: \"\$2\"
1666 > echo labelother: \"\$2\"
1667 > echo "output (arg)": \"\$3\"
1667 > echo "output (arg)": \"\$3\"
1668 > echo "output (contents)":
1668 > echo "output (contents)":
1669 > cat "\$3"
1669 > cat "\$3"
1670 > EOF
1670 > EOF
1671 $ hg --config merge-tools.true.executable='sh' \
1671 $ hg --config merge-tools.true.executable='sh' \
1672 > --config merge-tools.true.args='mytool $labellocal $labelother $output' \
1672 > --config merge-tools.true.args='mytool $labellocal $labelother $output' \
1673 > --config merge-tools.true.premerge=keep \
1673 > --config merge-tools.true.premerge=keep \
1674 > --config merge-tools.true.mergemarkers=detailed \
1674 > --config merge-tools.true.mergemarkers=detailed \
1675 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1675 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \
1676 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1676 > --config ui.mergemarkertemplate='uitmpl {rev}' \
1677 > --config ui.mergemarkers=detailed \
1677 > --config ui.mergemarkers=detailed \
1678 > merge -r 2
1678 > merge -r 2
1679 merging f
1679 merging f
1680 labellocal: "working copy: tooltmpl ef83787e2614"
1680 labellocal: "working copy: tooltmpl ef83787e2614"
1681 labelother: "merge rev: tooltmpl 0185f4e0cf02"
1681 labelother: "merge rev: tooltmpl 0185f4e0cf02"
1682 output (arg): "$TESTTMP/repo/f"
1682 output (arg): "$TESTTMP/repo/f"
1683 output (contents):
1683 output (contents):
1684 <<<<<<< working copy: tooltmpl ef83787e2614
1684 <<<<<<< working copy: tooltmpl ef83787e2614
1685 revision 1
1685 revision 1
1686 =======
1686 =======
1687 revision 2
1687 revision 2
1688 >>>>>>> merge rev: tooltmpl 0185f4e0cf02
1688 >>>>>>> merge rev: tooltmpl 0185f4e0cf02
1689 space
1689 space
1690 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1690 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1691 (branch merge, don't forget to commit)
1691 (branch merge, don't forget to commit)
1692 $ rm -f 'mytool'
1692 $ rm -f 'mytool'
1693
1693
1694 Issue3581: Merging a filename that needs to be quoted
1694 Issue3581: Merging a filename that needs to be quoted
1695 (This test doesn't work on Windows filesystems even on Linux, so check
1695 (This test doesn't work on Windows filesystems even on Linux, so check
1696 for Unix-like permission)
1696 for Unix-like permission)
1697
1697
1698 #if unix-permissions
1698 #if unix-permissions
1699 $ beforemerge
1699 $ beforemerge
1700 [merge-tools]
1700 [merge-tools]
1701 false.whatever=
1701 false.whatever=
1702 true.priority=1
1702 true.priority=1
1703 true.executable=cat
1703 true.executable=cat
1704 # hg update -C 1
1704 # hg update -C 1
1705 $ echo "revision 5" > '"; exit 1; echo "'
1705 $ echo "revision 5" > '"; exit 1; echo "'
1706 $ hg commit -Am "revision 5"
1706 $ hg commit -Am "revision 5"
1707 adding "; exit 1; echo "
1707 adding "; exit 1; echo "
1708 warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "'
1708 warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "'
1709 $ hg update -C 1 > /dev/null
1709 $ hg update -C 1 > /dev/null
1710 $ echo "revision 6" > '"; exit 1; echo "'
1710 $ echo "revision 6" > '"; exit 1; echo "'
1711 $ hg commit -Am "revision 6"
1711 $ hg commit -Am "revision 6"
1712 adding "; exit 1; echo "
1712 adding "; exit 1; echo "
1713 warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "'
1713 warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "'
1714 created new head
1714 created new head
1715 $ hg merge --config merge-tools.true.executable="true" -r 5
1715 $ hg merge --config merge-tools.true.executable="true" -r 5
1716 merging "; exit 1; echo "
1716 merging "; exit 1; echo "
1717 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1717 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1718 (branch merge, don't forget to commit)
1718 (branch merge, don't forget to commit)
1719 $ hg update -C 1 > /dev/null
1719 $ hg update -C 1 > /dev/null
1720
1720
1721 #else
1721 #else
1722
1722
1723 Match the non-portable filename commits above for test stability
1723 Match the non-portable filename commits above for test stability
1724
1724
1725 $ hg import --bypass -q - << EOF
1725 $ hg import --bypass -q - << EOF
1726 > # HG changeset patch
1726 > # HG changeset patch
1727 > revision 5
1727 > revision 5
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 5
1734 > +revision 5
1735 > EOF
1735 > EOF
1736
1736
1737 $ hg import --bypass -q - << EOF
1737 $ hg import --bypass -q - << EOF
1738 > # HG changeset patch
1738 > # HG changeset patch
1739 > revision 6
1739 > revision 6
1740 >
1740 >
1741 > diff --git a/"; exit 1; echo " b/"; exit 1; echo "
1741 > diff --git a/"; exit 1; echo " b/"; exit 1; echo "
1742 > new file mode 100644
1742 > new file mode 100644
1743 > --- /dev/null
1743 > --- /dev/null
1744 > +++ b/"; exit 1; echo "
1744 > +++ b/"; exit 1; echo "
1745 > @@ -0,0 +1,1 @@
1745 > @@ -0,0 +1,1 @@
1746 > +revision 6
1746 > +revision 6
1747 > EOF
1747 > EOF
1748
1748
1749 #endif
1749 #endif
1750
1750
1751 Merge post-processing
1751 Merge post-processing
1752
1752
1753 cat is a bad merge-tool and doesn't change:
1753 cat is a bad merge-tool and doesn't change:
1754
1754
1755 $ beforemerge
1755 $ beforemerge
1756 [merge-tools]
1756 [merge-tools]
1757 false.whatever=
1757 false.whatever=
1758 true.priority=1
1758 true.priority=1
1759 true.executable=cat
1759 true.executable=cat
1760 # hg update -C 1
1760 # hg update -C 1
1761 $ hg merge -y -r 2 --config merge-tools.true.checkchanged=1
1761 $ hg merge -y -r 2 --config merge-tools.true.checkchanged=1
1762 merging f
1762 merging f
1763 revision 1
1763 revision 1
1764 space
1764 space
1765 revision 0
1765 revision 0
1766 space
1766 space
1767 revision 2
1767 revision 2
1768 space
1768 space
1769 output file f appears unchanged
1769 output file f appears unchanged
1770 was merge successful (yn)? n
1770 was merge successful (yn)? n
1771 merging f failed!
1771 merging f failed!
1772 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1772 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1773 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1773 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1774 [1]
1774 [1]
1775 $ aftermerge
1775 $ aftermerge
1776 # cat f
1776 # cat f
1777 revision 1
1777 revision 1
1778 space
1778 space
1779 # hg stat
1779 # hg stat
1780 M f
1780 M f
1781 ? f.orig
1781 ? f.orig
1782 # hg resolve --list
1782 # hg resolve --list
1783 U f
1783 U f
1784
1784
1785 missingbinary is a merge-tool that doesn't exist:
1785 missingbinary is a merge-tool that doesn't exist:
1786
1786
1787 $ echo "missingbinary.executable=doesnotexist" >> .hg/hgrc
1787 $ echo "missingbinary.executable=doesnotexist" >> .hg/hgrc
1788 $ beforemerge
1788 $ beforemerge
1789 [merge-tools]
1789 [merge-tools]
1790 false.whatever=
1790 false.whatever=
1791 true.priority=1
1791 true.priority=1
1792 true.executable=cat
1792 true.executable=cat
1793 missingbinary.executable=doesnotexist
1793 missingbinary.executable=doesnotexist
1794 # hg update -C 1
1794 # hg update -C 1
1795 $ hg merge -y -r 2 --config ui.merge=missingbinary
1795 $ hg merge -y -r 2 --config ui.merge=missingbinary
1796 couldn't find merge tool missingbinary (for pattern f)
1796 couldn't find merge tool missingbinary (for pattern f)
1797 merging f
1797 merging f
1798 couldn't find merge tool missingbinary (for pattern f)
1798 couldn't find merge tool missingbinary (for pattern f)
1799 revision 1
1799 revision 1
1800 space
1800 space
1801 revision 0
1801 revision 0
1802 space
1802 space
1803 revision 2
1803 revision 2
1804 space
1804 space
1805 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1805 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1806 (branch merge, don't forget to commit)
1806 (branch merge, don't forget to commit)
1807
1807
1808 $ hg update -q -C 1
1808 $ hg update -q -C 1
1809 $ rm f
1809 $ rm f
1810
1810
1811 internal merge cannot handle symlinks and shouldn't try:
1811 internal merge cannot handle symlinks and shouldn't try:
1812
1812
1813 #if symlink
1813 #if symlink
1814
1814
1815 $ ln -s symlink f
1815 $ ln -s symlink f
1816 $ hg commit -qm 'f is symlink'
1816 $ hg commit -qm 'f is symlink'
1817
1817
1818 #else
1818 #else
1819
1819
1820 $ hg import --bypass -q - << EOF
1820 $ hg import --bypass -q - << EOF
1821 > # HG changeset patch
1821 > # HG changeset patch
1822 > f is symlink
1822 > f is symlink
1823 >
1823 >
1824 > diff --git a/f b/f
1824 > diff --git a/f b/f
1825 > old mode 100644
1825 > old mode 100644
1826 > new mode 120000
1826 > new mode 120000
1827 > --- a/f
1827 > --- a/f
1828 > +++ b/f
1828 > +++ b/f
1829 > @@ -1,2 +1,1 @@
1829 > @@ -1,2 +1,1 @@
1830 > -revision 1
1830 > -revision 1
1831 > -space
1831 > -space
1832 > +symlink
1832 > +symlink
1833 > \ No newline at end of file
1833 > \ No newline at end of file
1834 > EOF
1834 > EOF
1835
1835
1836 Resolve 'other [destination] changed f which local [working copy] deleted' prompt
1836 Resolve 'other [destination] changed f which local [working copy] deleted' prompt
1837 $ hg up -q -C --config ui.interactive=True << EOF
1837 $ hg up -q -C --config ui.interactive=True << EOF
1838 > c
1838 > c
1839 > EOF
1839 > EOF
1840
1840
1841 #endif
1841 #endif
1842
1842
1843 $ hg merge -r 2 --tool internal:merge
1843 $ hg merge -r 2 --tool internal:merge
1844 merging f
1844 merging f
1845 warning: internal :merge cannot merge symlinks for f
1845 warning: internal :merge cannot merge symlinks for f
1846 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
1846 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
1847 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1847 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1848 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1848 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1849 [1]
1849 [1]
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
1852
1853 $ hg update -q -C 1
1853 $ hg update -q -C 1
1854 $ hg mv f f.txt
1854 $ hg mv f f.txt
1855 $ hg ci -qm "f.txt"
1855 $ hg ci -qm "f.txt"
1856 $ hg update -q -C 2
1856 $ hg update -q -C 2
1857 $ hg merge -y -r tip --tool echo --config merge-tools.echo.args='$base $local $other $output'
1857 $ hg merge -y -r tip --tool echo --config merge-tools.echo.args='$base $local $other $output'
1858 merging f and f.txt to f.txt
1858 merging f and f.txt to f.txt
1859 */f~base.* */f~local.*.txt */f~other.*.txt $TESTTMP/repo/f.txt (glob)
1859 */f~base.* */f~local.*.txt */f~other.*.txt $TESTTMP/repo/f.txt (glob)
1860 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1860 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1861 (branch merge, don't forget to commit)
1861 (branch merge, don't forget to commit)
1862
1862
1863 Verify naming of temporary files and that extension is preserved
1863 Verify naming of temporary files and that extension is preserved
1864 (experimental.mergetempdirprefix version):
1864 (experimental.mergetempdirprefix version):
1865
1865
1866 $ hg update -q -C 1
1866 $ hg update -q -C 1
1867 $ hg mv f f.txt
1867 $ hg mv f f.txt
1868 $ hg ci -qm "f.txt"
1868 $ hg ci -qm "f.txt"
1869 $ hg update -q -C 2
1869 $ hg update -q -C 2
1870 $ hg merge -y -r tip --tool echo \
1870 $ hg merge -y -r tip --tool echo \
1871 > --config merge-tools.echo.args='$base $local $other $output' \
1871 > --config merge-tools.echo.args='$base $local $other $output' \
1872 > --config experimental.mergetempdirprefix=$TESTTMP/hgmerge.
1872 > --config experimental.mergetempdirprefix=$TESTTMP/hgmerge.
1873 merging f and f.txt to f.txt
1873 merging f and f.txt to f.txt
1874 $TESTTMP/hgmerge.*/f~base $TESTTMP/hgmerge.*/f~local.txt $TESTTMP/hgmerge.*/f~other.txt $TESTTMP/repo/f.txt (glob)
1874 $TESTTMP/hgmerge.*/f~base $TESTTMP/hgmerge.*/f~local.txt $TESTTMP/hgmerge.*/f~other.txt $TESTTMP/repo/f.txt (glob)
1875 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1875 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1876 (branch merge, don't forget to commit)
1876 (branch merge, don't forget to commit)
1877
1877
1878 Binary files capability checking
1878 Binary files capability checking
1879
1879
1880 $ hg update -q -C 0
1880 $ hg update -q -C 0
1881 $ python <<EOF
1881 $ python <<EOF
1882 > with open('b', 'wb') as fp:
1882 > with open('b', 'wb') as fp:
1883 > fp.write(b'\x00\x01\x02\x03')
1883 > fp.write(b'\x00\x01\x02\x03')
1884 > EOF
1884 > EOF
1885 $ hg add b
1885 $ hg add b
1886 $ hg commit -qm "add binary file (#1)"
1886 $ hg commit -qm "add binary file (#1)"
1887
1887
1888 $ hg update -q -C 0
1888 $ hg update -q -C 0
1889 $ python <<EOF
1889 $ python <<EOF
1890 > with open('b', 'wb') as fp:
1890 > with open('b', 'wb') as fp:
1891 > fp.write(b'\x03\x02\x01\x00')
1891 > fp.write(b'\x03\x02\x01\x00')
1892 > EOF
1892 > EOF
1893 $ hg add b
1893 $ hg add b
1894 $ hg commit -qm "add binary file (#2)"
1894 $ hg commit -qm "add binary file (#2)"
1895
1895
1896 By default, binary files capability of internal merge tools is not
1896 By default, binary files capability of internal merge tools is not
1897 checked strictly.
1897 checked strictly.
1898
1898
1899 (for merge-patterns, chosen unintentionally)
1899 (for merge-patterns, chosen unintentionally)
1900
1900
1901 $ hg merge 9 \
1901 $ hg merge 9 \
1902 > --config merge-patterns.b=:merge-other \
1902 > --config merge-patterns.b=:merge-other \
1903 > --config merge-patterns.re:[a-z]=:other
1903 > --config merge-patterns.re:[a-z]=:other
1904 warning: check merge-patterns configurations, if ':merge-other' for binary file 'b' is unintentional
1904 warning: check merge-patterns configurations, if ':merge-other' for binary file 'b' is unintentional
1905 (see 'hg help merge-tools' for binary files capability)
1905 (see 'hg help merge-tools' for binary files capability)
1906 merging b
1906 merging b
1907 warning: b looks like a binary file.
1907 warning: b looks like a binary file.
1908 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1908 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1909 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1909 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1910 [1]
1910 [1]
1911 $ hg merge --abort -q
1911 $ hg merge --abort -q
1912
1912
1913 (for ui.merge, ignored unintentionally)
1913 (for ui.merge, ignored unintentionally)
1914
1914
1915 $ hg merge 9 \
1915 $ hg merge 9 \
1916 > --config merge-tools.:other.binary=true \
1916 > --config merge-tools.:other.binary=true \
1917 > --config ui.merge=:other
1917 > --config ui.merge=:other
1918 tool :other (for pattern b) can't handle binary
1918 tool :other (for pattern b) can't handle binary
1919 tool true can't handle binary
1919 tool true can't handle binary
1920 tool :other can't handle binary
1920 tool :other can't handle binary
1921 tool false can't handle binary
1921 tool false can't handle binary
1922 no tool found to merge b
1922 no tool found to merge b
1923 file 'b' needs to be resolved.
1923 file 'b' needs to be resolved.
1924 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
1924 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved.
1925 What do you want to do? u
1925 What do you want to do? u
1926 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1926 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1927 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1927 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1928 [1]
1928 [1]
1929 $ hg merge --abort -q
1929 $ hg merge --abort -q
1930
1930
1931 With merge.strict-capability-check=true, binary files capability of
1931 With merge.strict-capability-check=true, binary files capability of
1932 internal merge tools is checked strictly.
1932 internal merge tools is checked strictly.
1933
1933
1934 $ f --hexdump b
1934 $ f --hexdump b
1935 b:
1935 b:
1936 0000: 03 02 01 00 |....|
1936 0000: 03 02 01 00 |....|
1937
1937
1938 (for merge-patterns)
1938 (for merge-patterns)
1939
1939
1940 $ hg merge 9 --config merge.strict-capability-check=true \
1940 $ hg merge 9 --config merge.strict-capability-check=true \
1941 > --config merge-tools.:merge-other.binary=true \
1941 > --config merge-tools.:merge-other.binary=true \
1942 > --config merge-patterns.b=:merge-other \
1942 > --config merge-patterns.b=:merge-other \
1943 > --config merge-patterns.re:[a-z]=:other
1943 > --config merge-patterns.re:[a-z]=:other
1944 tool :merge-other (for pattern b) can't handle binary
1944 tool :merge-other (for pattern b) can't handle binary
1945 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1945 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1946 (branch merge, don't forget to commit)
1946 (branch merge, don't forget to commit)
1947 $ f --hexdump b
1947 $ f --hexdump b
1948 b:
1948 b:
1949 0000: 00 01 02 03 |....|
1949 0000: 00 01 02 03 |....|
1950 $ hg merge --abort -q
1950 $ hg merge --abort -q
1951
1951
1952 (for ui.merge)
1952 (for ui.merge)
1953
1953
1954 $ hg merge 9 --config merge.strict-capability-check=true \
1954 $ hg merge 9 --config merge.strict-capability-check=true \
1955 > --config ui.merge=:other
1955 > --config ui.merge=:other
1956 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1956 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1957 (branch merge, don't forget to commit)
1957 (branch merge, don't forget to commit)
1958 $ f --hexdump b
1958 $ f --hexdump b
1959 b:
1959 b:
1960 0000: 00 01 02 03 |....|
1960 0000: 00 01 02 03 |....|
1961 $ hg merge --abort -q
1961 $ hg merge --abort -q
1962
1962
1963 Check that the extra information is printed correctly
1963 Check that the extra information is printed correctly
1964
1964
1965 $ hg merge 9 \
1965 $ hg merge 9 \
1966 > --config merge-tools.testecho.executable='echo' \
1966 > --config merge-tools.testecho.executable='echo' \
1967 > --config merge-tools.testecho.args='merge runs here ...' \
1967 > --config merge-tools.testecho.args='merge runs here ...' \
1968 > --config merge-tools.testecho.binary=True \
1968 > --config merge-tools.testecho.binary=True \
1969 > --config ui.merge=testecho \
1969 > --config ui.merge=testecho \
1970 > --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' \
1970 > --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' \
1971 > --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)}"}"'
1971 > --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)}"}"'
1972 merging b
1972 merging b
1973
1973
1974 Running merge tool for b ("*/bin/echo.exe"): (glob) (windows !)
1974 Running merge tool for b ("*/bin/echo.exe"): (glob) (windows !)
1975 Running merge tool for b (*/bin/echo): (glob) (no-windows !)
1975 Running merge tool for b (*/bin/echo): (glob) (no-windows !)
1976 - local (working copy): 10:2d1f533d add binary file (#2) tip default
1976 - local (working copy): 10:2d1f533d add binary file (#2) tip default
1977 - base (base): -1:00000000 default
1977 - base (base): -1:00000000 default
1978 - other (merge rev): 9:1e7ad7d7 add binary file (#1) default
1978 - other (merge rev): 9:1e7ad7d7 add binary file (#1) default
1979 merge runs here ...
1979 merge runs here ...
1980 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1980 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1981 (branch merge, don't forget to commit)
1981 (branch merge, don't forget to commit)
1982
1982
1983 Check that debugpicktool examines which merge tool is chosen for
1983 Check that debugpicktool examines which merge tool is chosen for
1984 specified file as expected
1984 specified file as expected
1985
1985
1986 $ beforemerge
1986 $ beforemerge
1987 [merge-tools]
1987 [merge-tools]
1988 false.whatever=
1988 false.whatever=
1989 true.priority=1
1989 true.priority=1
1990 true.executable=cat
1990 true.executable=cat
1991 missingbinary.executable=doesnotexist
1991 missingbinary.executable=doesnotexist
1992 # hg update -C 1
1992 # hg update -C 1
1993
1993
1994 (default behavior: checking files in the working parent context)
1994 (default behavior: checking files in the working parent context)
1995
1995
1996 $ hg manifest
1996 $ hg manifest
1997 f
1997 f
1998 $ hg debugpickmergetool
1998 $ hg debugpickmergetool
1999 f = true
1999 f = true
2000
2000
2001 (-X/-I and file patterns limmit examination targets)
2001 (-X/-I and file patterns limmit examination targets)
2002
2002
2003 $ hg debugpickmergetool -X f
2003 $ hg debugpickmergetool -X f
2004 $ hg debugpickmergetool unknown
2004 $ hg debugpickmergetool unknown
2005 unknown: no such file in rev ef83787e2614
2005 unknown: no such file in rev ef83787e2614
2006
2006
2007 (--changedelete emulates merging change and delete)
2007 (--changedelete emulates merging change and delete)
2008
2008
2009 $ hg debugpickmergetool --changedelete
2009 $ hg debugpickmergetool --changedelete
2010 f = :prompt
2010 f = :prompt
2011
2011
2012 (-r REV causes checking files in specified revision)
2012 (-r REV causes checking files in specified revision)
2013
2013
2014 $ hg manifest -r 8
2014 $ hg manifest -r 8
2015 f.txt
2015 f.txt
2016 $ hg debugpickmergetool -r 8
2016 $ hg debugpickmergetool -r 8
2017 f.txt = true
2017 f.txt = true
2018
2018
2019 #if symlink
2019 #if symlink
2020
2020
2021 (symlink causes chosing :prompt)
2021 (symlink causes chosing :prompt)
2022
2022
2023 $ hg debugpickmergetool -r 6d00b3726f6e
2023 $ hg debugpickmergetool -r 6d00b3726f6e
2024 f = :prompt
2024 f = :prompt
2025
2025
2026 (by default, it is assumed that no internal merge tools has symlinks
2026 (by default, it is assumed that no internal merge tools has symlinks
2027 capability)
2027 capability)
2028
2028
2029 $ hg debugpickmergetool \
2029 $ hg debugpickmergetool \
2030 > -r 6d00b3726f6e \
2030 > -r 6d00b3726f6e \
2031 > --config merge-tools.:merge-other.symlink=true \
2031 > --config merge-tools.:merge-other.symlink=true \
2032 > --config merge-patterns.f=:merge-other \
2032 > --config merge-patterns.f=:merge-other \
2033 > --config merge-patterns.re:[f]=:merge-local \
2033 > --config merge-patterns.re:[f]=:merge-local \
2034 > --config merge-patterns.re:[a-z]=:other
2034 > --config merge-patterns.re:[a-z]=:other
2035 f = :prompt
2035 f = :prompt
2036
2036
2037 $ hg debugpickmergetool \
2037 $ hg debugpickmergetool \
2038 > -r 6d00b3726f6e \
2038 > -r 6d00b3726f6e \
2039 > --config merge-tools.:other.symlink=true \
2039 > --config merge-tools.:other.symlink=true \
2040 > --config ui.merge=:other
2040 > --config ui.merge=:other
2041 f = :prompt
2041 f = :prompt
2042
2042
2043 (with strict-capability-check=true, actual symlink capabilities are
2043 (with strict-capability-check=true, actual symlink capabilities are
2044 checked striclty)
2044 checked striclty)
2045
2045
2046 $ hg debugpickmergetool --config merge.strict-capability-check=true \
2046 $ hg debugpickmergetool --config merge.strict-capability-check=true \
2047 > -r 6d00b3726f6e \
2047 > -r 6d00b3726f6e \
2048 > --config merge-tools.:merge-other.symlink=true \
2048 > --config merge-tools.:merge-other.symlink=true \
2049 > --config merge-patterns.f=:merge-other \
2049 > --config merge-patterns.f=:merge-other \
2050 > --config merge-patterns.re:[f]=:merge-local \
2050 > --config merge-patterns.re:[f]=:merge-local \
2051 > --config merge-patterns.re:[a-z]=:other
2051 > --config merge-patterns.re:[a-z]=:other
2052 f = :other
2052 f = :other
2053
2053
2054 $ hg debugpickmergetool --config merge.strict-capability-check=true \
2054 $ hg debugpickmergetool --config merge.strict-capability-check=true \
2055 > -r 6d00b3726f6e \
2055 > -r 6d00b3726f6e \
2056 > --config ui.merge=:other
2056 > --config ui.merge=:other
2057 f = :other
2057 f = :other
2058
2058
2059 $ hg debugpickmergetool --config merge.strict-capability-check=true \
2059 $ hg debugpickmergetool --config merge.strict-capability-check=true \
2060 > -r 6d00b3726f6e \
2060 > -r 6d00b3726f6e \
2061 > --config merge-tools.:merge-other.symlink=true \
2061 > --config merge-tools.:merge-other.symlink=true \
2062 > --config ui.merge=:merge-other
2062 > --config ui.merge=:merge-other
2063 f = :prompt
2063 f = :prompt
2064
2064
2065 #endif
2065 #endif
2066
2066
2067 (--verbose shows some configurations)
2067 (--verbose shows some configurations)
2068
2068
2069 $ hg debugpickmergetool --tool foobar -v
2069 $ hg debugpickmergetool --tool foobar -v
2070 with --tool 'foobar'
2070 with --tool 'foobar'
2071 f = foobar
2071 f = foobar
2072
2072
2073 $ HGMERGE=false hg debugpickmergetool -v
2073 $ HGMERGE=false hg debugpickmergetool -v
2074 with HGMERGE='false'
2074 with HGMERGE='false'
2075 f = false
2075 f = false
2076
2076
2077 $ hg debugpickmergetool --config ui.merge=false -v
2077 $ hg debugpickmergetool --config ui.merge=false -v
2078 with ui.merge='false'
2078 with ui.merge='false'
2079 f = false
2079 f = false
2080
2080
2081 (--debug shows errors detected intermediately)
2081 (--debug shows errors detected intermediately)
2082
2082
2083 $ hg debugpickmergetool --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool --debug f
2083 $ hg debugpickmergetool --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool --debug f
2084 couldn't find merge tool true (for pattern f)
2084 couldn't find merge tool true (for pattern f)
2085 couldn't find merge tool true
2085 couldn't find merge tool true
2086 f = false
2086 f = false
2087
2087
2088 $ cd ..
2088 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now