~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mutabletree.py

  • Committer: Jelmer Vernooij
  • Date: 2011-04-19 10:42:59 UTC
  • mto: This revision was merged to the branch mainline in revision 5806.
  • Revision ID: jelmer@samba.org-20110419104259-g9exlcp1f5jdu3ci
Move Inventory._get_mutable_inventory -> mutable_inventory_from_tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    bzrdir,
31
31
    errors,
32
32
    hooks,
 
33
    inventory as _mod_inventory,
33
34
    osutils,
34
35
    revisiontree,
35
 
    inventory,
36
36
    trace,
37
37
    tree,
38
38
    )
620
620
                        # Same as in _add_one below, if the inventory doesn't
621
621
                        # think this is a directory, update the inventory
622
622
                        if this_ie.kind != 'directory':
623
 
                            this_ie = inventory.make_entry('directory',
 
623
                            this_ie = _mod_inventory.make_entry('directory',
624
624
                                this_ie.name, this_ie.parent_id, this_id)
625
625
                            del inv[this_id]
626
626
                            inv.add(this_ie)
693
693
        # TODO: Consider re-evaluating the need for this with CHKInventory
694
694
        # we don't strictly need to mutate an inventory for this
695
695
        # it only makes sense when apply_delta is cheaper than get_inventory()
696
 
        inventory = basis.inventory._get_mutable_inventory()
 
696
        inventory = _mod_inventory.mutable_inventory_from_tree(basis)
697
697
        basis.unlock()
698
698
        inventory.apply_delta(delta)
699
699
        rev_tree = revisiontree.InventoryRevisionTree(self.branch.repository,
701
701
        self.set_parent_trees([(new_revid, rev_tree)])
702
702
 
703
703
 
704
 
 
705
 
 
706
704
class MutableTreeHooks(hooks.Hooks):
707
705
    """A dictionary mapping a hook name to a list of callables for mutabletree
708
706
    hooks.
811
809
    if parent_ie.kind != 'directory':
812
810
        # nb: this relies on someone else checking that the path we're using
813
811
        # doesn't contain symlinks.
814
 
        new_parent_ie = inventory.make_entry('directory', parent_ie.name,
 
812
        new_parent_ie = _mod_inventory.make_entry('directory', parent_ie.name,
815
813
            parent_ie.parent_id, parent_ie.file_id)
816
814
        del inv[parent_ie.file_id]
817
815
        inv.add(new_parent_ie)