203
204
return self._get_revision_vf().get_parents(revision_id)
206
class KnitRepository2(KnitRepository):
207
class KnitRepository3(KnitRepository):
208
209
def __init__(self, _format, a_bzrdir, control_files, _revision_store,
209
210
control_store, text_store):
210
211
KnitRepository.__init__(self, _format, a_bzrdir, control_files,
211
212
_revision_store, control_store, text_store)
212
self._serializer = xml6.serializer_v6
213
self._serializer = xml7.serializer_v7
214
215
def deserialise_inventory(self, revision_id, xml):
215
216
"""Transform the xml into an inventory object.
374
375
This format was introduced in bzr 0.8.
378
def __ne__(self, other):
379
return self.__class__ is not other.__class__
377
381
def get_format_string(self):
378
382
"""See RepositoryFormat.get_format_string()."""
379
383
return "Bazaar-NG Knit Repository Format 1"
389
class RepositoryFormatKnit2(RepositoryFormatKnit):
393
class RepositoryFormatKnit3(RepositoryFormatKnit):
390
394
"""Bzr repository knit format 2.
392
THIS FORMAT IS EXPERIMENTAL
393
396
This repository format has:
394
397
- knits for file texts and inventory
395
398
- hash subdirectory based stores.
399
402
- an optional 'shared-storage' flag
400
403
- an optional 'no-working-trees' flag
402
- Support for recording full info about the tree root
405
- support for recording full info about the tree root
406
- support for recording tree-references
409
repository_class = KnitRepository3
406
410
rich_root_data = True
408
def get_format_string(self):
409
"""See RepositoryFormat.get_format_string()."""
410
return "Bazaar Knit Repository Format 2\n"
412
def get_format_description(self):
413
"""See RepositoryFormat.get_format_description()."""
414
return "Knit repository format 2"
411
support_tree_reference = True
413
def _get_matching_bzrdir(self):
414
return bzrdir.format_registry.make_bzrdir('dirstate-with-subtree')
416
def _ignore_setting_bzrdir(self, format):
419
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
416
421
def check_conversion_target(self, target_format):
417
422
if not target_format.rich_root_data:
418
423
raise errors.BadConversionTarget(
419
424
'Does not support rich root data.', target_format)
425
if not getattr(target_format, 'support_tree_reference', False):
426
raise errors.BadConversionTarget(
427
'Does not support nested trees', target_format)
429
def get_format_string(self):
430
"""See RepositoryFormat.get_format_string()."""
431
return "Bazaar Knit Repository Format 3 (bzr 0.15)\n"
433
def get_format_description(self):
434
"""See RepositoryFormat.get_format_description()."""
435
return "Knit repository format 3"
421
437
def open(self, a_bzrdir, _found=False, _override_transport=None):
422
438
"""See RepositoryFormat.open().
437
453
text_store = self._get_text_store(repo_transport, control_files)
438
454
control_store = self._get_control_store(repo_transport, control_files)
439
455
_revision_store = self._get_revision_store(repo_transport, control_files)
440
return KnitRepository2(_format=self,
442
control_files=control_files,
443
_revision_store=_revision_store,
444
control_store=control_store,
445
text_store=text_store)
456
return self.repository_class(_format=self,
458
control_files=control_files,
459
_revision_store=_revision_store,
460
control_store=control_store,
461
text_store=text_store)