Work around problem where 'del os.environ["FOO"]' doesn't update environment.
authorThomas Arendsen Hein <thomas@intevation.de>
Thu, 19 Apr 2007 13:04:26 +0200
changeset 4368 97962a3e73cf
parent 4367 c6413f8f2f8e
child 4369 bf8319ee3428
Work around problem where 'del os.environ["FOO"]' doesn't update environment. test-hook failed since changeset 949516072388 because of this on Solaris 8.
tests/test-hook
--- a/tests/test-hook	Thu Apr 19 12:47:55 2007 +0200
+++ b/tests/test-hook	Thu Apr 19 13:04:26 2007 +0200
@@ -6,10 +6,10 @@
 hg init a
 cd a
 echo "[hooks]" > .hg/hgrc
-echo 'commit = python ../printenv.py commit' >> .hg/hgrc
-echo 'commit.b = python ../printenv.py commit.b' >> .hg/hgrc
-echo 'precommit = python ../printenv.py precommit' >> .hg/hgrc
-echo 'pretxncommit = python ../printenv.py pretxncommit' >> .hg/hgrc
+echo 'commit = unset HG_LOCAL HG_TAG; python ../printenv.py commit' >> .hg/hgrc
+echo 'commit.b = unset HG_LOCAL HG_TAG; python ../printenv.py commit.b' >> .hg/hgrc
+echo 'precommit = unset HG_LOCAL HG_NODE HG_TAG; python ../printenv.py precommit' >> .hg/hgrc
+echo 'pretxncommit = unset HG_LOCAL HG_TAG; python ../printenv.py pretxncommit' >> .hg/hgrc
 echo 'pretxncommit.tip = hg -q tip' >> .hg/hgrc
 echo a > a
 hg add a
@@ -41,7 +41,7 @@
 # tag hooks can see env vars
 cd ../a
 echo 'pretag = python ../printenv.py pretag' >> .hg/hgrc
-echo 'tag = python ../printenv.py tag' >> .hg/hgrc
+echo 'tag = unset HG_PARENT1 HG_PARENT2; python ../printenv.py tag' >> .hg/hgrc
 hg tag -d '3 0' a
 hg tag -l la