399
399
revision_ids. Each altered file-ids has the exact revision_ids that
400
400
altered it listed explicitly.
402
assert isinstance(self._format, (RepositoryFormat5,
405
RepositoryFormatKnit1)), \
402
assert self._format.has_unnested_inventory(), \
406
403
("fileids_altered_by_revision_ids only supported for branches "
407
404
"which store inventory as unnested xml, not on %r" % self)
408
405
selected_revision_ids = set(revision_ids)
1117
def has_unnested_inventory(self):
1118
raise NotImplementedError(self.has_unnested_inventory)
1120
def check_conversion_target(self, target_format):
1121
raise NotImplementedError(self.check_conversion_target)
1120
1123
def open(self, a_bzrdir, _found=False):
1121
1124
"""Return an instance of this format for the bzrdir a_bzrdir.
1210
1213
control_store=control_store,
1211
1214
text_store=text_store)
1216
def check_conversion_target(self, target_format):
1214
1220
class RepositoryFormat4(PreSplitOutRepositoryFormat):
1215
1221
"""Bzr repository format 4.
1231
1237
"""See RepositoryFormat.get_format_description()."""
1232
1238
return "Repository format 4"
1240
def has_unnested_inventory(self):
1234
1243
def initialize(self, url, shared=False, _internal=False):
1235
1244
"""Format 4 branches cannot be created."""
1236
1245
raise errors.UninitializableFormat(self)
1280
1289
"""See RepositoryFormat.get_format_description()."""
1281
1290
return "Weave repository format 5"
1292
def has_unnested_inventory(self):
1283
1295
def _get_revision_store(self, repo_transport, control_files):
1284
1296
"""See RepositoryFormat._get_revision_store()."""
1285
1297
"""Return the revision store object for this a_bzrdir."""
1310
1322
"""See RepositoryFormat.get_format_description()."""
1311
1323
return "Weave repository format 6"
1325
def has_unnested_inventory(self):
1313
1328
def _get_revision_store(self, repo_transport, control_files):
1314
1329
"""See RepositoryFormat._get_revision_store()."""
1315
1330
return self._get_text_rev_store(repo_transport,
1383
1398
"""See RepositoryFormat.get_format_description()."""
1384
1399
return "Weave repository format 7"
1401
def has_unnested_inventory(self):
1404
def check_conversion_target(self, target_format):
1386
1407
def _get_revision_store(self, repo_transport, control_files):
1387
1408
"""See RepositoryFormat._get_revision_store()."""
1388
1409
return self._get_text_rev_store(repo_transport,
1493
1514
versionedfile_class=KnitVersionedFile,
1517
def has_unnested_inventory(self):
1496
1520
def initialize(self, a_bzrdir, shared=False):
1497
1521
"""Create a knit format 1 repository.
1566
1591
"""See RepositoryFormat.get_format_description()."""
1567
1592
return "Knit repository format 1"
1594
def check_conversion_target(self, target_format):
1598
class RepositoryFormatKnit2(RepositoryFormatKnit):
1599
"""Bzr repository knit format 2.
1601
THIS FORMAT IS EXPERIMENTAL
1602
This repository format has:
1603
- knits for file texts and inventory
1604
- hash subdirectory based stores.
1605
- knits for revisions and signatures
1606
- TextStores for revisions and signatures.
1607
- a format marker of its own
1608
- an optional 'shared-storage' flag
1609
- an optional 'no-working-trees' flag
1611
- Support for recording full info about the tree root
1614
def get_format_string(self):
1615
"""See RepositoryFormat.get_format_string()."""
1616
return "Bazaar Knit Repository Format 2"
1618
def get_format_description(self):
1619
"""See RepositoryFormat.get_format_description()."""
1620
return "Knit repository format 2"
1622
def check_conversion_target(self, target_format):
1623
if not getattr(target_format, 'rich_root_data', False):
1624
raise errors.BadConversionTarget(
1625
'Does not support rich root data.', target_format)
1569
1628
# formats which have no format string are not discoverable
1570
1629
# and not independently creatable, so are not registered.
1571
1630
RepositoryFormat.register_format(RepositoryFormat7())
1572
1631
_default_format = RepositoryFormatKnit1()
1573
1632
RepositoryFormat.register_format(_default_format)
1633
RepositoryFormat.register_format(RepositoryFormatKnit2())
1574
1634
RepositoryFormat.set_default_format(_default_format)
1575
1635
_legacy_formats = [RepositoryFormat4(),
1576
1636
RepositoryFormat5(),
1957
2017
self.step('Moving repository to repository.backup')
1958
2018
self.repo_dir.transport.move('repository', 'repository.backup')
1959
2019
backup_transport = self.repo_dir.transport.clone('repository.backup')
2020
repo._format.check_conversion_target(self.target_format)
1960
2021
self.source_repo = repo._format.open(self.repo_dir,
1962
2023
_override_transport=backup_transport)