82
93
Pack.__init__(self,
83
# Revisions: parents list, no text compression.
84
index_builder_class(reference_lists=1),
85
# Inventory: We want to map compression only, but currently the
86
# knit code hasn't been updated enough to understand that, so we
87
# have a regular 2-list index giving parents and compression
89
index_builder_class(reference_lists=1),
90
# Texts: per file graph, for all fileids - so one reference list
91
# and two elements in the key tuple.
92
index_builder_class(reference_lists=1, key_elements=2),
93
# Signatures: Just blobs to store, no compression, no parents
95
index_builder_class(reference_lists=0),
96
# CHK based storage - just blobs, no compression or parents.
94
# Revisions: parents list, no text compression.
95
index_builder_class(reference_lists=1),
96
# Inventory: We want to map compression only, but currently the
97
# knit code hasn't been updated enough to understand that, so we
98
# have a regular 2-list index giving parents and compression
100
index_builder_class(reference_lists=1),
101
# Texts: per file graph, for all fileids - so one reference list
102
# and two elements in the key tuple.
103
index_builder_class(reference_lists=1, key_elements=2),
104
# Signatures: Just blobs to store, no compression, no parents
106
index_builder_class(reference_lists=0),
107
# CHK based storage - just blobs, no compression or parents.
99
110
self._pack_collection = pack_collection
100
111
# When we make readonly indices, we need this.
101
112
self.index_class = pack_collection._index_class
419
433
# get_parent_map(self.revision_keys), but that shouldn't be any faster
421
435
inventory_keys = source_vf.keys()
422
missing_inventories = set(self.revision_keys).difference(inventory_keys)
436
missing_inventories = set(
437
self.revision_keys).difference(inventory_keys)
423
438
if missing_inventories:
424
missing_inventories = sorted(missing_inventories)
425
raise ValueError('We are missing inventories for revisions: %s'
426
% (missing_inventories,))
439
# Go back to the original repo, to see if these are really missing
440
# https://bugs.launchpad.net/bzr/+bug/437003
441
# If we are packing a subset of the repo, it is fine to just have
442
# the data in another Pack file, which is not included in this pack
444
inv_index = self._pack_collection.repo.inventories._index
445
pmap = inv_index.get_parent_map(missing_inventories)
446
really_missing = missing_inventories.difference(pmap)
448
missing_inventories = sorted(really_missing)
449
raise ValueError('We are missing inventories for revisions: %s'
450
% (missing_inventories,))
427
451
self._copy_stream(source_vf, target_vf, inventory_keys,
428
452
'inventories', self._get_filtered_inv_stream, 2)
454
def _get_chk_vfs_for_copy(self):
455
return self._build_vfs('chk', False, False)
430
457
def _copy_chk_texts(self):
431
source_vf, target_vf = self._build_vfs('chk', False, False)
458
source_vf, target_vf = self._get_chk_vfs_for_copy()
432
459
# TODO: This is technically spurious... if it is a performance issue,
434
461
total_keys = source_vf.keys()
580
605
return new_pack.data_inserted() and self._data_changed
608
class GCCHKCanonicalizingPacker(GCCHKPacker):
609
"""A packer that ensures inventories have canonical-form CHK maps.
611
Ideally this would be part of reconcile, but it's very slow and rarely
612
needed. (It repairs repositories affected by
613
https://bugs.launchpad.net/bzr/+bug/522637).
616
def __init__(self, *args, **kwargs):
617
super(GCCHKCanonicalizingPacker, self).__init__(*args, **kwargs)
618
self._data_changed = False
620
def _exhaust_stream(self, source_vf, keys, message, vf_to_stream, pb_offset):
621
"""Create and exhaust a stream, but don't insert it.
623
This is useful to get the side-effects of generating a stream.
625
self.pb.update('scanning %s' % (message,), pb_offset)
626
with ui.ui_factory.nested_progress_bar() as child_pb:
627
list(vf_to_stream(source_vf, keys, message, child_pb))
629
def _copy_inventory_texts(self):
630
source_vf, target_vf = self._build_vfs('inventory', True, True)
631
source_chk_vf, target_chk_vf = self._get_chk_vfs_for_copy()
632
inventory_keys = source_vf.keys()
633
# First, copy the existing CHKs on the assumption that most of them
634
# will be correct. This will save us from having to reinsert (and
635
# recompress) these records later at the cost of perhaps preserving a
637
# (Iterate but don't insert _get_filtered_inv_stream to populate the
638
# variables needed by GCCHKPacker._copy_chk_texts.)
639
self._exhaust_stream(source_vf, inventory_keys, 'inventories',
640
self._get_filtered_inv_stream, 2)
641
GCCHKPacker._copy_chk_texts(self)
642
# Now copy and fix the inventories, and any regenerated CHKs.
644
def chk_canonicalizing_inv_stream(source_vf, keys, message, pb=None):
645
return self._get_filtered_canonicalizing_inv_stream(
646
source_vf, keys, message, pb, source_chk_vf, target_chk_vf)
647
self._copy_stream(source_vf, target_vf, inventory_keys,
648
'inventories', chk_canonicalizing_inv_stream, 4)
650
def _copy_chk_texts(self):
651
# No-op; in this class this happens during _copy_inventory_texts.
654
def _get_filtered_canonicalizing_inv_stream(self, source_vf, keys, message,
655
pb=None, source_chk_vf=None, target_chk_vf=None):
656
"""Filter the texts of inventories, regenerating CHKs to make sure they
659
total_keys = len(keys)
660
target_chk_vf = versionedfile.NoDupeAddLinesDecorator(target_chk_vf)
662
def _filtered_inv_stream():
663
stream = source_vf.get_record_stream(keys, 'groupcompress', True)
664
search_key_name = None
665
for idx, record in enumerate(stream):
666
# Inventories should always be with revisions; assume success.
667
bytes = record.get_bytes_as('fulltext')
668
chk_inv = inventory.CHKInventory.deserialise(
669
source_chk_vf, bytes, record.key)
671
pb.update('inv', idx, total_keys)
672
chk_inv.id_to_entry._ensure_root()
673
if search_key_name is None:
674
# Find the name corresponding to the search_key_func
675
search_key_reg = chk_map.search_key_registry
676
for search_key_name, func in viewitems(search_key_reg):
677
if func == chk_inv.id_to_entry._search_key_func:
679
canonical_inv = inventory.CHKInventory.from_inventory(
680
target_chk_vf, chk_inv,
681
maximum_size=chk_inv.id_to_entry._root_node._maximum_size,
682
search_key_name=search_key_name)
683
if chk_inv.id_to_entry.key() != canonical_inv.id_to_entry.key():
685
'Non-canonical CHK map for id_to_entry of inv: %s '
686
'(root is %s, should be %s)' % (chk_inv.revision_id,
687
chk_inv.id_to_entry.key()[
689
canonical_inv.id_to_entry.key()[0]))
690
self._data_changed = True
691
p_id_map = chk_inv.parent_id_basename_to_file_id
692
p_id_map._ensure_root()
693
canon_p_id_map = canonical_inv.parent_id_basename_to_file_id
694
if p_id_map.key() != canon_p_id_map.key():
696
'Non-canonical CHK map for parent_id_to_basename of '
697
'inv: %s (root is %s, should be %s)'
698
% (chk_inv.revision_id, p_id_map.key()[0],
699
canon_p_id_map.key()[0]))
700
self._data_changed = True
701
yield versionedfile.ChunkedContentFactory(record.key,
702
record.parents, record.sha1,
703
canonical_inv.to_lines())
704
# We have finished processing all of the inventory records, we
705
# don't need these sets anymore
706
return _filtered_inv_stream()
708
def _use_pack(self, new_pack):
709
"""Override _use_pack to check for reconcile having changed content."""
710
return new_pack.data_inserted() and self._data_changed
583
713
class GCRepositoryPackCollection(RepositoryPackCollection):
585
715
pack_factory = GCPack
586
716
resumed_pack_factory = ResumedGCPack
717
normal_packer_class = GCCHKPacker
718
optimising_packer_class = GCCHKPacker
588
720
def _check_new_inventories(self):
589
721
"""Detect missing inventories or chk root entries for the new revisions
662
797
for interesting_rec, interesting_map in chk_diff:
664
except errors.NoSuchRevision, e:
799
except errors.NoSuchRevision as e:
666
801
"missing chk node(s) for parent_id_basename_to_file_id maps")
667
802
present_text_keys = no_fallback_texts_index.get_parent_map(text_keys)
668
803
missing_text_keys = text_keys.difference(present_text_keys)
669
804
if missing_text_keys:
670
805
problems.append("missing text keys: %r"
671
% (sorted(missing_text_keys),))
806
% (sorted(missing_text_keys),))
674
def _execute_pack_operations(self, pack_operations,
675
_packer_class=GCCHKPacker,
677
"""Execute a series of pack operations.
679
:param pack_operations: A list of [revision_count, packs_to_combine].
680
:param _packer_class: The class of packer to use (default: Packer).
683
# XXX: Copied across from RepositoryPackCollection simply because we
684
# want to override the _packer_class ... :(
685
for revision_count, packs in pack_operations:
686
# we may have no-ops from the setup logic
689
packer = GCCHKPacker(self, packs, '.autopack',
690
reload_func=reload_func)
692
result = packer.pack()
693
except errors.RetryWithNewPacks:
694
# An exception is propagating out of this context, make sure
695
# this packer has cleaned up. Packer() doesn't set its new_pack
696
# state into the RepositoryPackCollection object, so we only
697
# have access to it directly here.
698
if packer.new_pack is not None:
699
packer.new_pack.abort()
704
self._remove_pack_from_memory(pack)
705
# record the newly available packs and stop advertising the old
708
for _, packs in pack_operations:
709
to_be_obsoleted.extend(packs)
710
result = self._save_pack_names(clear_obsolete_packs=True,
711
obsolete_packs=to_be_obsoleted)
715
class CHKInventoryRepository(KnitPackRepository):
716
"""subclass of KnitPackRepository that uses CHK based inventories."""
718
def __init__(self, _format, a_bzrdir, control_files, _commit_builder_class,
810
class CHKInventoryRepository(PackRepository):
811
"""subclass of PackRepository that uses CHK based inventories."""
813
def __init__(self, _format, a_controldir, control_files, _commit_builder_class,
720
815
"""Overridden to change pack collection class."""
721
KnitPackRepository.__init__(self, _format, a_bzrdir, control_files,
722
_commit_builder_class, _serializer)
723
# and now replace everything it did :)
816
super(CHKInventoryRepository, self).__init__(_format, a_controldir,
817
control_files, _commit_builder_class, _serializer)
724
818
index_transport = self._transport.clone('indices')
725
819
self._pack_collection = GCRepositoryPackCollection(self,
726
self._transport, index_transport,
727
self._transport.clone('upload'),
728
self._transport.clone('packs'),
729
_format.index_builder_class,
731
use_chk_index=self._format.supports_chks,
820
self._transport, index_transport,
821
self._transport.clone(
823
self._transport.clone(
825
_format.index_builder_class,
827
use_chk_index=self._format.supports_chks,
733
829
self.inventories = GroupCompressVersionedFiles(
734
830
_GCGraphIndex(self._pack_collection.inventory_index.combined_index,
735
add_callback=self._pack_collection.inventory_index.add_callback,
736
parents=True, is_locked=self.is_locked,
737
inconsistency_fatal=False),
831
add_callback=self._pack_collection.inventory_index.add_callback,
832
parents=True, is_locked=self.is_locked,
833
inconsistency_fatal=False),
738
834
access=self._pack_collection.inventory_index.data_access)
739
835
self.revisions = GroupCompressVersionedFiles(
740
836
_GCGraphIndex(self._pack_collection.revision_index.combined_index,
741
add_callback=self._pack_collection.revision_index.add_callback,
742
parents=True, is_locked=self.is_locked,
743
track_external_parent_refs=True, track_new_keys=True),
837
add_callback=self._pack_collection.revision_index.add_callback,
838
parents=True, is_locked=self.is_locked,
839
track_external_parent_refs=True, track_new_keys=True),
744
840
access=self._pack_collection.revision_index.data_access,
746
842
self.signatures = GroupCompressVersionedFiles(
747
843
_GCGraphIndex(self._pack_collection.signature_index.combined_index,
748
add_callback=self._pack_collection.signature_index.add_callback,
749
parents=False, is_locked=self.is_locked,
750
inconsistency_fatal=False),
844
add_callback=self._pack_collection.signature_index.add_callback,
845
parents=False, is_locked=self.is_locked,
846
inconsistency_fatal=False),
751
847
access=self._pack_collection.signature_index.data_access,
753
849
self.texts = GroupCompressVersionedFiles(
754
850
_GCGraphIndex(self._pack_collection.text_index.combined_index,
755
add_callback=self._pack_collection.text_index.add_callback,
756
parents=True, is_locked=self.is_locked,
757
inconsistency_fatal=False),
851
add_callback=self._pack_collection.text_index.add_callback,
852
parents=True, is_locked=self.is_locked,
853
inconsistency_fatal=False),
758
854
access=self._pack_collection.text_index.data_access)
759
855
# No parents, individual CHK pages don't have specific ancestry
760
856
self.chk_bytes = GroupCompressVersionedFiles(
761
857
_GCGraphIndex(self._pack_collection.chk_index.combined_index,
762
add_callback=self._pack_collection.chk_index.add_callback,
763
parents=False, is_locked=self.is_locked,
764
inconsistency_fatal=False),
858
add_callback=self._pack_collection.chk_index.add_callback,
859
parents=False, is_locked=self.is_locked,
860
inconsistency_fatal=False),
765
861
access=self._pack_collection.chk_index.data_access)
766
862
search_key_name = self._format._serializer.search_key_name
767
863
search_key_func = chk_map.search_key_registry.get(search_key_name)
861
957
raise AssertionError("%r not in write group" % (self,))
862
958
_mod_revision.check_not_reserved_id(new_revision_id)
863
959
basis_tree = None
864
if basis_inv is None:
960
if basis_inv is None or not isinstance(basis_inv, inventory.CHKInventory):
865
961
if basis_revision_id == _mod_revision.NULL_REVISION:
866
962
new_inv = self._create_inv_from_null(delta, new_revision_id)
963
if new_inv.root_id is None:
964
raise errors.RootMissing()
867
965
inv_lines = new_inv.to_lines()
868
966
return self._inventory_add_lines(new_revision_id, parents,
869
inv_lines, check_content=False), new_inv
967
inv_lines, check_content=False), new_inv
871
969
basis_tree = self.revision_tree(basis_revision_id)
872
970
basis_tree.lock_read()
873
basis_inv = basis_tree.inventory
971
basis_inv = basis_tree.root_inventory
875
973
result = basis_inv.create_by_apply_delta(delta, new_revision_id,
876
propagate_caches=propagate_caches)
974
propagate_caches=propagate_caches)
877
975
inv_lines = result.to_lines()
878
976
return self._inventory_add_lines(new_revision_id, parents,
879
inv_lines, check_content=False), result
977
inv_lines, check_content=False), result
881
979
if basis_tree is not None:
882
980
basis_tree.unlock()
884
982
def _deserialise_inventory(self, revision_id, bytes):
885
983
return inventory.CHKInventory.deserialise(self.chk_bytes, bytes,
888
986
def _iter_inventories(self, revision_ids, ordering):
889
987
"""Iterate over many inventory objects."""
896
994
if record.storage_kind != 'absent':
897
995
texts[record.key] = record.get_bytes_as('fulltext')
899
raise errors.NoSuchRevision(self, record.key)
997
texts[record.key] = None
901
yield inventory.CHKInventory.deserialise(self.chk_bytes, texts[key], key)
1001
yield (None, key[-1])
1003
yield (inventory.CHKInventory.deserialise(
1004
self.chk_bytes, bytes, key), key[-1])
903
def _iter_inventory_xmls(self, revision_ids, ordering):
1006
def _get_inventory_xml(self, revision_id):
1007
"""Get serialized inventory as a string."""
904
1008
# Without a native 'xml' inventory, this method doesn't make sense.
905
1009
# However older working trees, and older bundles want it - so we supply
906
1010
# it allowing _get_inventory_xml to work. Bundles currently use the
907
1011
# serializer directly; this also isn't ideal, but there isn't an xml
908
# iteration interface offered at all for repositories. We could make
909
# _iter_inventory_xmls be part of the contract, even if kept private.
910
inv_to_str = self._serializer.write_inventory_to_string
911
for inv in self.iter_inventories(revision_ids, ordering=ordering):
912
yield inv_to_str(inv), inv.revision_id
1012
# iteration interface offered at all for repositories.
1013
return self._serializer.write_inventory_to_string(
1014
self.get_inventory(revision_id))
914
1016
def _find_present_inventory_keys(self, revision_keys):
915
1017
parent_map = self.inventories.get_parent_map(revision_keys)
1013
1122
return GroupCHKStreamSource(self, to_format)
1014
1123
return super(CHKInventoryRepository, self)._get_source(to_format)
1017
class GroupCHKStreamSource(KnitPackStreamSource):
1125
def _find_inconsistent_revision_parents(self, revisions_iterator=None):
1126
"""Find revisions with different parent lists in the revision object
1127
and in the index graph.
1129
:param revisions_iterator: None, or an iterator of (revid,
1130
Revision-or-None). This iterator controls the revisions checked.
1131
:returns: an iterator yielding tuples of (revison-id, parents-in-index,
1132
parents-in-revision).
1134
if not self.is_locked():
1135
raise AssertionError()
1137
if revisions_iterator is None:
1138
revisions_iterator = self.iter_revisions(self.all_revision_ids())
1139
for revid, revision in revisions_iterator:
1140
if revision is None:
1142
parent_map = vf.get_parent_map([(revid,)])
1143
parents_according_to_index = tuple(parent[-1] for parent in
1144
parent_map[(revid,)])
1145
parents_according_to_revision = tuple(revision.parent_ids)
1146
if parents_according_to_index != parents_according_to_revision:
1147
yield (revid, parents_according_to_index,
1148
parents_according_to_revision)
1150
def _check_for_inconsistent_revision_parents(self):
1151
inconsistencies = list(self._find_inconsistent_revision_parents())
1153
raise errors.BzrCheckError(
1154
"Revision index has inconsistent parents.")
1157
class GroupCHKStreamSource(StreamSource):
1018
1158
"""Used when both the source and target repo are GroupCHK repos."""
1020
1160
def __init__(self, from_repository, to_format):
1087
1228
uninteresting_root_keys.add(inv.id_to_entry.key())
1088
1229
uninteresting_pid_root_keys.add(
1089
1230
inv.parent_id_basename_to_file_id.key())
1090
bytes_to_info = inventory.CHKInventory._bytes_to_utf8name_key
1091
1231
chk_bytes = self.from_repository.chk_bytes
1092
1233
def _filter_id_to_entry():
1093
1234
interesting_nodes = chk_map.iter_interesting_nodes(chk_bytes,
1094
self._chk_id_roots, uninteresting_root_keys)
1235
self._chk_id_roots, uninteresting_root_keys)
1095
1236
for record in _filter_text_keys(interesting_nodes, self._text_keys,
1237
chk_map._bytes_to_text_key):
1097
1238
if record is not None:
1100
1241
self._chk_id_roots = None
1101
1242
yield 'chk_bytes', _filter_id_to_entry()
1102
1244
def _get_parent_id_basename_to_file_id_pages():
1103
1245
for record, items in chk_map.iter_interesting_nodes(chk_bytes,
1104
self._chk_p_id_roots, uninteresting_pid_root_keys):
1246
self._chk_p_id_roots, uninteresting_pid_root_keys):
1105
1247
if record is not None:
1108
1250
self._chk_p_id_roots = None
1109
1251
yield 'chk_bytes', _get_parent_id_basename_to_file_id_pages()
1253
def _get_text_stream(self):
1254
# Note: We know we don't have to handle adding root keys, because both
1255
# the source and target are the identical network name.
1256
text_stream = self.from_repository.texts.get_record_stream(
1257
self._text_keys, self._text_fetch_order, False)
1258
return ('texts', text_stream)
1111
1260
def get_stream(self, search):
1261
def wrap_and_count(pb, rc, stream):
1262
"""Yield records from stream while showing progress."""
1264
for record in stream:
1265
if count == rc.STEP:
1267
pb.update('Estimate', rc.current, rc.max)
1112
1272
revision_ids = search.get_keys()
1273
pb = ui.ui_factory.nested_progress_bar()
1274
rc = self._record_counter
1275
self._record_counter.setup(len(revision_ids))
1113
1276
for stream_info in self._fetch_revision_texts(revision_ids):
1277
yield (stream_info[0],
1278
wrap_and_count(pb, rc, stream_info[1]))
1115
1279
self._revision_keys = [(rev_id,) for rev_id in revision_ids]
1116
self.from_repository.revisions.clear_cache()
1117
self.from_repository.signatures.clear_cache()
1118
yield self._get_inventory_stream(self._revision_keys)
1119
self.from_repository.inventories.clear_cache()
1120
1280
# TODO: The keys to exclude might be part of the search recipe
1121
1281
# For now, exclude all parents that are at the edge of ancestry, for
1122
1282
# which we have inventories
1123
1283
from_repo = self.from_repository
1124
1284
parent_keys = from_repo._find_parent_keys_of_revisions(
1125
self._revision_keys)
1285
self._revision_keys)
1286
self.from_repository.revisions.clear_cache()
1287
self.from_repository.signatures.clear_cache()
1288
# Clear the repo's get_parent_map cache too.
1289
self.from_repository._unstacked_provider.disable_cache()
1290
self.from_repository._unstacked_provider.enable_cache()
1291
s = self._get_inventory_stream(self._revision_keys)
1292
yield (s[0], wrap_and_count(pb, rc, s[1]))
1293
self.from_repository.inventories.clear_cache()
1126
1294
for stream_info in self._get_filtered_chk_streams(parent_keys):
1295
yield (stream_info[0], wrap_and_count(pb, rc, stream_info[1]))
1128
1296
self.from_repository.chk_bytes.clear_cache()
1129
yield self._get_text_stream()
1297
s = self._get_text_stream()
1298
yield (s[0], wrap_and_count(pb, rc, s[1]))
1130
1299
self.from_repository.texts.clear_cache()
1300
pb.update('Done', rc.max, rc.max)
1132
1303
def get_stream_for_missing_keys(self, missing_keys):
1133
1304
# missing keys can only occur when we are byte copying and not
1190
def _filter_text_keys(interesting_nodes_iterable, text_keys, bytes_to_info):
1361
def _filter_text_keys(interesting_nodes_iterable, text_keys, bytes_to_text_key):
1191
1362
"""Iterate the result of iter_interesting_nodes, yielding the records
1192
1363
and adding to text_keys.
1365
text_keys_update = text_keys.update
1194
1366
for record, items in interesting_nodes_iterable:
1195
for name, bytes in items:
1196
# Note: we don't care about name_utf8, because groupcompress repos
1197
# are always rich-root, so there are no synthesised root records to
1199
_, file_id, revision_id = bytes_to_info(bytes)
1200
file_id = intern(file_id)
1201
revision_id = intern(revision_id)
1202
text_keys.add(StaticTuple(file_id, revision_id).intern())
1367
text_keys_update([bytes_to_text_key(b) for n, b in items])
1208
class RepositoryFormatCHK1(RepositoryFormatPack):
1209
"""A hashed CHK+group compress pack repository."""
1371
class RepositoryFormat2a(RepositoryFormatPack):
1372
"""A CHK repository that uses the bencode revision serializer."""
1211
1374
repository_class = CHKInventoryRepository
1212
1375
supports_external_lookups = True
1213
1376
supports_chks = True
1214
# For right now, setting this to True gives us InterModel1And2 rather
1215
# than InterDifferingSerializer
1216
_commit_builder_class = PackRootCommitBuilder
1377
_commit_builder_class = PackCommitBuilder
1217
1378
rich_root_data = True
1218
_serializer = chk_serializer.chk_serializer_255_bigpage
1379
_serializer = chk_serializer.chk_bencode_serializer
1219
1380
_commit_inv_deltas = True
1220
1381
# What index classes to use
1221
1382
index_builder_class = BTreeBuilder
1227
1388
# multiple in-a-row (and sharing strings). Topological is better
1228
1389
# for remote, because we access less data.
1229
1390
_fetch_order = 'unordered'
1230
_fetch_uses_deltas = False # essentially ignored by the groupcompress code.
1391
# essentially ignored by the groupcompress code.
1392
_fetch_uses_deltas = False
1231
1393
fast_deltas = True
1232
1394
pack_compresses = True
1234
1396
def _get_matching_bzrdir(self):
1235
return bzrdir.format_registry.make_bzrdir('development6-rich-root')
1237
def _ignore_setting_bzrdir(self, format):
1240
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
1242
def get_format_string(self):
1243
"""See RepositoryFormat.get_format_string()."""
1244
return ('Bazaar development format - group compression and chk inventory'
1245
' (needs bzr.dev from 1.14)\n')
1247
def get_format_description(self):
1248
"""See RepositoryFormat.get_format_description()."""
1249
return ("Development repository format - rich roots, group compression"
1250
" and chk inventories")
1253
class RepositoryFormatCHK2(RepositoryFormatCHK1):
1254
"""A CHK repository that uses the bencode revision serializer."""
1256
_serializer = chk_serializer.chk_bencode_serializer
1258
def _get_matching_bzrdir(self):
1259
return bzrdir.format_registry.make_bzrdir('development7-rich-root')
1261
def _ignore_setting_bzrdir(self, format):
1264
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
1266
def get_format_string(self):
1267
"""See RepositoryFormat.get_format_string()."""
1268
return ('Bazaar development format - chk repository with bencode '
1269
'revision serialization (needs bzr.dev from 1.16)\n')
1272
class RepositoryFormat2a(RepositoryFormatCHK2):
1273
"""A CHK repository that uses the bencode revision serializer.
1275
This is the same as RepositoryFormatCHK2 but with a public name.
1278
_serializer = chk_serializer.chk_bencode_serializer
1280
def _get_matching_bzrdir(self):
1281
return bzrdir.format_registry.make_bzrdir('2a')
1283
def _ignore_setting_bzrdir(self, format):
1286
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
1288
def get_format_string(self):
1289
return ('Bazaar repository format 2a (needs bzr 1.16 or later)\n')
1397
return controldir.format_registry.make_controldir('2a')
1399
def _ignore_setting_bzrdir(self, format):
1402
_matchingcontroldir = property(
1403
_get_matching_bzrdir, _ignore_setting_bzrdir)
1406
def get_format_string(cls):
1407
return b'Bazaar repository format 2a (needs bzr 1.16 or later)\n'
1291
1409
def get_format_description(self):
1292
1410
"""See RepositoryFormat.get_format_description()."""
1293
1411
return ("Repository format 2a - rich roots, group compression"
1294
" and chk inventories")
1412
" and chk inventories")
1415
class RepositoryFormat2aSubtree(RepositoryFormat2a):
1416
"""A 2a repository format that supports nested trees.
1420
def _get_matching_bzrdir(self):
1421
return controldir.format_registry.make_controldir('development-subtree')
1423
def _ignore_setting_bzrdir(self, format):
1426
_matchingcontroldir = property(
1427
_get_matching_bzrdir, _ignore_setting_bzrdir)
1430
def get_format_string(cls):
1431
return b'Bazaar development format 8\n'
1433
def get_format_description(self):
1434
"""See RepositoryFormat.get_format_description()."""
1435
return ("Development repository format 8 - nested trees, "
1436
"group compression and chk inventories")
1439
supports_tree_reference = True