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