# HG changeset patch # User Henri Wiechers # Date 2009-06-26 12:42:05 # Node ID 87c05a78e58873f6c36cdead9c9c3b277dfc670a # Parent 21b29f4c7c9febb958d783bee555e7f2ac7e12c6 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). diff --git a/tests/test-hook b/tests/test-hook --- a/tests/test-hook +++ b/tests/test-hook @@ -230,4 +230,22 @@ hg ci --debug -m 'change foo' | sed -e ' 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 < ../repo/.hg/hgrc +echo "pre-commit.test = python:`pwd`/testhooks.py:testhook" >> ../repo/.hg/hgrc + +cd ../repo +hg commit + exit 0 diff --git a/tests/test-hook.out b/tests/test-hook.out --- a/tests/test-hook.out +++ b/tests/test-hook.out @@ -160,3 +160,6 @@ calling hook commit.auto: +# test python hook configured with python:[file]:[hook] syntax +hook works +nothing changed