Mercurial > hg
comparison tests/test-merge-tools.t @ 36999:e349ad5cbb71
filemerge: use a single temp dir instead of temp files
This can help to remove the clutter from UIs that display just the filenames;
instead of seeing foo~local.C9ru9r.txt and foo~base.2DMV22.txt (in the /tmp
directory on most platforms), we create a single new directory and use that,
producing filenames like /tmp/hgmerge.C9ru9r/foo~local.txt.
Differential Revision: https://phab.mercurial-scm.org/D2888
author | Kyle Lippincott <spectral@google.com> |
---|---|
date | Fri, 19 Jan 2018 19:07:58 -0800 |
parents | ccc2d5f10421 |
children | 6bc2f1b3bc9d |
comparison
equal
deleted
inserted
replaced
36998:3723b42ff953 | 36999:e349ad5cbb71 |
---|---|
1361 arg: "lb:base: */f~base.*" (glob) | 1361 arg: "lb:base: */f~base.*" (glob) |
1362 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | 1362 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
1363 (branch merge, don't forget to commit) | 1363 (branch merge, don't forget to commit) |
1364 $ rm -f 'printargs_merge_tool' | 1364 $ rm -f 'printargs_merge_tool' |
1365 | 1365 |
1366 Same test with experimental.mergetempdirprefix set: | |
1367 | |
1368 $ beforemerge | |
1369 [merge-tools] | |
1370 false.whatever= | |
1371 true.priority=1 | |
1372 true.executable=cat | |
1373 # hg update -C 1 | |
1374 $ cat <<EOF > printargs_merge_tool | |
1375 > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done | |
1376 > EOF | |
1377 $ hg --config experimental.mergetempdirprefix=$TESTTMP/hgmerge. \ | |
1378 > --config merge-tools.true.executable='sh' \ | |
1379 > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \ | |
1380 > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \ | |
1381 > --config ui.mergemarkertemplate='uitmpl {rev}' \ | |
1382 > --config ui.mergemarkers=detailed \ | |
1383 > merge -r 2 | |
1384 merging f | |
1385 arg: "ll:working copy" | |
1386 arg: "lo:" | |
1387 arg: "merge rev" | |
1388 arg: "lb:base: $TESTTMP/hgmerge.*/f~base" (glob) | |
1389 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
1390 (branch merge, don't forget to commit) | |
1391 $ rm -f 'printargs_merge_tool' | |
1392 | |
1366 Merge using a tool that supports labellocal, labelother, and labelbase, checking | 1393 Merge using a tool that supports labellocal, labelother, and labelbase, checking |
1367 that they're quoted properly as well. This is using 'detailed' mergemarkers, | 1394 that they're quoted properly as well. This is using 'detailed' mergemarkers, |
1368 even though ui.mergemarkers is 'basic', and using the tool's | 1395 even though ui.mergemarkers is 'basic', and using the tool's |
1369 mergemarkertemplate: | 1396 mergemarkertemplate: |
1370 | 1397 |
1560 merging f and f.txt to f.txt | 1587 merging f and f.txt to f.txt |
1561 */f~base.* $TESTTMP/f.txt.orig */f~other.*.txt $TESTTMP/f.txt (glob) | 1588 */f~base.* $TESTTMP/f.txt.orig */f~other.*.txt $TESTTMP/f.txt (glob) |
1562 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | 1589 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
1563 (branch merge, don't forget to commit) | 1590 (branch merge, don't forget to commit) |
1564 | 1591 |
1592 Verify naming of temporary files and that extension is preserved | |
1593 (experimental.mergetempdirprefix version): | |
1594 | |
1595 $ hg update -q -C 1 | |
1596 $ hg mv f f.txt | |
1597 $ hg ci -qm "f.txt" | |
1598 $ hg update -q -C 2 | |
1599 $ hg merge -y -r tip --tool echo \ | |
1600 > --config merge-tools.echo.args='$base $local $other $output' \ | |
1601 > --config experimental.mergetempdirprefix=$TESTTMP/hgmerge. | |
1602 merging f and f.txt to f.txt | |
1603 $TESTTMP/hgmerge.*/f~base $TESTTMP/f.txt.orig $TESTTMP/hgmerge.*/f~other.txt $TESTTMP/f.txt (glob) | |
1604 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
1605 (branch merge, don't forget to commit) | |
1606 | |
1565 Check that debugpicktool examines which merge tool is chosen for | 1607 Check that debugpicktool examines which merge tool is chosen for |
1566 specified file as expected | 1608 specified file as expected |
1567 | 1609 |
1568 $ beforemerge | 1610 $ beforemerge |
1569 [merge-tools] | 1611 [merge-tools] |