Mercurial > hg-stable
diff tests/test-hook @ 9014:87c05a78e588
test python hook configured with python:[file]:[hook] syntax
Adds a test for python hooks configured with python:[file]:[hook] syntax
in .hgrc. Increases the test coverage for mercurial/hook from 92% (79/85)
to 96% (82/85).
author | Henri Wiechers <hwiechers@gmail.com> |
---|---|
date | Fri, 26 Jun 2009 14:42:05 +0200 |
parents | e9ef409e6399 |
children | 9e7b2c49d25d |
line wrap: on
line diff
--- a/tests/test-hook Mon Jun 29 23:46:28 2009 +0200 +++ b/tests/test-hook Fri Jun 26 14:42:05 2009 +0200 @@ -230,4 +230,22 @@ hg showconfig hooks | sed -e 's/ at .*>/>/' +echo '# test python hook configured with python:[file]:[hook] syntax' +cd .. +mkdir d +cd d +hg init repo +mkdir hooks + +cd hooks +cat > testhooks.py <<EOF +def testhook(**args): + print 'hook works' +EOF +echo '[hooks]' > ../repo/.hg/hgrc +echo "pre-commit.test = python:`pwd`/testhooks.py:testhook" >> ../repo/.hg/hgrc + +cd ../repo +hg commit + exit 0