~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-04-16 01:09:56 UTC
  • mfrom: (5784.1.4 760435-less-fail)
  • Revision ID: pqm@pqm.ubuntu.com-20110416010956-5wrpm136qq2hz5f3
(mbp) rename and deprecate failUnlessExists and failIfExists (Martin Pool)

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,
34
33
    osutils,
35
34
    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 = _mod_inventory.make_entry('directory',
 
623
                            this_ie = 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 = _mod_inventory.mutable_inventory_from_tree(basis)
 
696
        inventory = basis.inventory._get_mutable_inventory()
697
697
        basis.unlock()
698
698
        inventory.apply_delta(delta)
699
 
        rev_tree = revisiontree.InventoryRevisionTree(self.branch.repository,
 
699
        rev_tree = revisiontree.RevisionTree(self.branch.repository,
700
700
                                             inventory, new_revid)
701
701
        self.set_parent_trees([(new_revid, rev_tree)])
702
702
 
703
703
 
 
704
 
 
705
 
704
706
class MutableTreeHooks(hooks.Hooks):
705
707
    """A dictionary mapping a hook name to a list of callables for mutabletree
706
708
    hooks.
809
811
    if parent_ie.kind != 'directory':
810
812
        # nb: this relies on someone else checking that the path we're using
811
813
        # doesn't contain symlinks.
812
 
        new_parent_ie = _mod_inventory.make_entry('directory', parent_ie.name,
 
814
        new_parent_ie = inventory.make_entry('directory', parent_ie.name,
813
815
            parent_ie.parent_id, parent_ie.file_id)
814
816
        del inv[parent_ie.file_id]
815
817
        inv.add(new_parent_ie)