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