[RFC] about hooks
John Arbash Meinel
john at arbash-meinel.com
Fri Mar 7 16:58:17 GMT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Alexander Belchenko wrote:
> Why for two related methods is needed to install hooks. Here is example
> from
> user guide:
>
> from bzrlib import branch
>
> def post_push_hook(push_result):
> print "The new revno is %d" % push_result.new_revno
>
> branch.Branch.hooks.install_hook('post_push', post_push_hook)
> branch.Branch.hooks.name_hook(post_push_hook, 'My post_push hook')
>
>
> Why not assigning name of the hook in install_hook()???
> It seems very ridiculous. I'd like to do it much simpler:
>
> branch.Branch.hooks.install_hook('post_push', post_push_hook, 'My
> post_push hook')
>
> and that's all. Why it implemented in such strange manner?
>
>
I *think* it is because naming hooks came long after installing them. I
agree that it should be a single call.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFH0XQpJdeBCYSNAAMRAljMAJ9dwSopesIoLRB4+pfkd8Cq714hsgCgtjay
net6Q7e5MoIVENYo+mx97yg=
=lr1i
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list