# HG changeset patch # User Thomas Arendsen Hein # Date 1182233875 -7200 # Node ID 73bf2b586f3f0d2e39c714a2ce84f6e760c42e3c # Parent ff7253a0d1da5fdf6540d6db9c8d794840ea9bce Use printenv.py for pre/post-command-hooks (fixes tests on Solaris, too) diff --git a/tests/test-hook b/tests/test-hook --- a/tests/test-hook +++ b/tests/test-hook @@ -11,9 +11,9 @@ echo 'commit.b = unset HG_LOCAL HG_TAG; 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 'pre-identify = false' >> .hg/hgrc -echo 'pre-cat = echo "meow $HG_ARGS"' >> .hg/hgrc -echo 'post-cat = echo "purr $HG_RESULT"' >> .hg/hgrc +echo 'pre-identify = python ../printenv.py pre-identify 1' >> .hg/hgrc +echo 'pre-cat = python ../printenv.py pre-cat' >> .hg/hgrc +echo 'post-cat = python ../printenv.py post-cat' >> .hg/hgrc echo a > a hg add a hg commit -m a -d "1000000 0" diff --git a/tests/test-hook.out b/tests/test-hook.out --- a/tests/test-hook.out +++ b/tests/test-hook.out @@ -22,9 +22,10 @@ pretxncommit hook: HG_NODE=4c52fb2e40228 3:4c52fb2e4022 commit hook: HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_PARENT1=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT2=b702efe9688826e3a91283852b328b84dbf37bc2 commit.b hook: HG_NODE=4c52fb2e402287dd5dc052090682536c8406c321 HG_PARENT1=1324a5531bac09b329c3845d35ae6a7526874edb HG_PARENT2=b702efe9688826e3a91283852b328b84dbf37bc2 +pre-identify hook: HG_ARGS=id warning: pre-identify hook exited with status 1 -meow cat b -purr 0 +pre-cat hook: HG_ARGS=cat b +post-cat hook: HG_ARGS=cat b HG_RESULT=0 b prechangegroup hook: HG_SOURCE=pull HG_URL=file: changegroup hook: HG_NODE=b702efe9688826e3a91283852b328b84dbf37bc2 HG_SOURCE=pull HG_URL=file: