Skip to content
Snippets Groups Projects
Commit a2dffe68b4ea authored by Matt Harbison's avatar Matt Harbison
Browse files

tests: stabilize test-fix.t on Windows

`pwd` prints /tmp/... style paths, not C:\... needed for $TESTTMP to be
substituted.

In the final test, for whatever reason, Windows was missing EOL in the files and
printing:

    [wdir] changedlines: printf: warning: ignoring excess arguments, starting
       with 'printf'

even though it was trying to run:

    printf "Line ranges:\n"; printf "2 through 2\n";

I tried wrapping both :command and :linerange in `sh -c "..."`, and while that
fixed the missing EOL, it missed the "2 through 2" output.

Differential Revision: https://phab.mercurial-scm.org/D6852
parent 69de49c4e39c
No related branches found
No related tags found
No related merge requests found
......@@ -1297,7 +1297,7 @@
$ cat >> .hg/hgrc <<EOF
> [fix]
> printcwd:command = pwd
> printcwd:command = "$PYTHON" -c "import os; print(os.getcwd())"
> printcwd:pattern = path:foo/bar
> EOF
......@@ -1382,4 +1382,10 @@
$ printf "a\nc\n" > foo
$ printf "a\nx\nc\n" > baz
$ cat >> print.py <<EOF
> import sys
> for a in sys.argv[1:]:
> print(a)
> EOF
$ hg fix --working-dir foo bar baz \
......@@ -1385,6 +1391,6 @@
$ hg fix --working-dir foo bar baz \
> --config 'fix.changedlines:command=printf "Line ranges:\n"; ' \
> --config 'fix.changedlines:linerange=printf "{first} through {last}\n"; ' \
> --config "fix.changedlines:command=\"$PYTHON\" print.py \"Line ranges:\"" \
> --config 'fix.changedlines:linerange="{first} through {last}"' \
> --config 'fix.changedlines:pattern=rootglob:**' \
> --config 'fix.changedlines:skipclean=false'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment