tests: use $PYTHON in #! so we always use the right Python

This commit is contained in:
Augie Fackler 2017-06-15 14:27:52 -04:00
parent fa569dd767
commit 305e834562
10 changed files with 13 additions and 13 deletions

View File

@ -453,7 +453,7 @@ assuming that the shell returns 127 if command not found ...
test bisecting command
$ cat > script.py <<EOF
> #!/usr/bin/env python
> #!$PYTHON
> import sys
> from mercurial import ui, hg
> repo = hg.repository(ui.ui.load(), '.')

View File

@ -249,7 +249,7 @@ Edit with extdiff -p:
Prepare custom diff/edit tool:
$ cat > 'diff tool.py' << EOT
> #!/usr/bin/env python
> #!$PYTHON
> import time
> time.sleep(1) # avoid unchanged-timestamp problems
> file('a/a', 'ab').write('edited\n')

View File

@ -98,7 +98,7 @@ Command with no output, we just want to see the extensions loaded:
Check hgweb's load order:
$ cat > hgweb.cgi <<EOF
> #!/usr/bin/env python
> #!$PYTHON
> from mercurial import demandimport; demandimport.enable()
> from mercurial.hgweb import hgweb
> from mercurial.hgweb import wsgicgi

View File

@ -956,7 +956,7 @@ We attempt to highlight unknown files by default
> EOF
$ cat > unknownfile << EOF
> #!/usr/bin/python
> #!$PYTHON
> def foo():
> pass
> EOF

View File

@ -93,7 +93,7 @@ Verify that largefiles from pulled branchheads are fetched, also to an empty rep
Portable way to print file permissions:
$ cat > ls-l.py <<EOF
> #!/usr/bin/env python
> #!$PYTHON
> import sys, os
> path = sys.argv[1]
> print '%03o' % (os.lstat(path).st_mode & 0777)

View File

@ -215,7 +215,7 @@ Test display of largefiles in hgweb
Test largefiles can be loaded in hgweb (wrapcommand() shouldn't fail)
$ cat <<EOF > "$TESTTMP/hgweb.cgi"
> #!/usr/bin/env python
> #!$PYTHON
> from mercurial import demandimport; demandimport.enable()
> from mercurial.hgweb import hgweb
> from mercurial.hgweb import wsgicgi

View File

@ -1,5 +1,5 @@
$ cat > echo.py <<EOF
> #!/usr/bin/env python
> #!$PYTHON
> import os, sys
> try:
> import msvcrt

View File

@ -5,7 +5,7 @@ before d74fc8dec2b4 still work.
$ hg init test
$ cat >hgweb.cgi <<HGWEB
> #!/usr/bin/env python
> #!$PYTHON
> #
> # An example CGI script to use hgweb, edit as necessary
>
@ -31,7 +31,7 @@ before d74fc8dec2b4 still work.
> HGWEBDIRCONF
$ cat >hgwebdir.cgi <<HGWEBDIR
> #!/usr/bin/env python
> #!$PYTHON
> #
> # An example CGI script to export multiple hgweb repos, edit as necessary
>

View File

@ -5,7 +5,7 @@ This is a rudimentary test of the CGI files as of d74fc8dec2b4.
$ hg init test
$ cat >hgweb.cgi <<HGWEB
> #!/usr/bin/env python
> #!$PYTHON
> #
> # An example CGI script to use hgweb, edit as necessary
>
@ -28,7 +28,7 @@ This is a rudimentary test of the CGI files as of d74fc8dec2b4.
> HGWEBDIRCONF
$ cat >hgwebdir.cgi <<HGWEBDIR
> #!/usr/bin/env python
> #!$PYTHON
> #
> # An example CGI script to export multiple hgweb repos, edit as necessary
>

View File

@ -4,7 +4,7 @@ This tests if CGI files from before d0db3462d568 still work.
$ hg init test
$ cat >hgweb.cgi <<HGWEB
> #!/usr/bin/env python
> #!$PYTHON
> #
> # An example CGI script to use hgweb, edit as necessary
>
@ -26,7 +26,7 @@ This tests if CGI files from before d0db3462d568 still work.
> HGWEBDIRCONF
$ cat >hgwebdir.cgi <<HGWEBDIR
> #!/usr/bin/env python
> #!$PYTHON
> #
> # An example CGI script to export multiple hgweb repos, edit as necessary
>