Add commit hook test
authorChristian Ebert <blacktrash@gmx.net>
Sat, 10 Nov 2007 14:08:12 +0100
changeset 294 343c5dd8dcda
parent 293 a7d568671575
child 296 869b16d09eec
Add commit hook test
tests/test-keyword
tests/test-keyword.out
--- a/tests/test-keyword	Sat Nov 10 14:06:59 2007 +0100
+++ b/tests/test-keyword	Sat Nov 10 14:08:12 2007 +0100
@@ -6,6 +6,9 @@
 [keyword]
 * =
 b = ignore
+[hooks]
+commit=
+commit.test=cp a hooktest
 EOF
 
 echo % help
@@ -37,7 +40,7 @@
 echo % cat
 cat sym a b
 
-echo % default keyword expansion
+echo % default keyword expansion including commit hook
 echo % commit
 hg --debug commit -A -mabsym -d '0 0' -u 'User Name <user@example.com>'
 echo % status
@@ -50,6 +53,15 @@
 hg cat sym a b
 
 echo
+echo % diff a hooktest
+diff a hooktest
+
+echo % removing commit hook from config
+sed -e '/\[hooks\]/,$ d' $HGRCPATH > $HGRCPATH.nohook
+mv $HGRCPATH.nohook $HGRCPATH
+rm hooktest
+
+echo
 echo % touch
 touch a b
 echo % status
--- a/tests/test-keyword.out	Sat Nov 10 14:06:59 2007 +0100
+++ b/tests/test-keyword.out	Sat Nov 10 14:08:12 2007 +0100
@@ -96,7 +96,7 @@
 do not process $Id:
 xxx $
 ignore $Id$
-% default keyword expansion
+% default keyword expansion including commit hook
 % commit
 adding a
 adding b
@@ -105,7 +105,9 @@
 b
 sym
 overwriting a expanding keywords
+running hook commit.test: cp a hooktest
 % status
+? hooktest
 % identify
 f782df5f9602
 % cat
@@ -122,6 +124,9 @@
 xxx $
 ignore $Id$
 a
+% diff a hooktest
+% removing commit hook from config
+
 % touch
 % status
 % update