~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mutabletree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-03-31 16:28:11 UTC
  • mfrom: (5622.3.15 more-lazy-hooks)
  • Revision ID: pqm@pqm.ubuntu.com-20110331162811-w1uw1lgpr5fiawp5
(jelmer) Support installing lazy hooks for all existing hook points,
 deprecate Hooks.create_hook. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
652
652
        """Create the default hooks.
653
653
 
654
654
        """
655
 
        hooks.Hooks.__init__(self)
656
 
        self.create_hook(hooks.HookPoint('start_commit',
 
655
        hooks.Hooks.__init__(self, "bzrlib.mutabletree", "MutableTree.hooks")
 
656
        self.add_hook('start_commit',
657
657
            "Called before a commit is performed on a tree. The start commit "
658
658
            "hook is able to change the tree before the commit takes place. "
659
659
            "start_commit is called with the bzrlib.mutabletree.MutableTree "
660
 
            "that the commit is being performed on.", (1, 4), None))
661
 
        self.create_hook(hooks.HookPoint('post_commit',
 
660
            "that the commit is being performed on.", (1, 4))
 
661
        self.add_hook('post_commit',
662
662
            "Called after a commit is performed on a tree. The hook is "
663
663
            "called with a bzrlib.mutabletree.PostCommitHookParams object. "
664
664
            "The mutable tree the commit was performed on is available via "
665
 
            "the mutable_tree attribute of that object.", (2, 0), None))
 
665
            "the mutable_tree attribute of that object.", (2, 0))
666
666
 
667
667
 
668
668
# install the default hooks into the MutableTree class.