tests: stabilize test-patch.t on Windows
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 20 May 2018 23:05:18 -0400
changeset 38156 f44306940c94
parent 38155 26b73fad45d9
child 38157 282f3daac1d7
tests: stabilize test-patch.t on Windows $PYTHON needs to be quoted when invoking with cmd.exe, because the value expands to c:/Python27/python.exe, which seems to be interpreted as 'c' being a command. We can't just convert to '\', because there are a few places that run $PYTHON directly in MSYS. If unquoted there, it results in c:Python27python.exe being run. I wonder if we should bake the quotes into the environment variable to avoid this. It also wasn't happy with the quoting around exit1.py: c:/Python27/python.exe: can't open file ''$TESTTMP/d/exit1.py'': [Errno 22] Invalid argument
tests/test-patch.t
--- a/tests/test-patch.t	Mon May 21 23:04:28 2018 -0400
+++ b/tests/test-patch.t	Sun May 20 23:05:18 2018 -0400
@@ -97,7 +97,7 @@
   > sys.exit(1)
   > EOF
 
-  $ hg import ../c/p --config ui.patch="$PYTHON '`pwd`/exit1.py'"
+  $ hg import ../c/p --config ui.patch="\"$PYTHON\" \"`pwd`/exit1.py\""
   applying ../c/p
   abort: patch command failed: exited with status 1
   [255]