~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/vf_repository.py

  • Committer: Ross Lagerwall
  • Date: 2012-08-07 06:32:51 UTC
  • mto: (6437.63.5 2.5)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: rosslagerwall@gmail.com-20120807063251-x9p03ghg2ws8oqjc
Add bzrlib/locale to .bzrignore

bzrlib/locale is generated with ./setup.py build_mo which is in turn called
by ./setup.py build

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_tree = revtrees[0]
 
607
            basis_inv = revtrees[0].inventory
608
608
        else:
609
 
            basis_tree = self.repository.revision_tree(
610
 
                _mod_revision.NULL_REVISION)
611
 
        basis_inv = basis_tree.root_inventory
 
609
            basis_inv = self.repository.revision_tree(
 
610
                _mod_revision.NULL_REVISION).inventory
612
611
        if len(self.parents) > 0:
613
612
            if basis_revision_id != self.parents[0] and not ghost_basis:
614
613
                raise Exception(
615
614
                    "arbitrary basis parents not yet supported with merges")
616
615
            for revtree in revtrees[1:]:
617
 
                for change in revtree.root_inventory._make_delta(basis_inv):
 
616
                for change in revtree.inventory._make_delta(basis_inv):
618
617
                    if change[1] is None:
619
618
                        # Not present in this parent.
620
619
                        continue
1022
1021
            # return a new inventory, but as there is no revision tree cache in
1023
1022
            # repository this is safe for now - RBC 20081013
1024
1023
            if basis_inv is None:
1025
 
                basis_inv = basis_tree.root_inventory
 
1024
                basis_inv = basis_tree.inventory
1026
1025
            basis_inv.apply_delta(delta)
1027
1026
            basis_inv.revision_id = new_revision_id
1028
1027
            return (self.add_inventory(new_revision_id, basis_inv, parents),
1648
1647
                            try:
1649
1648
                                inv = inventory_cache[parent_id]
1650
1649
                            except KeyError:
1651
 
                                inv = self.revision_tree(parent_id).root_inventory
 
1650
                                inv = self.revision_tree(parent_id).inventory
1652
1651
                                inventory_cache[parent_id] = inv
1653
1652
                            try:
1654
1653
                                parent_entry = inv[text_key[0]]
2442
2441
        invs_sent_so_far = set([_mod_revision.NULL_REVISION])
2443
2442
        inventory_cache = lru_cache.LRUCache(50)
2444
2443
        null_inventory = from_repo.revision_tree(
2445
 
            _mod_revision.NULL_REVISION).root_inventory
 
2444
            _mod_revision.NULL_REVISION).inventory
2446
2445
        # XXX: ideally the rich-root/tree-refs flags would be per-revision, not
2447
2446
        # per-repo (e.g.  streaming a non-rich-root revision out of a rich-root
2448
2447
        # repo back into a non-rich-root repo ought to be allowed)
2795
2794
        """
2796
2795
        deltas = []
2797
2796
        # Generate deltas against each tree, to find the shortest.
2798
 
        # FIXME: Support nested trees
2799
2797
        texts_possibly_new_in_tree = set()
2800
2798
        for basis_id, basis_tree in possible_trees:
2801
 
            delta = tree.root_inventory._make_delta(basis_tree.root_inventory)
 
2799
            delta = tree.inventory._make_delta(basis_tree.inventory)
2802
2800
            for old_path, new_path, file_id, new_entry in delta:
2803
2801
                if new_path is None:
2804
2802
                    # This file_id isn't present in the new rev, so we don't
2841
2839
            parents_parents = [key[-1] for key in parents_parents_keys]
2842
2840
            basis_id = _mod_revision.NULL_REVISION
2843
2841
            basis_tree = self.source.revision_tree(basis_id)
2844
 
            delta = parent_tree.root_inventory._make_delta(
2845
 
                basis_tree.root_inventory)
 
2842
            delta = parent_tree.inventory._make_delta(basis_tree.inventory)
2846
2843
            self.target.add_inventory_by_delta(
2847
2844
                basis_id, delta, current_revision_id, parents_parents)
2848
2845
            cache[current_revision_id] = parent_tree
2907
2904
                kind = entry.kind
2908
2905
                texts_possibly_new_in_tree.add((file_id, entry.revision))
2909
2906
            for basis_id, basis_tree in possible_trees:
2910
 
                basis_inv = basis_tree.root_inventory
 
2907
                basis_inv = basis_tree.inventory
2911
2908
                for file_key in list(texts_possibly_new_in_tree):
2912
2909
                    file_id, file_revision = file_key
2913
2910
                    try:
3145
3142
            parent_trees[p_id] = repository.revision_tree(
3146
3143
                                     _mod_revision.NULL_REVISION)
3147
3144
 
3148
 
    # FIXME: Support nested trees
3149
 
    inv = revision_tree.root_inventory
 
3145
    inv = revision_tree.inventory
3150
3146
    entries = inv.iter_entries()
3151
3147
    # backwards compatibility hack: skip the root id.
3152
3148
    if not repository.supports_rich_root():