~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mutabletree.py

  • Committer: Martin Packman
  • Date: 2011-12-08 19:00:14 UTC
  • mto: This revision was merged to the branch mainline in revision 6359.
  • Revision ID: martin.packman@canonical.com-20111208190014-mi8jm6v7jygmhb0r
Use --include-duplicates for make update-pot which already combines multiple msgid strings prettily

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
23
22
 
24
23
from bzrlib.lazy_import import lazy_import
25
24
lazy_import(globals(), """
408
407
        :seealso Inventory.apply_delta: For details on the changes parameter.
409
408
        """
410
409
        self.flush()
411
 
        inv = self.root_inventory
 
410
        inv = self.inventory
412
411
        inv.apply_delta(changes)
413
412
        self._write_inventory(inv)
414
413
 
520
519
            "called with a bzrlib.mutabletree.PostCommitHookParams object. "
521
520
            "The mutable tree the commit was performed on is available via "
522
521
            "the mutable_tree attribute of that object.", (2, 0))
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))
 
522
 
535
523
 
536
524
# install the default hooks into the MutableTree class.
537
525
MutableTree.hooks = MutableTreeHooks()
623
611
            # nb: this relies on someone else checking that the path we're using
624
612
            # doesn't contain symlinks.
625
613
            parent_ie = self._convert_to_directory(parent_ie, inv_dirname)
626
 
        file_id = self.action(self.tree, parent_ie, path, kind)
 
614
        file_id = self.action(self.tree.inventory, parent_ie, path, kind)
627
615
        entry = _mod_inventory.make_entry(kind, basename, parent_ie.file_id,
628
616
            file_id=file_id)
629
617
        self._invdelta[inv_path] = (None, inv_path, entry.file_id, entry)