# HG changeset patch # User Matt Harbison # Date 1740071880 18000 # Node ID 3fb2fbad4b130f4e185eee6681c8d8d336dddffd # Parent e75ed9ae5fb9b1ac888c4946845c3187c0cb7453 test-fix-path: avoid a test hang on Windows Windows can't typically invoke `*.py` directly as a command, and will instead show a prompt asking what program should be used to open the file. We can't directly invoke the interpreter as is usually done in this case, because the whole point is to run something not in `PATH`. The easiest thing to do is invoke a *.bat file that runs the interpreter. We can get away with this because the current implementation is to effectively run `cmd.exe /c %command%`, which doesn't need the file extension specified. diff -r e75ed9ae5fb9 -r 3fb2fbad4b13 tests/test-fix-path.t --- a/tests/test-fix-path.t Wed Feb 19 02:45:09 2025 +0100 +++ b/tests/test-fix-path.t Thu Feb 20 12:18:00 2025 -0500 @@ -20,8 +20,17 @@ > return re.sub(b' +', b' ', text.upper()) > stdout.write(format(stdin.read())) > EOF + $ chmod +x some/dir/uppercase.py +#if windows + $ cat > some/dir/uppercase.bat < @echo off + > "$PYTHON" "$TESTTMP/test-repo/some/dir/uppercase.py" + > EOF +#else + $ mv some/dir/uppercase.py some/dir/uppercase +#endif $ echo babar > babar.txt $ hg add babar.txt @@ -36,7 +45,7 @@ > evolution.allowunstable=True > [fix] > extra-bin-paths=$TESTTMP/test-repo/some/dir/ - > uppercase-whole-file:command=uppercase.py + > uppercase-whole-file:command=uppercase > uppercase-whole-file:pattern=set:**.txt > EOF