[RFC] about hooks

Alexander Belchenko bialix at ukr.net
Fri Mar 7 15:57:44 GMT 2008


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?



More information about the bazaar mailing list