comparison tests/test-fix.t @ 42938:a2dffe68b4ea

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
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 14 Sep 2019 12:11:03 -0400
parents 34a46d48d24e
children 808a57a08470
comparison
equal deleted inserted replaced
42937:69de49c4e39c 42938:a2dffe68b4ea
1295 $ hg init subprocesscwd 1295 $ hg init subprocesscwd
1296 $ cd subprocesscwd 1296 $ cd subprocesscwd
1297 1297
1298 $ cat >> .hg/hgrc <<EOF 1298 $ cat >> .hg/hgrc <<EOF
1299 > [fix] 1299 > [fix]
1300 > printcwd:command = pwd 1300 > printcwd:command = "$PYTHON" -c "import os; print(os.getcwd())"
1301 > printcwd:pattern = path:foo/bar 1301 > printcwd:pattern = path:foo/bar
1302 > EOF 1302 > EOF
1303 1303
1304 $ mkdir foo 1304 $ mkdir foo
1305 $ printf "bar\n" > foo/bar 1305 $ printf "bar\n" > foo/bar
1380 $ hg commit -Aqm "base" 1380 $ hg commit -Aqm "base"
1381 1381
1382 $ printf "a\nc\n" > foo 1382 $ printf "a\nc\n" > foo
1383 $ printf "a\nx\nc\n" > baz 1383 $ printf "a\nx\nc\n" > baz
1384 1384
1385 $ cat >> print.py <<EOF
1386 > import sys
1387 > for a in sys.argv[1:]:
1388 > print(a)
1389 > EOF
1390
1385 $ hg fix --working-dir foo bar baz \ 1391 $ hg fix --working-dir foo bar baz \
1386 > --config 'fix.changedlines:command=printf "Line ranges:\n"; ' \ 1392 > --config "fix.changedlines:command=\"$PYTHON\" print.py \"Line ranges:\"" \
1387 > --config 'fix.changedlines:linerange=printf "{first} through {last}\n"; ' \ 1393 > --config 'fix.changedlines:linerange="{first} through {last}"' \
1388 > --config 'fix.changedlines:pattern=rootglob:**' \ 1394 > --config 'fix.changedlines:pattern=rootglob:**' \
1389 > --config 'fix.changedlines:skipclean=false' 1395 > --config 'fix.changedlines:skipclean=false'
1390 1396
1391 $ cat foo 1397 $ cat foo
1392 Line ranges: 1398 Line ranges: