diff tests/test-hook @ 4070:961ccb615cf7

Handle functions as the value of a hooks.<name> config variable This should make it easier for extensions to add a hook when they're loaded.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Fri, 09 Feb 2007 03:48:28 -0200
parents 109a22f5434a
children 719488a98ebe
line wrap: on
line diff
--- a/tests/test-hook	Fri Feb 09 03:48:26 2007 -0200
+++ b/tests/test-hook	Fri Feb 09 03:48:28 2007 -0200
@@ -183,4 +183,24 @@
 echo a >> a
 hg --traceback commit -A -m a 2>&1 | grep '^Traceback'
 
+cd ..
+hg init c
+cd c
+
+cat > hookext.py <<EOF
+def autohook(**args):
+    print "Automatically installed hook"
+
+def reposetup(ui, repo):
+    repo.ui.setconfig("hooks", "commit.auto", autohook)
+EOF
+echo '[extensions]' >> .hg/hgrc
+echo 'hookext = hookext.py' >> .hg/hgrc
+
+touch foo
+hg add foo
+hg ci -m 'add foo'
+echo >> foo
+hg ci --debug -m 'change foo' | sed -e 's/ at .*>/>/'
+
 exit 0