Mercurial > public > mercurial-scm > hg-stable
diff tests/test-hook @ 2221:05b6c13f43c6
reverse sense of return value from python hooks.
old scheme (False/None/0/'' == fail) made coding style
unnatural, did not allow use of mercurial commands as hooks.
new scheme (False/None/0 == pass) is pythonic, does not require peculiar
"return True" at ends of hooks, allows hooks like this:
[hooks]
# update working dir after push into this repo
changegroup.update = python:mercurial.commands.update
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Mon, 08 May 2006 10:59:58 -0700 |
parents | cbd458228a96 |
children | 4f072bb06e89 |
line wrap: on
line diff
--- a/tests/test-hook Mon May 08 08:20:56 2006 -0700 +++ b/tests/test-hook Mon May 08 10:59:58 2006 -0700 @@ -100,14 +100,13 @@ print 'hook args:' for k, v in a: print ' ', k, v - return True def passhook(**args): printargs(args) - return True def failhook(**args): printargs(args) + return True class LocalException(Exception): pass