~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/knitpack_repo.py

  • Committer: Jelmer Vernooij
  • Date: 2011-04-15 11:23:09 UTC
  • mto: (5757.8.11 knitpackrepo-7)
  • mto: This revision was merged to the branch mainline in revision 5800.
  • Revision ID: jelmer@samba.org-20110415112309-icmbcwopdpqh2c9x
Drop chk support in knitpackrepo - was unused anyway, as we explicitly checked that the format didn't support chks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
            self._transport.clone('packs'),
87
87
            _format.index_builder_class,
88
88
            _format.index_class,
89
 
            use_chk_index=self._format.supports_chks,
 
89
            use_chk_index=False,
90
90
            )
91
91
        self.inventories = KnitVersionedFiles(
92
92
            _KnitGraphIndex(self._pack_collection.inventory_index.combined_index,
854
854
            self.new_pack.text_index, readv_group_iter, total_items))
855
855
        self._log_copied_texts()
856
856
 
857
 
    def _copy_chks(self, refs=None):
858
 
        # XXX: Todo, recursive follow-pointers facility when fetching some
859
 
        # revisions only.
860
 
        chk_index_map, chk_indices = self._pack_map_and_index_list(
861
 
            'chk_index')
862
 
        chk_nodes = self._index_contents(chk_indices, refs)
863
 
        new_refs = set()
864
 
        # TODO: This isn't strictly tasteful as we are accessing some private
865
 
        #       variables (_serializer). Perhaps a better way would be to have
866
 
        #       Repository._deserialise_chk_node()
867
 
        search_key_func = chk_map.search_key_registry.get(
868
 
            self._pack_collection.repo._serializer.search_key_name)
869
 
        def accumlate_refs(lines):
870
 
            # XXX: move to a generic location
871
 
            # Yay mismatch:
872
 
            bytes = ''.join(lines)
873
 
            node = chk_map._deserialise(bytes, ("unknown",), search_key_func)
874
 
            new_refs.update(node.refs())
875
 
        self._copy_nodes(chk_nodes, chk_index_map, self.new_pack._writer,
876
 
            self.new_pack.chk_index, output_lines=accumlate_refs)
877
 
        return new_refs
878
 
 
879
857
    def _create_pack_from_packs(self):
880
858
        self.pb.update("Opening pack", 0, 5)
881
859
        self.new_pack = self.open_pack()
912
890
                time.ctime(), self._pack_collection._upload_transport.base, new_pack.random_name,
913
891
                new_pack.signature_index.key_count(),
914
892
                time.time() - new_pack.start_time)
915
 
        # copy chk contents
916
 
        # NB XXX: how to check CHK references are present? perhaps by yielding
917
 
        # the items? How should that interact with stacked repos?
918
 
        if new_pack.chk_index is not None:
919
 
            self._copy_chks()
920
 
            if 'pack' in debug.debug_flags:
921
 
                trace.mutter('%s: create_pack: chk content copied: %s%s %d items t+%6.3fs',
922
 
                    time.ctime(), self._pack_collection._upload_transport.base,
923
 
                    new_pack.random_name,
924
 
                    new_pack.chk_index.key_count(),
925
 
                    time.time() - new_pack.start_time)
926
893
        new_pack._check_references()
927
894
        if not self._use_pack(new_pack):
928
895
            new_pack.abort()