[MERGE] Add Hooks.install_named_hook

John Arbash Meinel john at arbash-meinel.com
Mon Mar 10 14:19:34 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Daniel Mark Watkins wrote:
| 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.
|

You can't submit something with DeprecationWarnings to PQM. It runs with -Werror
so those would all fail.

There are 2 things to be done...

1) Tests that are directly testing a deprecated function should not be removed,
but be adapted to use something like "TestCase.applyDeprecated". That way we can
tell both that the function is correctly deprecated, *and* that we haven't
broken it.

2) Other places in the codebase should be switched over to the new function so
they don't trigger DeprecationWarning.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH1UN2JdeBCYSNAAMRAiCGAKDWMcAV+yzYoGSQ8yNZRQNm6XcttACeIVia
gLHJk8D2QtaZQvj1xApE+ro=
=jN3B
-----END PGP SIGNATURE-----



More information about the bazaar mailing list