~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Jelmer Vernooij
  • Date: 2011-02-20 13:34:07 UTC
  • mto: (5622.4.1 uninstall-hook)
  • mto: This revision was merged to the branch mainline in revision 5747.
  • Revision ID: jelmer@samba.org-20110220133407-zhgrvuhhc1e3j2fn
Add more lazily usable hook points.

Show diffs side-by-side

added added

removed removed

Lines of Context:
934
934
class BzrDirHooks(hooks.Hooks):
935
935
    """Hooks for BzrDir operations."""
936
936
 
937
 
    def __init__(self):
 
937
    def __init__(self, module_name, member_name):
938
938
        """Create the default hooks."""
939
 
        hooks.Hooks.__init__(self)
940
 
        self.create_hook(hooks.HookPoint('pre_open',
 
939
        hooks.Hooks.__init__(self, module_name, member_name)
 
940
        self.add_hook('pre_open',
941
941
            "Invoked before attempting to open a BzrDir with the transport "
942
 
            "that the open will use.", (1, 14), None))
943
 
        self.create_hook(hooks.HookPoint('post_repo_init',
 
942
            "that the open will use.", (1, 14))
 
943
        self.add_hook('post_repo_init',
944
944
            "Invoked after a repository has been initialized. "
945
945
            "post_repo_init is called with a "
946
946
            "bzrlib.bzrdir.RepoInitHookParams.",
947
 
            (2, 2), None))
 
947
            (2, 2))
948
948
 
949
949
# install the default hooks
950
 
BzrDir.hooks = BzrDirHooks()
 
950
BzrDir.hooks = BzrDirHooks("bzrlib.bzrdir", "BzrDir.hooks")
951
951
 
952
952
 
953
953
class RepoInitHookParams(object):