~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/groupcompress_repo.py

(robertc) Pack 2a repositories after fetching from a different format
        (bug 376748) and fix problems with autopacking 2a repositories
        (bug 365615). (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
218
218
            p_id_roots_set = set()
219
219
            stream = source_vf.get_record_stream(keys, 'groupcompress', True)
220
220
            for idx, record in enumerate(stream):
 
221
                # Inventories should always be with revisions; assume success.
221
222
                bytes = record.get_bytes_as('fulltext')
222
223
                chk_inv = inventory.CHKInventory.deserialise(None, bytes,
223
224
                                                             record.key)
294
295
                    stream = source_vf.get_record_stream(cur_keys,
295
296
                                                         'as-requested', True)
296
297
                    for record in stream:
 
298
                        if record.storage_kind == 'absent':
 
299
                            # An absent CHK record: we assume that the missing
 
300
                            # record is in a different pack - e.g. a page not
 
301
                            # altered by the commit we're packing.
 
302
                            continue
297
303
                        bytes = record.get_bytes_as('fulltext')
298
304
                        # We don't care about search_key_func for this code,
299
305
                        # because we only care about external references.
558
564
    pack_factory = GCPack
559
565
    resumed_pack_factory = ResumedGCPack
560
566
 
561
 
    def _already_packed(self):
562
 
        """Is the collection already packed?"""
563
 
        # Always repack GC repositories for now
564
 
        return False
565
 
 
566
567
    def _execute_pack_operations(self, pack_operations,
567
568
                                 _packer_class=GCCHKPacker,
568
569
                                 reload_func=None):
1048
1049
    _fetch_order = 'unordered'
1049
1050
    _fetch_uses_deltas = False # essentially ignored by the groupcompress code.
1050
1051
    fast_deltas = True
 
1052
    pack_compresses = True
1051
1053
 
1052
1054
    def _get_matching_bzrdir(self):
1053
1055
        return bzrdir.format_registry.make_bzrdir('development6-rich-root')