Merge lp://staging/~nmb/bzr/894609-lazy-hook-names into lp://staging/bzr

Proposed by Neil Martinsen-Burrell
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: no longer in the source branch.
Merged at revision: 6332
Proposed branch: lp://staging/~nmb/bzr/894609-lazy-hook-names
Merge into: lp://staging/bzr
Diff against target: 98 lines (+41/-1)
3 files modified
bzrlib/hooks.py (+16/-1)
bzrlib/tests/blackbox/test_hooks.py (+22/-0)
doc/en/release-notes/bzr-2.5.txt (+3/-0)
To merge this branch: bzr merge lp://staging/~nmb/bzr/894609-lazy-hook-names
Reviewer Review Type Date Requested Status
Martin Pool Approve
Review via email: mp+83669@code.staging.launchpad.net

Commit message

allow lazily registered hooks to have their names appear in "bzr hooks" (bug 894609)

Description of the change

This allows lazily registered hooks to have their names appear in "bzr hooks". It uses __name__ and __module__ of a callable to find the name when the hook was registered lazily. It doesn't work for all lazy hooks, particularly those registered with hooks.install_lazy_named_hook or those not defined at the top level of a module, but it is an improvement on the present situation.

To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

That looks reasonable, thanks.

  vote approve

review: Approve
Revision history for this message
Martin Pool (mbp) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.