~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.py

Merge bzr.dev 4187, and revert the change to fix refcycle issues.

I apparently didn't run the smart fetch tests. Which show that we access inv+chk pages
as a fulltext, and then insert the stream, which expects to get the block as a compressed
block. :(.
Need to rethink how to do it, possibly with weakrefs.


This also brings in CommitBuilder.record_iter_changes() and the updates to btree_index
and backing indices.

Show diffs side-by-side

added added

removed removed

Lines of Context:
744
744
 
745
745
    def open_pack(self):
746
746
        """Open a pack for the pack we are creating."""
747
 
        return self._pack_collection.pack_factory(self._pack_collection,
 
747
        new_pack = self._pack_collection.pack_factory(self._pack_collection,
748
748
                upload_suffix=self.suffix,
749
749
                file_mode=self._pack_collection.repo.bzrdir._get_file_mode())
 
750
        # We know that we will process all nodes in order, and don't need to
 
751
        # query, so don't combine any indices spilled to disk until we are done
 
752
        new_pack.revision_index.set_optimize(combine_backing_indices=False)
 
753
        new_pack.inventory_index.set_optimize(combine_backing_indices=False)
 
754
        new_pack.text_index.set_optimize(combine_backing_indices=False)
 
755
        new_pack.signature_index.set_optimize(combine_backing_indices=False)
 
756
        return new_pack
750
757
 
751
758
    def _update_pack_order(self, entries, index_to_pack_map):
752
759
        """Determine how we want our packs to be ordered.