~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mutabletree.py

  • Committer: Vincent Ladeuil
  • Date: 2013-07-27 12:53:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6583.
  • Revision ID: v.ladeuil+lp@free.fr-20130727125328-b5e0mzrfrpmnmy9t
Open trunk again as 2.7b1

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
See MutableTree for more details.
20
20
"""
21
21
 
 
22
from __future__ import absolute_import
22
23
 
23
24
from bzrlib.lazy_import import lazy_import
24
25
lazy_import(globals(), """
71
72
    conformance tests for - rather we are testing MemoryTree specifically, and
72
73
    interface testing implementations of WorkingTree.
73
74
 
74
 
    A mutable tree always has an associated Branch and BzrDir object - the
 
75
    A mutable tree always has an associated Branch and ControlDir object - the
75
76
    branch and bzrdir attributes.
76
77
    """
77
78
    def __init__(self, *args, **kw):
407
408
        :seealso Inventory.apply_delta: For details on the changes parameter.
408
409
        """
409
410
        self.flush()
410
 
        inv = self.inventory
 
411
        inv = self.root_inventory
411
412
        inv.apply_delta(changes)
412
413
        self._write_inventory(inv)
413
414
 
519
520
            "called with a bzrlib.mutabletree.PostCommitHookParams object. "
520
521
            "The mutable tree the commit was performed on is available via "
521
522
            "the mutable_tree attribute of that object.", (2, 0))
522
 
 
 
523
        self.add_hook('pre_transform',
 
524
            "Called before a tree transform on this tree. The hook is called "
 
525
            "with the tree that is being transformed and the transform.",
 
526
            (2, 5))
 
527
        self.add_hook('post_build_tree',
 
528
            "Called after a completely new tree is built. The hook is "
 
529
            "called with the tree as its only argument.", (2, 5))
 
530
        self.add_hook('post_transform',
 
531
            "Called after a tree transform has been performed on a tree. "
 
532
            "The hook is called with the tree that is being transformed and "
 
533
            "the transform.",
 
534
            (2, 5))
523
535
 
524
536
# install the default hooks into the MutableTree class.
525
537
MutableTree.hooks = MutableTreeHooks()
611
623
            # nb: this relies on someone else checking that the path we're using
612
624
            # doesn't contain symlinks.
613
625
            parent_ie = self._convert_to_directory(parent_ie, inv_dirname)
614
 
        file_id = self.action(self.tree.inventory, parent_ie, path, kind)
 
626
        file_id = self.action(self.tree, parent_ie, path, kind)
615
627
        entry = _mod_inventory.make_entry(kind, basename, parent_ie.file_id,
616
628
            file_id=file_id)
617
629
        self._invdelta[inv_path] = (None, inv_path, entry.file_id, entry)