py3: quote several instances of $PYTHON for Windows
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 09 Dec 2018 21:23:34 -0500
changeset 53637 07e181ed82efe7e4c61ea9dc0a58168cc81ba1c1
parent 53636 1aedbf3ef3d128eae75381775cfdc52e033d6ff3
child 53638 44378796c5e5eec7bc3bc3881a0399c8050ec712
push id1079
push usergszorc@mozilla.com
push dateMon, 10 Dec 2018 19:44:59 +0000
py3: quote several instances of $PYTHON for Windows Python3 lives in Program Files by default. The last remaining unquoted instance is in test-hghave.t. I can't figure out how to quote that, as it either complains: 'c:\\Program' is not recognized as an internal or external command, operable program or batch file. or $TESTTMP.sh: line 22: "C:/Program Files/Python37/python.exe": $ENOENT$
tests/test-extension.t
tests/test-filebranch.t
tests/test-import.t
tests/test-merge1.t
--- a/tests/test-extension.t
+++ b/tests/test-extension.t
@@ -160,17 +160,17 @@ Check that extensions are loaded in phas
   >     registrar,
   >     smartset,
   > )
   > revsetpredicate = registrar.revsetpredicate()
   > @revsetpredicate(bytesname, safe=True) # safe=True for query via hgweb
   > def custompredicate(repo, subset, x):
   >     return smartset.baseset([r for r in subset if r in {0}])
   > EOF
-  $ $PYTHON $TESTTMP/unflush.py foo.py
+  $ "$PYTHON" $TESTTMP/unflush.py foo.py
 
   $ cp foo.py bar.py
   $ echo 'foo = foo.py' >> $HGRCPATH
   $ echo 'bar = bar.py' >> $HGRCPATH
 
 Check normal command's load order of extensions and registration of functions
 
   $ hg log -r "foo() and bar()" -q
@@ -259,33 +259,33 @@ limit mark, regardless of importing modu
   > import ambig # should load "libroot/ambig.py"
   > s = ambig.s
   > NO_CHECK_EOF
   $ cat > loadabs.py <<NO_CHECK_EOF
   > import mod.ambigabs as ambigabs
   > def extsetup():
   >     print('ambigabs.s=%s' % ambigabs.s, flush=True)
   > NO_CHECK_EOF
-  $ $PYTHON $TESTTMP/unflush.py loadabs.py
+  $ "$PYTHON" $TESTTMP/unflush.py loadabs.py
   $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root)
   ambigabs.s=libroot/ambig.py
   $TESTTMP/a
 
 #if no-py3
   $ cat > $TESTTMP/libroot/mod/ambigrel.py <<NO_CHECK_EOF
   > from __future__ import print_function
   > import ambig # should load "libroot/mod/ambig.py"
   > s = ambig.s
   > NO_CHECK_EOF
   $ cat > loadrel.py <<NO_CHECK_EOF
   > import mod.ambigrel as ambigrel
   > def extsetup():
   >     print('ambigrel.s=%s' % ambigrel.s, flush=True)
   > NO_CHECK_EOF
-  $ $PYTHON $TESTTMP/unflush.py loadrel.py
+  $ "$PYTHON" $TESTTMP/unflush.py loadrel.py
   $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadrel=loadrel.py root)
   ambigrel.s=libroot/mod/ambig.py
   $TESTTMP/a
 #endif
 
 Check absolute/relative import of extension specific modules
 
   $ mkdir $TESTTMP/extroot
@@ -1820,17 +1820,17 @@ Prohibit the use of unicode strings as t
   > from __future__ import print_function
   > from mercurial import registrar
   > cmdtable = {}
   > command = registrar.command(cmdtable)
   > @command(b'dummy', [(b'', b'opt', u'value', u'help')], 'ext [OPTIONS]')
   > def ext(*args, **opts):
   >     print(opts[b'opt'], flush=True)
   > EOF
-  $ $PYTHON $TESTTMP/unflush.py $TESTTMP/test_unicode_default_value.py
+  $ "$PYTHON" $TESTTMP/unflush.py $TESTTMP/test_unicode_default_value.py
   $ cat > $TESTTMP/opt-unicode-default/.hg/hgrc << EOF
   > [extensions]
   > test_unicode_default_value = $TESTTMP/test_unicode_default_value.py
   > EOF
   $ hg -R $TESTTMP/opt-unicode-default dummy
   *** failed to import extension test_unicode_default_value from $TESTTMP/test_unicode_default_value.py: unicode *'value' found in cmdtable.dummy (glob)
   *** (use b'' to make it byte string)
   hg: unknown command 'dummy'
--- a/tests/test-filebranch.t
+++ b/tests/test-filebranch.t
@@ -1,17 +1,17 @@
 This test makes sure that we don't mark a file as merged with its ancestor
 when we do a merge.
 
   $ cat <<EOF > merge
   > from __future__ import print_function
   > import sys, os
   > print("merging for", os.path.basename(sys.argv[1]))
   > EOF
-  $ HGMERGE="$PYTHON ../merge"; export HGMERGE
+  $ HGMERGE="\"$PYTHON\" ../merge"; export HGMERGE
 
 Creating base:
 
   $ hg init a
   $ cd a
   $ echo 1 > foo
   $ echo 1 > bar
   $ echo 1 > baz
--- a/tests/test-import.t
+++ b/tests/test-import.t
@@ -61,17 +61,17 @@ regardless of the commit message in the 
   $ hg clone -r0 a b
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 2 changes to 2 files
   new changesets 80971e65b431
   updating to branch default
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ HGEDITOR=cat hg --config ui.patch="$PYTHON ../dummypatch.py" --cwd b import --edit ../exported-tip.patch
+  $ HGEDITOR=cat hg --config ui.patch="\"$PYTHON\" ../dummypatch.py" --cwd b import --edit ../exported-tip.patch
   applying ../exported-tip.patch
   second change
   
   
   HG: Enter commit message.  Lines beginning with 'HG:' are removed.
   HG: Leave message empty to abort commit.
   HG: --
   HG: user: someone
--- a/tests/test-merge1.t
+++ b/tests/test-merge1.t
@@ -6,17 +6,17 @@
   >     import msvcrt
   >     msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
   >     msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
   > except ImportError:
   >     pass
   > 
   > print("merging for", os.path.basename(sys.argv[1]))
   > EOF
-  $ HGMERGE="$PYTHON ../merge"; export HGMERGE
+  $ HGMERGE="\"$PYTHON\" ../merge"; export HGMERGE
 
   $ hg init t
   $ cd t
   $ echo This is file a1 > a
   $ hg add a
   $ hg commit -m "commit #0"
   $ echo This is file b1 > b
   $ hg add b