277
278
add_callback=self._pack_collection.text_index.add_callback,
278
279
parents=True, is_locked=self.is_locked),
279
280
access=self._pack_collection.text_index.data_access)
281
if chk_support and _format.supports_chks:
282
# No graph, no compression:- references from chks are between
283
# different objects not temporal versions of the same; and without
284
# some sort of temporal structure knit compression will just fail.
285
self.chk_bytes = GroupCompressVersionedFiles(
286
_GCGraphIndex(self._pack_collection.chk_index.combined_index,
287
add_callback=self._pack_collection.chk_index.add_callback,
288
parents=False, is_locked=self.is_locked),
289
access=self._pack_collection.chk_index.data_access)
291
self.chk_bytes = None
280
292
# True when the repository object is 'write locked' (as opposed to the
281
293
# physical lock only taken out around changes to the pack-names list.)
282
294
# Another way to represent this would be a decorator around the control
290
302
self._reconcile_backsup_inventory = False
306
class GCCHKPackRepository(CHKInventoryRepository):
307
"""GC customisation of CHKInventoryRepository."""
309
def __init__(self, _format, a_bzrdir, control_files, _commit_builder_class,
311
"""Overridden to change pack collection class."""
312
KnitPackRepository.__init__(self, _format, a_bzrdir, control_files,
313
_commit_builder_class, _serializer)
314
# and now replace everything it did :)
315
index_transport = self._transport.clone('indices')
317
self._pack_collection = GCRepositoryPackCollection(self,
318
self._transport, index_transport,
319
self._transport.clone('upload'),
320
self._transport.clone('packs'),
321
_format.index_builder_class,
323
use_chk_index=self._format.supports_chks,
326
self._pack_collection = GCRepositoryPackCollection(self,
327
self._transport, index_transport,
328
self._transport.clone('upload'),
329
self._transport.clone('packs'),
330
_format.index_builder_class,
332
self.inventories = GroupCompressVersionedFiles(
333
_GCGraphIndex(self._pack_collection.inventory_index.combined_index,
334
add_callback=self._pack_collection.inventory_index.add_callback,
335
parents=True, is_locked=self.is_locked),
336
access=self._pack_collection.inventory_index.data_access)
337
self.revisions = GroupCompressVersionedFiles(
338
_GCGraphIndex(self._pack_collection.revision_index.combined_index,
339
add_callback=self._pack_collection.revision_index.add_callback,
340
parents=True, is_locked=self.is_locked),
341
access=self._pack_collection.revision_index.data_access,
343
self.signatures = GroupCompressVersionedFiles(
344
_GCGraphIndex(self._pack_collection.signature_index.combined_index,
345
add_callback=self._pack_collection.signature_index.add_callback,
346
parents=False, is_locked=self.is_locked),
347
access=self._pack_collection.signature_index.data_access,
349
self.texts = GroupCompressVersionedFiles(
350
_GCGraphIndex(self._pack_collection.text_index.combined_index,
351
add_callback=self._pack_collection.text_index.add_callback,
352
parents=True, is_locked=self.is_locked),
353
access=self._pack_collection.text_index.data_access)
354
if chk_support and _format.supports_chks:
355
# No graph, no compression:- references from chks are between
356
# different objects not temporal versions of the same; and without
357
# some sort of temporal structure knit compression will just fail.
358
self.chk_bytes = GroupCompressVersionedFiles(
359
_GCGraphIndex(self._pack_collection.chk_index.combined_index,
360
add_callback=self._pack_collection.chk_index.add_callback,
361
parents=False, is_locked=self.is_locked),
362
access=self._pack_collection.chk_index.data_access)
364
self.chk_bytes = None
365
# True when the repository object is 'write locked' (as opposed to the
366
# physical lock only taken out around changes to the pack-names list.)
367
# Another way to represent this would be a decorator around the control
368
# files object that presents logical locks as physical ones - if this
369
# gets ugly consider that alternative design. RBC 20071011
370
self._write_lock_count = 0
371
self._transaction = None
373
self._reconcile_does_inventory_gc = True
374
self._reconcile_fixes_text_parents = True
375
self._reconcile_backsup_inventory = False
293
378
class RepositoryFormatPackGCPlain(RepositoryFormatPackDevelopment2):
294
379
"""A B+Tree index using pack repository."""