~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/vf_repository.py

  • Committer: Jelmer Vernooij
  • Date: 2012-01-24 00:16:15 UTC
  • mto: This revision was merged to the branch mainline in revision 6464.
  • Revision ID: jelmer@samba.org-20120124001615-ru3uwevs9d48kxcn
Add root_inventory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
604
604
                        _mod_revision.NULL_REVISION))
605
605
        # The basis inventory from a repository 
606
606
        if revtrees:
607
 
            basis_inv = revtrees[0].inventory
 
607
            basis_tree = revtrees[0]
608
608
        else:
609
 
            basis_inv = self.repository.revision_tree(
610
 
                _mod_revision.NULL_REVISION).inventory
 
609
            basis_tree = self.repository.revision_tree(
 
610
                _mod_revision.NULL_REVISION)
 
611
        basis_inv = basis_tree.root_inventory
611
612
        if len(self.parents) > 0:
612
613
            if basis_revision_id != self.parents[0] and not ghost_basis:
613
614
                raise Exception(
614
615
                    "arbitrary basis parents not yet supported with merges")
615
616
            for revtree in revtrees[1:]:
616
 
                for change in revtree.inventory._make_delta(basis_inv):
 
617
                for change in revtree.root_inventory._make_delta(basis_inv):
617
618
                    if change[1] is None:
618
619
                        # Not present in this parent.
619
620
                        continue
1021
1022
            # return a new inventory, but as there is no revision tree cache in
1022
1023
            # repository this is safe for now - RBC 20081013
1023
1024
            if basis_inv is None:
1024
 
                basis_inv = basis_tree.inventory
 
1025
                basis_inv = basis_tree.root_inventory
1025
1026
            basis_inv.apply_delta(delta)
1026
1027
            basis_inv.revision_id = new_revision_id
1027
1028
            return (self.add_inventory(new_revision_id, basis_inv, parents),