[MERGE] Add Hooks.install_named_hook
Daniel Mark Watkins
D.M.Watkins at warwick.ac.uk
Mon Mar 10 00:52:29 GMT 2008
On Sun, 09 Mar 2008 16:42:40 -0400
Aaron Bentley <aaron at aaronbentley.com> wrote:
> I agree with the rationale. But this patch introduces code
> duplication. Why not have install_hook call install_named_hook with a
> None name?
Done in attached.
> In this case, you can change it to
>
> try:
> self[hook_name].append(a_callable)
> except KeyError:
> raise errors.UnknownHook(self.__class__.__name__,
> hook_name) if name is not None:
> self.name_hook(a_callable, name)
Done in attached.
All tests pass, but there are a number of new DeprecationWarnings. I'll
start on fixes for those tomorrow.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: install_named_hook.2.patch
Type: text/x-patch
Size: 9336 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080310/940b690b/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080310/940b690b/attachment.pgp
More information about the bazaar
mailing list