tests: simplify printenv calls
Make printenv executable so that we don't need python, TESTDIR, or
quoting.
--- a/tests/test-bundle.t Mon Jun 08 17:34:45 2015 -0500
+++ b/tests/test-bundle.t Mon Jun 08 15:10:15 2015 -0500
@@ -211,7 +211,7 @@
Pull ../full.hg into empty (with hook)
$ echo "[hooks]" >> .hg/hgrc
- $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup" >> .hg/hgrc
+ $ echo "changegroup = printenv.py changegroup" >> .hg/hgrc
doesn't work (yet ?)
--- a/tests/test-bundle2-exchange.t Mon Jun 08 17:34:45 2015 -0500
+++ b/tests/test-bundle2-exchange.t Mon Jun 08 15:10:15 2015 -0500
@@ -28,7 +28,7 @@
> [hooks]
> pretxnclose.tip = hg log -r tip -T "pre-close-tip:{node|short} {phase} {bookmarks}\n"
> txnclose.tip = hg log -r tip -T "postclose-tip:{node|short} {phase} {bookmarks}\n"
- > txnclose.env = sh -c "HG_LOCAL= python \"$TESTDIR/printenv.py\" txnclose"
+ > txnclose.env = sh -c "HG_LOCAL= printenv.py txnclose"
> pushkey= sh "$TESTTMP/bundle2-pushkey-hook.sh"
> EOF
--- a/tests/test-bundle2-multiple-changegroups.t Mon Jun 08 17:34:45 2015 -0500
+++ b/tests/test-bundle2-multiple-changegroups.t Mon Jun 08 15:10:15 2015 -0500
@@ -67,9 +67,9 @@
$ cd ../clone
$ cat >> .hg/hgrc <<EOF
> [hooks]
- > pretxnchangegroup = sh -c "python \"$TESTDIR/printenv.py\" pretxnchangegroup"
- > changegroup = sh -c "python \"$TESTDIR/printenv.py\" changegroup"
- > incoming = sh -c "python \"$TESTDIR/printenv.py\" incoming"
+ > pretxnchangegroup = sh -c "printenv.py pretxnchangegroup"
+ > changegroup = sh -c "printenv.py changegroup"
+ > incoming = sh -c "printenv.py incoming"
> EOF
Pull the new commits in the clone
--- a/tests/test-hook.t Mon Jun 08 17:34:45 2015 -0500
+++ b/tests/test-hook.t Mon Jun 08 15:10:15 2015 -0500
@@ -17,19 +17,19 @@
$ cd a
$ cat > .hg/hgrc <<EOF
> [hooks]
- > commit = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" commit"
- > commit.b = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" commit.b"
- > precommit = sh -c "HG_LOCAL= HG_NODE= HG_TAG= python \"$TESTDIR/printenv.py\" precommit"
- > pretxncommit = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" pretxncommit"
+ > commit = sh -c "HG_LOCAL= HG_TAG= printenv.py commit"
+ > commit.b = sh -c "HG_LOCAL= HG_TAG= printenv.py commit.b"
+ > precommit = sh -c "HG_LOCAL= HG_NODE= HG_TAG= printenv.py precommit"
+ > pretxncommit = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxncommit"
> pretxncommit.tip = hg -q tip
- > pre-identify = python "$TESTDIR/printenv.py" pre-identify 1
- > pre-cat = python "$TESTDIR/printenv.py" pre-cat
- > post-cat = python "$TESTDIR/printenv.py" post-cat
- > pretxnopen = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" pretxnopen"
- > pretxnclose = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" pretxnclose"
- > txnclose = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" txnclose"
+ > pre-identify = printenv.py pre-identify 1
+ > pre-cat = printenv.py pre-cat
+ > post-cat = printenv.py post-cat
+ > pretxnopen = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxnopen"
+ > pretxnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxnclose"
+ > txnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py txnclose"
> txnabort.0 = python:$TESTTMP/txnabort.checkargs.py:showargs
- > txnabort.1 = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" txnabort"
+ > txnabort.1 = sh -c "HG_LOCAL= HG_TAG= printenv.py txnabort"
> txnclose.checklock = sh -c "hg debuglock > /dev/null"
> EOF
$ echo a > a
@@ -53,9 +53,9 @@
$ cat > .hg/hgrc <<EOF
> [hooks]
- > prechangegroup = python "$TESTDIR/printenv.py" prechangegroup
- > changegroup = python "$TESTDIR/printenv.py" changegroup
- > incoming = python "$TESTDIR/printenv.py" incoming
+ > prechangegroup = printenv.py prechangegroup
+ > changegroup = printenv.py changegroup
+ > incoming = printenv.py incoming
> EOF
pretxncommit and commit hooks can see both parents of merge
@@ -128,8 +128,8 @@
$ cd ../a
$ cat >> .hg/hgrc <<EOF
- > pretag = python "$TESTDIR/printenv.py" pretag
- > tag = sh -c "HG_PARENT1= HG_PARENT2= python \"$TESTDIR/printenv.py\" tag"
+ > pretag = printenv.py pretag
+ > tag = sh -c "HG_PARENT1= HG_PARENT2= printenv.py tag"
> EOF
$ hg tag -d '3 0' a
pretag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a
@@ -148,7 +148,7 @@
pretag hook can forbid tagging
- $ echo "pretag.forbid = python \"$TESTDIR/printenv.py\" pretag.forbid 1" >> .hg/hgrc
+ $ echo "pretag.forbid = printenv.py pretag.forbid 1" >> .hg/hgrc
$ hg tag -d '4 0' fa
pretag hook: HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa
pretag.forbid hook: HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa
@@ -164,7 +164,7 @@
more there after
$ echo "pretxncommit.forbid0 = hg tip -q" >> .hg/hgrc
- $ echo "pretxncommit.forbid1 = python \"$TESTDIR/printenv.py\" pretxncommit.forbid 1" >> .hg/hgrc
+ $ echo "pretxncommit.forbid1 = printenv.py pretxncommit.forbid 1" >> .hg/hgrc
$ echo z > z
$ hg add z
$ hg -q tip
@@ -202,7 +202,7 @@
precommit hook can prevent commit
- $ echo "precommit.forbid = python \"$TESTDIR/printenv.py\" precommit.forbid 1" >> .hg/hgrc
+ $ echo "precommit.forbid = printenv.py precommit.forbid 1" >> .hg/hgrc
$ hg commit -m 'fail' -d '4 0'
precommit hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
precommit.forbid hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
@@ -213,14 +213,14 @@
preupdate hook can prevent update
- $ echo "preupdate = python \"$TESTDIR/printenv.py\" preupdate" >> .hg/hgrc
+ $ echo "preupdate = printenv.py preupdate" >> .hg/hgrc
$ hg update 1
preupdate hook: HG_PARENT1=ab228980c14d
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
update hook
- $ echo "update = python \"$TESTDIR/printenv.py\" update" >> .hg/hgrc
+ $ echo "update = printenv.py update" >> .hg/hgrc
$ hg update
preupdate hook: HG_PARENT1=539e4b31b6dc
update hook: HG_ERROR=0 HG_PARENT1=539e4b31b6dc
@@ -228,7 +228,7 @@
pushkey hook
- $ echo "pushkey = python \"$TESTDIR/printenv.py\" pushkey" >> .hg/hgrc
+ $ echo "pushkey = printenv.py pushkey" >> .hg/hgrc
$ cd ../b
$ hg bookmark -r null foo
$ hg push -B foo ../a
@@ -245,7 +245,7 @@
listkeys hook
- $ echo "listkeys = python \"$TESTDIR/printenv.py\" listkeys" >> .hg/hgrc
+ $ echo "listkeys = printenv.py listkeys" >> .hg/hgrc
$ hg bookmark -r null bar
$ cd ../b
$ hg pull -B bar ../a
@@ -259,7 +259,7 @@
test that prepushkey can prevent incoming keys
- $ echo "prepushkey = python \"$TESTDIR/printenv.py\" prepushkey.forbid 1" >> .hg/hgrc
+ $ echo "prepushkey = printenv.py prepushkey.forbid 1" >> .hg/hgrc
$ cd ../b
$ hg bookmark -r null baz
$ hg push -B baz ../a
@@ -280,7 +280,7 @@
test that prelistkeys can prevent listing keys
- $ echo "prelistkeys = python \"$TESTDIR/printenv.py\" prelistkeys.forbid 1" >> .hg/hgrc
+ $ echo "prelistkeys = printenv.py prelistkeys.forbid 1" >> .hg/hgrc
$ hg bookmark -r null quux
$ cd ../b
$ hg pull -B quux ../a
@@ -298,7 +298,7 @@
3:07f3376c1e65
$ cat > .hg/hgrc <<EOF
> [hooks]
- > prechangegroup.forbid = python "$TESTDIR/printenv.py" prechangegroup.forbid 1
+ > prechangegroup.forbid = printenv.py prechangegroup.forbid 1
> EOF
$ hg pull ../a
pulling from ../a
@@ -313,7 +313,7 @@
$ cat > .hg/hgrc <<EOF
> [hooks]
> pretxnchangegroup.forbid0 = hg tip -q
- > pretxnchangegroup.forbid1 = python "$TESTDIR/printenv.py" pretxnchangegroup.forbid 1
+ > pretxnchangegroup.forbid1 = printenv.py pretxnchangegroup.forbid 1
> EOF
$ hg pull ../a
pulling from ../a
@@ -336,8 +336,8 @@
$ rm .hg/hgrc
$ cat > ../a/.hg/hgrc <<EOF
> [hooks]
- > preoutgoing = python "$TESTDIR/printenv.py" preoutgoing
- > outgoing = python "$TESTDIR/printenv.py" outgoing
+ > preoutgoing = printenv.py preoutgoing
+ > outgoing = printenv.py outgoing
> EOF
$ hg pull ../a
pulling from ../a
@@ -355,7 +355,7 @@
preoutgoing hook can prevent outgoing changes
- $ echo "preoutgoing.forbid = python \"$TESTDIR/printenv.py\" preoutgoing.forbid 1" >> ../a/.hg/hgrc
+ $ echo "preoutgoing.forbid = printenv.py preoutgoing.forbid 1" >> ../a/.hg/hgrc
$ hg pull ../a
pulling from ../a
searching for changes
@@ -369,8 +369,8 @@
$ cd ..
$ cat > a/.hg/hgrc <<EOF
> [hooks]
- > preoutgoing = python "$TESTDIR/printenv.py" preoutgoing
- > outgoing = python "$TESTDIR/printenv.py" outgoing
+ > preoutgoing = printenv.py preoutgoing
+ > outgoing = printenv.py outgoing
> EOF
$ hg clone a c
preoutgoing hook: HG_SOURCE=clone
@@ -381,7 +381,7 @@
preoutgoing hook can prevent outgoing changes for local clones
- $ echo "preoutgoing.forbid = python \"$TESTDIR/printenv.py\" preoutgoing.forbid 1" >> a/.hg/hgrc
+ $ echo "preoutgoing.forbid = printenv.py preoutgoing.forbid 1" >> a/.hg/hgrc
$ hg clone a zzz
preoutgoing hook: HG_SOURCE=clone
preoutgoing.forbid hook: HG_SOURCE=clone
--- a/tests/test-http-bundle1.t Mon Jun 08 17:34:45 2015 -0500
+++ b/tests/test-http-bundle1.t Mon Jun 08 15:10:15 2015 -0500
@@ -128,7 +128,7 @@
$ cd copy-pull
$ echo '[hooks]' >> .hg/hgrc
- $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup" >> .hg/hgrc
+ $ echo "changegroup = printenv.py changegroup" >> .hg/hgrc
$ hg pull
pulling from http://localhost:$HGPORT1/
searching for changes
--- a/tests/test-http.t Mon Jun 08 17:34:45 2015 -0500
+++ b/tests/test-http.t Mon Jun 08 15:10:15 2015 -0500
@@ -119,7 +119,7 @@
$ cd copy-pull
$ echo '[hooks]' >> .hg/hgrc
- $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup" >> .hg/hgrc
+ $ echo "changegroup = printenv.py changegroup" >> .hg/hgrc
$ hg pull
pulling from http://localhost:$HGPORT1/
searching for changes
--- a/tests/test-https.t Mon Jun 08 17:34:45 2015 -0500
+++ b/tests/test-https.t Mon Jun 08 15:10:15 2015 -0500
@@ -201,7 +201,7 @@
$ cd copy-pull
$ echo '[hooks]' >> .hg/hgrc
- $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup" >> .hg/hgrc
+ $ echo "changegroup = printenv.py changegroup" >> .hg/hgrc
$ hg pull $DISABLEOSXDUMMYCERT
pulling from https://localhost:$HGPORT/
warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
--- a/tests/test-push-http-bundle1.t Mon Jun 08 17:34:45 2015 -0500
+++ b/tests/test-push-http-bundle1.t Mon Jun 08 15:10:15 2015 -0500
@@ -68,8 +68,8 @@
$ echo 'allow_push = *' >> .hg/hgrc
$ echo '[hooks]' >> .hg/hgrc
- $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup 0" >> .hg/hgrc
- $ echo "pushkey = python \"$TESTDIR/printenv.py\" pushkey 0" >> .hg/hgrc
+ $ echo "changegroup = printenv.py changegroup 0" >> .hg/hgrc
+ $ echo "pushkey = printenv.py pushkey 0" >> .hg/hgrc
$ req
pushing to http://localhost:$HGPORT/
searching for changes
@@ -121,7 +121,7 @@
> push_ssl = false
> allow_push = *
> [hooks]
- > prepushkey = python "$TESTDIR/printenv.py" prepushkey 1
+ > prepushkey = printenv.py prepushkey 1
> EOF
$ req
pushing to http://localhost:$HGPORT/
@@ -134,7 +134,7 @@
expect phase change success
- $ echo "prepushkey = python \"$TESTDIR/printenv.py\" prepushkey 0" >> .hg/hgrc
+ $ echo "prepushkey = printenv.py prepushkey 0" >> .hg/hgrc
$ req
pushing to http://localhost:$HGPORT/
searching for changes
--- a/tests/test-push-http.t Mon Jun 08 17:34:45 2015 -0500
+++ b/tests/test-push-http.t Mon Jun 08 15:10:15 2015 -0500
@@ -58,8 +58,8 @@
$ echo 'allow_push = *' >> .hg/hgrc
$ echo '[hooks]' >> .hg/hgrc
- $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup 0" >> .hg/hgrc
- $ echo "pushkey = python \"$TESTDIR/printenv.py\" pushkey 0" >> .hg/hgrc
+ $ echo "changegroup = printenv.py changegroup 0" >> .hg/hgrc
+ $ echo "pushkey = printenv.py pushkey 0" >> .hg/hgrc
$ req
pushing to http://localhost:$HGPORT/
searching for changes
@@ -114,7 +114,7 @@
> push_ssl = false
> allow_push = *
> [hooks]
- > prepushkey = python "$TESTDIR/printenv.py" prepushkey 1
+ > prepushkey = printenv.py prepushkey 1
> EOF
$ req
pushing to http://localhost:$HGPORT/
@@ -130,7 +130,7 @@
expect phase change success
- $ echo "prepushkey = python \"$TESTDIR/printenv.py\" prepushkey 0" >> .hg/hgrc
+ $ echo "prepushkey = printenv.py prepushkey 0" >> .hg/hgrc
$ req
pushing to http://localhost:$HGPORT/
searching for changes
--- a/tests/test-ssh-bundle1.t Mon Jun 08 17:34:45 2015 -0500
+++ b/tests/test-ssh-bundle1.t Mon Jun 08 15:10:15 2015 -0500
@@ -36,7 +36,7 @@
> uncompressed = True
>
> [hooks]
- > changegroup = python "$TESTDIR/printenv.py" changegroup-in-remote 0 ../dummylog
+ > changegroup = printenv.py changegroup-in-remote 0 ../dummylog
> EOF
$ cd ..
@@ -113,7 +113,7 @@
checking files
2 files, 3 changesets, 2 total revisions
$ echo '[hooks]' >> .hg/hgrc
- $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup-in-local 0 ../dummylog" >> .hg/hgrc
+ $ echo "changegroup = printenv.py changegroup-in-local 0 ../dummylog" >> .hg/hgrc
empty default pull
--- a/tests/test-ssh.t Mon Jun 08 17:34:45 2015 -0500
+++ b/tests/test-ssh.t Mon Jun 08 15:10:15 2015 -0500
@@ -27,7 +27,7 @@
> uncompressed = True
>
> [hooks]
- > changegroup = python "$TESTDIR/printenv.py" changegroup-in-remote 0 ../dummylog
+ > changegroup = printenv.py changegroup-in-remote 0 ../dummylog
> EOF
$ cd ..
@@ -104,7 +104,7 @@
checking files
2 files, 3 changesets, 2 total revisions
$ echo '[hooks]' >> .hg/hgrc
- $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup-in-local 0 ../dummylog" >> .hg/hgrc
+ $ echo "changegroup = printenv.py changegroup-in-local 0 ../dummylog" >> .hg/hgrc
empty default pull
--- a/tests/test-static-http.t Mon Jun 08 17:34:45 2015 -0500
+++ b/tests/test-static-http.t Mon Jun 08 15:10:15 2015 -0500
@@ -60,7 +60,7 @@
$ rm .hg/cache/*
$ cd ../local
$ echo '[hooks]' >> .hg/hgrc
- $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup" >> .hg/hgrc
+ $ echo "changegroup = printenv.py changegroup" >> .hg/hgrc
$ hg pull
pulling from static-http://localhost:$HGPORT/remote
searching for changes