tests: replace yet more calls to `python` with $PYTHON
authorAugie Fackler <augie@google.com>
Wed, 05 Jul 2017 11:10:11 -0500
changeset 33262 8e6f4939a69a
parent 33261 be49f3fdcd10
child 33263 ed61189763ef
tests: replace yet more calls to `python` with $PYTHON These are some simple cases. More to come in a future change. Reviewers: krbullock Reviewed By: krbullock Differential Revision: https://phab.mercurial-scm.org/D4
tests/test-bundle2-pushback.t
tests/test-check-module-imports.t
tests/test-clone-cgi.t
tests/test-command-template.t
tests/test-commit-interactive-curses.t
tests/test-conflict.t
tests/test-contrib.t
tests/test-encoding-align.t
tests/test-encoding.t
tests/test-extension.t
tests/test-help.t
tests/test-hgweb-commands.t
tests/test-histedit-arguments.t
tests/test-imports-checker.t
tests/test-largefiles.t
tests/test-log.t
tests/test-mq.t
tests/test-newcgi.t
tests/test-newercgi.t
tests/test-oldcgi.t
tests/test-parseindex.t
tests/test-purge.t
tests/test-push-cgi.t
tests/test-push-race.t
tests/test-revset.t
tests/test-ssh-bundle1.t
tests/test-ssh.t
tests/test-tag.t
--- a/tests/test-bundle2-pushback.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-bundle2-pushback.t	Wed Jul 05 11:10:11 2017 -0500
@@ -25,7 +25,7 @@
 
   $ cat >> $HGRCPATH <<EOF
   > [ui]
-  > ssh = python "$TESTDIR/dummyssh"
+  > ssh = $PYTHON "$TESTDIR/dummyssh"
   > username = nobody <no.reply@example.com>
   > 
   > [alias]
--- a/tests/test-check-module-imports.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-check-module-imports.t	Wed Jul 05 11:10:11 2017 -0500
@@ -37,4 +37,4 @@
   > -X tests/test-hgweb-no-path-info.t \
   > -X tests/test-hgweb-no-request-uri.t \
   > -X tests/test-hgweb-non-interactive.t \
-  > | sed 's-\\-/-g' | python "$import_checker" -
+  > | sed 's-\\-/-g' | $PYTHON "$import_checker" -
--- a/tests/test-clone-cgi.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-clone-cgi.t	Wed Jul 05 11:10:11 2017 -0500
@@ -26,13 +26,13 @@
 
   $ . "$TESTDIR/cgienv"
   $ QUERY_STRING="cmd=changegroup&roots=0000000000000000000000000000000000000000"; export QUERY_STRING
-  $ python hgweb.cgi >page1 2>&1
+  $ $PYTHON hgweb.cgi >page1 2>&1
   $ $PYTHON "$TESTDIR/md5sum.py" page1
   1f424bb22ec05c3c6bc866b6e67efe43  page1
 
 make sure headers are sent even when there is no body
 
-  $ QUERY_STRING="cmd=listkeys&namespace=nosuchnamespace" python hgweb.cgi
+  $ QUERY_STRING="cmd=listkeys&namespace=nosuchnamespace" $PYTHON hgweb.cgi
   Status: 200 Script output follows\r (esc)
   Content-Type: application/mercurial-0.1\r (esc)
   Content-Length: 0\r (esc)
--- a/tests/test-command-template.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-command-template.t	Wed Jul 05 11:10:11 2017 -0500
@@ -4253,7 +4253,7 @@
 
   $ hg init nonascii
   $ cd nonascii
-  $ python <<EOF
+  $ $PYTHON <<EOF
   > open('latin1', 'w').write('\xe9')
   > open('utf-8', 'w').write('\xc3\xa9')
   > EOF
--- a/tests/test-commit-interactive-curses.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-commit-interactive-curses.t	Wed Jul 05 11:10:11 2017 -0500
@@ -342,7 +342,7 @@
 The default interface is text
   $ cp $HGRCPATH.pretest $HGRCPATH
   $ chunkselectorinterface() {
-  > python <<EOF
+  > $PYTHON <<EOF
   > from mercurial import hg, ui;\
   > repo = hg.repository(ui.ui.load(), ".");\
   > print repo.ui.interface("chunkselector")
--- a/tests/test-conflict.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-conflict.t	Wed Jul 05 11:10:11 2017 -0500
@@ -120,7 +120,7 @@
 Verify line trimming of custom conflict marker using multi-byte characters
 
   $ hg up -q --clean .
-  $ python <<EOF
+  $ $PYTHON <<EOF
   > fp = open('logfile', 'w')
   > fp.write('12345678901234567890123456789012345678901234567890' +
   >          '1234567890') # there are 5 more columns for 80 columns
--- a/tests/test-contrib.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-contrib.t	Wed Jul 05 11:10:11 2017 -0500
@@ -26,7 +26,7 @@
 
 Dumping revlog of file a to stdout:
 
-  $ python "$CONTRIBDIR/dumprevlog" .hg/store/data/a.i
+  $ $PYTHON "$CONTRIBDIR/dumprevlog" .hg/store/data/a.i
   file: .hg/store/data/a.i
   node: 183d2312b35066fb6b3b449b84efc370d50993d0
   linkrev: 0
@@ -58,14 +58,14 @@
 
 Dump all revlogs to file repo.dump:
 
-  $ find .hg/store -name "*.i" | sort | xargs python "$CONTRIBDIR/dumprevlog" > ../repo.dump
+  $ find .hg/store -name "*.i" | sort | xargs $PYTHON "$CONTRIBDIR/dumprevlog" > ../repo.dump
   $ cd ..
 
 Undumping into repo-b:
 
   $ hg init repo-b
   $ cd repo-b
-  $ python "$CONTRIBDIR/undumprevlog" < ../repo.dump
+  $ $PYTHON "$CONTRIBDIR/undumprevlog" < ../repo.dump
   .hg/store/00changelog.i
   .hg/store/00manifest.i
   .hg/store/data/a.i
@@ -115,7 +115,7 @@
 
 changing local directly
 
-  $ python simplemerge local base other && echo "merge succeeded"
+  $ $PYTHON simplemerge local base other && echo "merge succeeded"
   merge succeeded
   $ cat local
   local
@@ -125,7 +125,7 @@
 
 printing to stdout
 
-  $ python simplemerge -p local base other
+  $ $PYTHON simplemerge -p local base other
   local
   base
   other
@@ -144,7 +144,7 @@
   $ echo end >> conflict-local
   $ echo end >> conflict-other
 
-  $ python simplemerge -p conflict-local base conflict-other
+  $ $PYTHON simplemerge -p conflict-local base conflict-other
   base
   <<<<<<< conflict-local
   not other
@@ -156,7 +156,7 @@
 
 1 label
 
-  $ python simplemerge -p -L foo conflict-local base conflict-other
+  $ $PYTHON simplemerge -p -L foo conflict-local base conflict-other
   base
   <<<<<<< foo
   not other
@@ -168,7 +168,7 @@
 
 2 labels
 
-  $ python simplemerge -p -L foo -L bar conflict-local base conflict-other
+  $ $PYTHON simplemerge -p -L foo -L bar conflict-local base conflict-other
   base
   <<<<<<< foo
   not other
@@ -180,7 +180,7 @@
 
 3 labels
 
-  $ python simplemerge -p -L foo -L bar -L base conflict-local base conflict-other
+  $ $PYTHON simplemerge -p -L foo -L bar -L base conflict-local base conflict-other
   base
   <<<<<<< foo
   not other
@@ -194,7 +194,7 @@
 
 too many labels
 
-  $ python simplemerge -p -L foo -L bar -L baz -L buz conflict-local base conflict-other
+  $ $PYTHON simplemerge -p -L foo -L bar -L baz -L buz conflict-local base conflict-other
   abort: can only specify three labels.
   [255]
 
@@ -202,13 +202,13 @@
 
   $ $PYTHON -c "f = file('binary-local', 'w'); f.write('\x00'); f.close()"
   $ cat orig >> binary-local
-  $ python simplemerge -p binary-local base other
+  $ $PYTHON simplemerge -p binary-local base other
   warning: binary-local looks like a binary file.
   [1]
 
 binary file --text
 
-  $ python simplemerge -a -p binary-local base other 2>&1
+  $ $PYTHON simplemerge -a -p binary-local base other 2>&1
   warning: binary-local looks like a binary file.
   \x00local (esc)
   base
@@ -216,7 +216,7 @@
 
 help
 
-  $ python simplemerge --help
+  $ $PYTHON simplemerge --help
   simplemerge [OPTS] LOCAL BASE OTHER
   
       Simple three-way file merge utility with a minimal feature set.
@@ -235,7 +235,7 @@
 
 wrong number of arguments
 
-  $ python simplemerge
+  $ $PYTHON simplemerge
   simplemerge: wrong number of arguments
   simplemerge [OPTS] LOCAL BASE OTHER
   
@@ -256,7 +256,7 @@
 
 bad option
 
-  $ python simplemerge --foo -p local base other
+  $ $PYTHON simplemerge --foo -p local base other
   simplemerge: option --foo not recognized
   simplemerge [OPTS] LOCAL BASE OTHER
   
--- a/tests/test-encoding-align.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-encoding-align.t	Wed Jul 05 11:10:11 2017 -0500
@@ -4,7 +4,7 @@
   $ export HGENCODING
   $ hg init t
   $ cd t
-  $ python << EOF
+  $ $PYTHON << EOF
   > # (byte, width) = (6, 4)
   > s = "\xe7\x9f\xad\xe5\x90\x8d"
   > # (byte, width) = (7, 7): odd width is good for alignment test
--- a/tests/test-encoding.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-encoding.t	Wed Jul 05 11:10:11 2017 -0500
@@ -13,7 +13,7 @@
   (run 'hg update' to get a working copy)
   $ hg co
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ python << EOF
+  $ $PYTHON << EOF
   > f = file('latin-1', 'w'); f.write("latin-1 e' encoded: \xe9"); f.close()
   > f = file('utf-8', 'w'); f.write("utf-8 e' encoded: \xc3\xa9"); f.close()
   > f = file('latin-1-tag', 'w'); f.write("\xe9"); f.close()
--- a/tests/test-extension.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-extension.t	Wed Jul 05 11:10:11 2017 -0500
@@ -123,7 +123,7 @@
   > EOF
   $ . "$TESTDIR/cgienv"
 
-  $ PATH_INFO='/' SCRIPT_NAME='' python hgweb.cgi \
+  $ PATH_INFO='/' SCRIPT_NAME='' $PYTHON hgweb.cgi \
   >    | grep '^[0-9]) ' # ignores HTML output
   1) foo imported
   1) bar imported
--- a/tests/test-help.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-help.t	Wed Jul 05 11:10:11 2017 -0500
@@ -1646,7 +1646,7 @@
 This tests that section lookup by translated string isn't broken by
 such str.lower().
 
-  $ python <<EOF
+  $ $PYTHON <<EOF
   > def escape(s):
   >     return ''.join('\u%x' % ord(uc) for uc in s.decode('cp932'))
   > # translation of "record" in ja_JP.cp932
@@ -1680,7 +1680,7 @@
   > ambiguous = ./ambiguous.py
   > EOF
 
-  $ python <<EOF | sh
+  $ $PYTHON <<EOF | sh
   > upper = "\x8bL\x98^"
   > print "hg --encoding cp932 help -e ambiguous.%s" % upper
   > EOF
@@ -1690,7 +1690,7 @@
   Upper name should show only this message
   
 
-  $ python <<EOF | sh
+  $ $PYTHON <<EOF | sh
   > lower = "\x8bl\x98^"
   > print "hg --encoding cp932 help -e ambiguous.%s" % lower
   > EOF
--- a/tests/test-hgweb-commands.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-hgweb-commands.t	Wed Jul 05 11:10:11 2017 -0500
@@ -2265,7 +2265,7 @@
   $ . "$TESTDIR/cgienv"
   $ PATH_INFO=/bookmarks; export PATH_INFO
   $ QUERY_STRING='style=raw'
-  $ python hgweb.cgi | grep -v ETag:
+  $ $PYTHON hgweb.cgi | grep -v ETag:
   Status: 200 Script output follows\r (esc)
   Content-Type: text/plain; charset=ascii\r (esc)
   \r (esc)
@@ -2274,7 +2274,7 @@
 
   $ PATH_INFO=/; export PATH_INFO
   $ QUERY_STRING='cmd=listkeys&namespace=bookmarks'
-  $ python hgweb.cgi
+  $ $PYTHON hgweb.cgi
   Status: 200 Script output follows\r (esc)
   Content-Type: application/mercurial-0.1\r (esc)
   Content-Length: 0\r (esc)
@@ -2284,7 +2284,7 @@
 
   $ PATH_INFO=/log; export PATH_INFO
   $ QUERY_STRING='rev=babar'
-  $ python hgweb.cgi > search
+  $ $PYTHON hgweb.cgi > search
   $ grep Status search
   Status: 200 Script output follows\r (esc)
 
@@ -2292,7 +2292,7 @@
 
   $ PATH_INFO=/summary; export PATH_INFO
   $ QUERY_STRING='style=monoblue'; export QUERY_STRING
-  $ python hgweb.cgi > summary.out
+  $ $PYTHON hgweb.cgi > summary.out
   $ grep "^Status" summary.out
   Status: 200 Script output follows\r (esc)
 
@@ -2303,7 +2303,7 @@
 
   $ PATH_INFO=/rev/5; export PATH_INFO
   $ QUERY_STRING='style=raw'
-  $ python hgweb.cgi #> search
+  $ $PYTHON hgweb.cgi #> search
   Status: 404 Not Found\r (esc)
   ETag: W/"*"\r (glob) (esc)
   Content-Type: text/plain; charset=ascii\r (esc)
@@ -2317,7 +2317,7 @@
 
   $ PATH_INFO=/rev/4; export PATH_INFO
   $ QUERY_STRING='style=raw'
-  $ python hgweb.cgi #> search
+  $ $PYTHON hgweb.cgi #> search
   Status: 404 Not Found\r (esc)
   ETag: W/"*"\r (glob) (esc)
   Content-Type: text/plain; charset=ascii\r (esc)
@@ -2345,11 +2345,11 @@
   $ hg phase --force --secret 0
   $ PATH_INFO=/graph/; export PATH_INFO
   $ QUERY_STRING=''
-  $ python hgweb.cgi | grep Status
+  $ $PYTHON hgweb.cgi | grep Status
   Status: 200 Script output follows\r (esc)
 (check rendered revision)
   $ QUERY_STRING='style=raw'
-  $ python hgweb.cgi | grep -v ETag
+  $ $PYTHON hgweb.cgi | grep -v ETag
   Status: 200 Script output follows\r (esc)
   Content-Type: text/plain; charset=ascii\r (esc)
   \r (esc)
--- a/tests/test-histedit-arguments.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-histedit-arguments.t	Wed Jul 05 11:10:11 2017 -0500
@@ -279,7 +279,7 @@
 Test that trimming description using multi-byte characters
 --------------------------------------------------------------------
 
-  $ python <<EOF
+  $ $PYTHON <<EOF
   > fp = open('logfile', 'w')
   > fp.write('12345678901234567890123456789012345678901234567890' +
   >          '12345') # there are 5 more columns for 80 columns
--- a/tests/test-imports-checker.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-imports-checker.t	Wed Jul 05 11:10:11 2017 -0500
@@ -8,7 +8,7 @@
 it's working correctly.
   $ TERM=dumb
   $ export TERM
-  $ python -m doctest $import_checker
+  $ $PYTHON -m doctest $import_checker
 
 Run additional tests for the import checker
 
--- a/tests/test-largefiles.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-largefiles.t	Wed Jul 05 11:10:11 2017 -0500
@@ -225,7 +225,7 @@
   $ . "$TESTDIR/cgienv"
 
   $ SCRIPT_NAME='' \
-  > python "$TESTTMP/hgweb.cgi" > /dev/null
+  > $PYTHON "$TESTTMP/hgweb.cgi" > /dev/null
 
 Test archiving the various revisions.  These hit corner cases known with
 archiving.
--- a/tests/test-log.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-log.t	Wed Jul 05 11:10:11 2017 -0500
@@ -1790,7 +1790,7 @@
   $ hg init problematicencoding
   $ cd problematicencoding
 
-  $ python > setup.sh <<EOF
+  $ $PYTHON > setup.sh <<EOF
   > print u'''
   > echo a > text
   > hg add text
@@ -1806,7 +1806,7 @@
   $ sh < setup.sh
 
 test in problematic encoding
-  $ python > test.sh <<EOF
+  $ $PYTHON > test.sh <<EOF
   > print u'''
   > hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2'
   > echo ====
--- a/tests/test-mq.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-mq.t	Wed Jul 05 11:10:11 2017 -0500
@@ -1584,7 +1584,7 @@
   $ PATH_INFO=/tags; export PATH_INFO
 #endif
   $ QUERY_STRING='style=raw'
-  $ python hgweb.cgi | grep '^tip'
+  $ $PYTHON hgweb.cgi | grep '^tip'
   tip	[0-9a-f]{40} (re)
 
   $ cd ..
--- a/tests/test-newcgi.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-newcgi.t	Wed Jul 05 11:10:11 2017 -0500
@@ -52,15 +52,15 @@
   $ chmod 755 hgwebdir.cgi
 
   $ . "$TESTDIR/cgienv"
-  $ python hgweb.cgi > page1
-  $ python hgwebdir.cgi > page2
+  $ $PYTHON hgweb.cgi > page1
+  $ $PYTHON hgwebdir.cgi > page2
 
   $ PATH_INFO="/test/"
   $ PATH_TRANSLATED="/var/something/test.cgi"
   $ REQUEST_URI="/test/test/"
   $ SCRIPT_URI="http://hg.omnifarious.org/test/test/"
   $ SCRIPT_URL="/test/test/"
-  $ python hgwebdir.cgi > page3
+  $ $PYTHON hgwebdir.cgi > page3
 
   $ grep -i error page1 page2 page3
   [1]
--- a/tests/test-newercgi.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-newercgi.t	Wed Jul 05 11:10:11 2017 -0500
@@ -46,15 +46,15 @@
   $ chmod 755 hgwebdir.cgi
 
   $ . "$TESTDIR/cgienv"
-  $ python hgweb.cgi > page1
-  $ python hgwebdir.cgi > page2
+  $ $PYTHON hgweb.cgi > page1
+  $ $PYTHON hgwebdir.cgi > page2
 
   $ PATH_INFO="/test/"
   $ PATH_TRANSLATED="/var/something/test.cgi"
   $ REQUEST_URI="/test/test/"
   $ SCRIPT_URI="http://hg.omnifarious.org/test/test/"
   $ SCRIPT_URL="/test/test/"
-  $ python hgwebdir.cgi > page3
+  $ $PYTHON hgwebdir.cgi > page3
 
   $ grep -i error page1 page2 page3
   [1]
--- a/tests/test-oldcgi.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-oldcgi.t	Wed Jul 05 11:10:11 2017 -0500
@@ -62,15 +62,15 @@
   $ chmod 755 hgwebdir.cgi
 
   $ . "$TESTDIR/cgienv"
-  $ python hgweb.cgi > page1
-  $ python hgwebdir.cgi > page2
+  $ $PYTHON hgweb.cgi > page1
+  $ $PYTHON hgwebdir.cgi > page2
 
   $ PATH_INFO="/test/"
   $ PATH_TRANSLATED="/var/something/test.cgi"
   $ REQUEST_URI="/test/test/"
   $ SCRIPT_URI="http://hg.omnifarious.org/test/test/"
   $ SCRIPT_URL="/test/test/"
-  $ python hgwebdir.cgi > page3
+  $ $PYTHON hgwebdir.cgi > page3
 
   $ grep -i error page1 page2 page3
   [1]
--- a/tests/test-parseindex.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-parseindex.t	Wed Jul 05 11:10:11 2017 -0500
@@ -66,7 +66,7 @@
 
   $ cd a
 
-  $ python <<EOF
+  $ $PYTHON <<EOF
   > from mercurial import changelog, vfs
   > cl = changelog.changelog(vfs.vfs('.hg/store'))
   > print 'good heads:'
@@ -128,7 +128,7 @@
   $ hg clone --pull -q --config phases.publish=False ../a segv
   $ rm -R limit/.hg/cache segv/.hg/cache
 
-  $ python <<EOF
+  $ $PYTHON <<EOF
   > data = open("limit/.hg/store/00changelog.i", "rb").read()
   > for n, p in [('limit', '\0\0\0\x02'), ('segv', '\0\x01\0\0')]:
   >     # corrupt p1 at rev0 and p2 at rev1
--- a/tests/test-purge.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-purge.t	Wed Jul 05 11:10:11 2017 -0500
@@ -49,7 +49,7 @@
 
   $ touch untracked_file
   $ touch untracked_file_readonly
-  $ python <<EOF
+  $ $PYTHON <<EOF
   > import os, stat
   > f= 'untracked_file_readonly'
   > os.chmod(f, stat.S_IMODE(os.stat(f).st_mode) & ~stat.S_IWRITE)
--- a/tests/test-push-cgi.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-push-cgi.t	Wed Jul 05 11:10:11 2017 -0500
@@ -38,7 +38,7 @@
 expect failure because heads doesn't match (formerly known as 'unsynced changes')
 
   $ QUERY_STRING="cmd=unbundle&heads=0000000000000000000000000000000000000000"; export QUERY_STRING
-  $ python hgweb.cgi <bundle.hg >page1 2>&1
+  $ $PYTHON hgweb.cgi <bundle.hg >page1 2>&1
   $ cat page1
   Status: 200 Script output follows\r (esc)
   Content-Type: application/mercurial-0.1\r (esc)
@@ -50,7 +50,7 @@
 successful force push
 
   $ QUERY_STRING="cmd=unbundle&heads=666f726365"; export QUERY_STRING
-  $ python hgweb.cgi <bundle.hg >page2 2>&1
+  $ $PYTHON hgweb.cgi <bundle.hg >page2 2>&1
   $ cat page2
   Status: 200 Script output follows\r (esc)
   Content-Type: application/mercurial-0.1\r (esc)
@@ -65,7 +65,7 @@
 successful push, list of heads
 
   $ QUERY_STRING="cmd=unbundle&heads=f7b1eb17ad24730a1651fccd46c43826d1bbc2ac"; export QUERY_STRING
-  $ python hgweb.cgi <bundle.hg >page3 2>&1
+  $ $PYTHON hgweb.cgi <bundle.hg >page3 2>&1
   $ cat page3
   Status: 200 Script output follows\r (esc)
   Content-Type: application/mercurial-0.1\r (esc)
@@ -80,7 +80,7 @@
 successful push, SHA1 hash of heads (unbundlehash capability)
 
   $ QUERY_STRING="cmd=unbundle&heads=686173686564 5a785a5f9e0d433b88ed862b206b011b0c3a9d13"; export QUERY_STRING
-  $ python hgweb.cgi <bundle.hg >page4 2>&1
+  $ $PYTHON hgweb.cgi <bundle.hg >page4 2>&1
   $ cat page4
   Status: 200 Script output follows\r (esc)
   Content-Type: application/mercurial-0.1\r (esc)
--- a/tests/test-push-race.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-push-race.t	Wed Jul 05 11:10:11 2017 -0500
@@ -91,7 +91,7 @@
 
   $ cat >> $HGRCPATH << EOF
   > [ui]
-  > ssh = python "$TESTDIR/dummyssh"
+  > ssh = $PYTHON "$TESTDIR/dummyssh"
   > # simplify output
   > logtemplate = {node|short} {desc} ({branch})
   > [phases]
--- a/tests/test-revset.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-revset.t	Wed Jul 05 11:10:11 2017 -0500
@@ -4180,7 +4180,7 @@
   $ hg init problematicencoding
   $ cd problematicencoding
 
-  $ python > setup.sh <<EOF
+  $ $PYTHON > setup.sh <<EOF
   > print u'''
   > echo a > text
   > hg add text
@@ -4196,7 +4196,7 @@
   $ sh < setup.sh
 
 test in problematic encoding
-  $ python > test.sh <<EOF
+  $ $PYTHON > test.sh <<EOF
   > print u'''
   > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)'
   > echo ====
--- a/tests/test-ssh-bundle1.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-ssh-bundle1.t	Wed Jul 05 11:10:11 2017 -0500
@@ -145,7 +145,7 @@
 
   $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
   $ echo "[ui]" >> .hg/hgrc
-  $ echo "ssh = python \"$TESTDIR/dummyssh\"" >> .hg/hgrc
+  $ echo "ssh = $PYTHON \"$TESTDIR/dummyssh\"" >> .hg/hgrc
 
 find outgoing
 
@@ -272,7 +272,7 @@
   > EOF
 
   $ echo '[hooks]' >> ../remote/.hg/hgrc
-  $ echo "changegroup.stdout = python $TESTTMP/badhook" >> ../remote/.hg/hgrc
+  $ echo "changegroup.stdout = $PYTHON $TESTTMP/badhook" >> ../remote/.hg/hgrc
   $ echo r > r
   $ hg ci -A -m z r
 
@@ -363,7 +363,7 @@
   > export SSH_ORIGINAL_COMMAND
   > PYTHONPATH="$PYTHONPATH"
   > export PYTHONPATH
-  > python "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
+  > $PYTHON "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
   > EOF
 
   $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
@@ -379,7 +379,7 @@
   abort: no suitable response from remote hg!
   [255]
 
-  $ SSH_ORIGINAL_COMMAND="'hg' serve -R 'a'repo' --stdio" python "$TESTDIR/../contrib/hg-ssh"
+  $ SSH_ORIGINAL_COMMAND="'hg' serve -R 'a'repo' --stdio" $PYTHON "$TESTDIR/../contrib/hg-ssh"
   Illegal command "'hg' serve -R 'a'repo' --stdio": No closing quotation
   [255]
 
@@ -391,7 +391,7 @@
   > export SSH_ORIGINAL_COMMAND
   > PYTHONPATH="$PYTHONPATH"
   > export PYTHONPATH
-  > python "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
+  > $PYTHON "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
   > EOF
 
   $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
@@ -440,7 +440,7 @@
   > [paths]
   > default-push = ssh://user@dummy/remote
   > [ui]
-  > ssh = python "$TESTDIR/dummyssh"
+  > ssh = $PYTHON "$TESTDIR/dummyssh"
   > [extensions]
   > localwrite = localwrite.py
   > EOF
@@ -461,7 +461,7 @@
 
   $ hg pull --debug ssh://user@dummy/remote
   pulling from ssh://user@dummy/remote
-  running python ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re)
+  running .* ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re)
   sending hello command
   sending between command
   remote: 355
--- a/tests/test-ssh.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-ssh.t	Wed Jul 05 11:10:11 2017 -0500
@@ -139,7 +139,7 @@
 
   $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
   $ echo "[ui]" >> .hg/hgrc
-  $ echo "ssh = python \"$TESTDIR/dummyssh\"" >> .hg/hgrc
+  $ echo "ssh = $PYTHON \"$TESTDIR/dummyssh\"" >> .hg/hgrc
 
 find outgoing
 
@@ -273,7 +273,7 @@
 
   $ cat <<EOF >> ../remote/.hg/hgrc
   > [hooks]
-  > changegroup.stdout = python $TESTTMP/badhook
+  > changegroup.stdout = $PYTHON $TESTTMP/badhook
   > changegroup.pystdout = python:$TESTTMP/badpyhook.py:hook
   > EOF
   $ echo r > r
@@ -380,7 +380,7 @@
   > export SSH_ORIGINAL_COMMAND
   > PYTHONPATH="$PYTHONPATH"
   > export PYTHONPATH
-  > python "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
+  > $PYTHON "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
   > EOF
 
   $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
@@ -396,7 +396,7 @@
   abort: no suitable response from remote hg!
   [255]
 
-  $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" python "$TESTDIR/../contrib/hg-ssh"
+  $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" $PYTHON "$TESTDIR/../contrib/hg-ssh"
   Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
   [255]
 
@@ -408,7 +408,7 @@
   > export SSH_ORIGINAL_COMMAND
   > PYTHONPATH="$PYTHONPATH"
   > export PYTHONPATH
-  > python "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
+  > $PYTHON "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
   > EOF
 
   $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
@@ -455,7 +455,7 @@
   > [paths]
   > default-push = ssh://user@dummy/remote
   > [ui]
-  > ssh = python "$TESTDIR/dummyssh"
+  > ssh = $PYTHON "$TESTDIR/dummyssh"
   > [extensions]
   > localwrite = localwrite.py
   > EOF
@@ -477,7 +477,7 @@
 
   $ hg pull --debug ssh://user@dummy/remote
   pulling from ssh://user@dummy/remote
-  running python ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re)
+  running .* ".*/dummyssh" user@dummy ('|")hg -R remote serve --stdio('|") (re)
   sending hello command
   sending between command
   remote: 355
--- a/tests/test-tag.t	Wed Jul 05 11:09:55 2017 -0500
+++ b/tests/test-tag.t	Wed Jul 05 11:10:11 2017 -0500
@@ -230,7 +230,7 @@
 Issue601: hg tag doesn't do the right thing if .hgtags or localtags
 doesn't end with EOL
 
-  $ python << EOF
+  $ $PYTHON << EOF
   > f = file('.hg/localtags'); last = f.readlines()[-1][:-1]; f.close()
   > f = file('.hg/localtags', 'w'); f.write(last); f.close()
   > EOF
@@ -242,7 +242,7 @@
   c2899151f4e76890c602a2597a650a72666681bf localnewline
   
 
-  $ python << EOF
+  $ $PYTHON << EOF
   > f = file('.hgtags'); last = f.readlines()[-1][:-1]; f.close()
   > f = file('.hgtags', 'w'); f.write(last); f.close()
   > EOF