Mercurial > hg
comparison tests/test-merge-tools.t @ 36054:fe5c4b795999
test-merge-tools: stabilize for Windows
This masks the Windows argument parsing insanity[1], so it needs a bit of
explanation. (The security reference in the footnote is probably useful to keep
in mind if we ever whitelist certain in-repo config settings.)
9037c29e9f53 introduced tests that were failing on Windows with an unbalanced
double quote[2]. What ends up happening here is util.shellquote() is double
quoting the file path, but the shell script is placing this ->": "<- right next
to it. So cmd.exe gets launched with 'lb:base": ""c:\...\f~base.xyz"', which
got interpreted as 'lb:base: "c:\...\f~base.xyz'. If the test is adjusted to
quote like "lb:$labelbase: $base", then MSYS runs interference and strips the
'\' characters. I was able to get the expected result by dropping the quotes
from '": "', and changing the space to underscore. But since we need to glob
away the C: part anyway, just glob away the quote and leave the test unchanged.
[1] https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/
[2] https://buildbot.mercurial-scm.org/builders/Win7%20x86_64%20hg%20tests/builds/441/steps/run-tests.py%20%28python%202.7.13%29/logs/stdio
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 11 Feb 2018 20:59:35 -0500 |
parents | 07cd54eae696 |
children | ccc2d5f10421 |
comparison
equal
deleted
inserted
replaced
36053:3c9f2d4dbb39 | 36054:fe5c4b795999 |
---|---|
1356 > merge -r 2 | 1356 > merge -r 2 |
1357 merging f | 1357 merging f |
1358 arg: "ll:working copy" | 1358 arg: "ll:working copy" |
1359 arg: "lo:" | 1359 arg: "lo:" |
1360 arg: "merge rev" | 1360 arg: "merge rev" |
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 Merge using a tool that supports labellocal, labelother, and labelbase, checking | 1366 Merge using a tool that supports labellocal, labelother, and labelbase, checking |
1386 > merge -r 2 | 1386 > merge -r 2 |
1387 merging f | 1387 merging f |
1388 arg: "ll:working copy: tooltmpl ef83787e2614" | 1388 arg: "ll:working copy: tooltmpl ef83787e2614" |
1389 arg: "lo:" | 1389 arg: "lo:" |
1390 arg: "merge rev: tooltmpl 0185f4e0cf02" | 1390 arg: "merge rev: tooltmpl 0185f4e0cf02" |
1391 arg: "lb:base: /*/f~base.*" (glob) | 1391 arg: "lb:base: */f~base.*" (glob) |
1392 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | 1392 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
1393 (branch merge, don't forget to commit) | 1393 (branch merge, don't forget to commit) |
1394 $ rm -f 'printargs_merge_tool' | 1394 $ rm -f 'printargs_merge_tool' |
1395 | 1395 |
1396 The merge tool still gets labellocal and labelother as 'basic' even when | 1396 The merge tool still gets labellocal and labelother as 'basic' even when |