/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/plugins/commitfromnews/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2017-07-23 19:01:03 UTC
  • mto: This revision was merged to the branch mainline in revision 6739.
  • Revision ID: jelmer@jelmer.uk-20170723190103-a9jzsn9vvxdc0yfs
Use lazy hook registration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
from __future__ import absolute_import
35
35
 
36
 
from ... import msgeditor
 
36
from ... import hooks
37
37
 
38
38
 
39
39
def commit_template(commit, message):
53
53
 
54
54
 
55
55
_registered = False
 
56
 
 
57
 
56
58
def register():
57
59
    """Register the plugin."""
58
60
    global _registered
59
61
    # Does not check registered because only tests call this, and they are
60
62
    # isolated.
61
63
    _registered = True
62
 
    msgeditor.hooks.install_named_hook('commit_message_template',
 
64
    hooks.install_lazy_named_hook(
 
65
        'breezy.msgeditor', 'hooks',
 
66
        'commit_message_template',
63
67
        commit_template, 'commitfromnews template')
64
68
 
 
69
 
65
70
register()