comparison 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
comparison
equal deleted inserted replaced
4069:3fef134832d8 4070:961ccb615cf7
181 echo 'commit.abort = python:hooktests.aborthook' >> .hg/hgrc 181 echo 'commit.abort = python:hooktests.aborthook' >> .hg/hgrc
182 182
183 echo a >> a 183 echo a >> a
184 hg --traceback commit -A -m a 2>&1 | grep '^Traceback' 184 hg --traceback commit -A -m a 2>&1 | grep '^Traceback'
185 185
186 cd ..
187 hg init c
188 cd c
189
190 cat > hookext.py <<EOF
191 def autohook(**args):
192 print "Automatically installed hook"
193
194 def reposetup(ui, repo):
195 repo.ui.setconfig("hooks", "commit.auto", autohook)
196 EOF
197 echo '[extensions]' >> .hg/hgrc
198 echo 'hookext = hookext.py' >> .hg/hgrc
199
200 touch foo
201 hg add foo
202 hg ci -m 'add foo'
203 echo >> foo
204 hg ci --debug -m 'change foo' | sed -e 's/ at .*>/>/'
205
186 exit 0 206 exit 0