~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mutabletree.py

Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from bzrlib import (
28
28
    add,
29
29
    bzrdir,
30
 
    hooks,
31
30
    )
32
31
from bzrlib.osutils import dirname
33
32
from bzrlib.revisiontree import RevisionTree
184
183
            revprops['author'] = author
185
184
        # args for wt.commit start at message from the Commit.commit method,
186
185
        args = (message, ) + args
187
 
        for hook in MutableTree.hooks['start_commit']:
188
 
            hook(self)
189
186
        committed_id = commit.Commit().commit(working_tree=self,
190
187
            revprops=revprops, *args, **kwargs)
191
188
        return committed_id
469
466
        self.set_parent_trees([(new_revid, rev_tree)])
470
467
 
471
468
 
472
 
class MutableTreeHooks(hooks.Hooks):
473
 
    """A dictionary mapping a hook name to a list of callables for mutabletree 
474
 
    hooks.
475
 
    """
476
 
 
477
 
    def __init__(self):
478
 
        """Create the default hooks.
479
 
 
480
 
        """
481
 
        hooks.Hooks.__init__(self)
482
 
        # Invoked before a commit is done in a tree. New in 1.4
483
 
        self['start_commit'] = []
484
 
 
485
 
 
486
 
# install the default hooks into the MutableTree class.
487
 
MutableTree.hooks = MutableTreeHooks()
488
 
 
489
 
 
490
469
class _FastPath(object):
491
470
    """A path object with fast accessors for things like basename."""
492
471