1648
1648
def _abort_write_group(self):
1649
1649
# FIXME: just drop the transient index.
1650
1650
# forget what names there are
1651
self._new_pack.abort()
1652
self._remove_pack_indices(self._new_pack)
1653
self._new_pack = None
1651
if self._new_pack is not None:
1652
self._new_pack.abort()
1653
self._remove_pack_indices(self._new_pack)
1654
self._new_pack = None
1654
1655
self.repo._text_knit = None
1656
1657
def _commit_write_group(self):
1925
1926
found_parents[key[0]] = parents
1926
1927
return found_parents
1929
def has_revisions(self, revision_ids):
1930
"""See Repository.has_revisions()."""
1931
revision_ids = set(revision_ids)
1932
result = revision_ids.intersection(
1933
set([None, _mod_revision.NULL_REVISION]))
1934
revision_ids.difference_update(result)
1935
index = self._pack_collection.revision_index.combined_index
1936
keys = [(revision_id,) for revision_id in revision_ids]
1937
result.update(node[1][0] for node in index.iter_entries(keys))
1928
1940
def _make_parents_provider(self):
1929
1941
return graph.CachingParentsProvider(self)
2237
2251
def get_format_description(self):
2238
2252
"""See RepositoryFormat.get_format_description()."""
2239
2253
return "Packs containing knits with rich root support\n"
2256
class RepositoryFormatPackDevelopment0(RepositoryFormatPack):
2257
"""A no-subtrees development repository.
2259
This format should be retained until the second release after bzr 1.0.
2261
No changes to the disk behaviour from pack-0.92.
2264
repository_class = KnitPackRepository
2265
_commit_builder_class = PackCommitBuilder
2266
_serializer = xml5.serializer_v5
2268
def _get_matching_bzrdir(self):
2269
return bzrdir.format_registry.make_bzrdir('development0')
2271
def _ignore_setting_bzrdir(self, format):
2274
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
2276
def get_format_string(self):
2277
"""See RepositoryFormat.get_format_string()."""
2278
return "Bazaar development format 0 (needs bzr.dev from before 1.3)\n"
2280
def get_format_description(self):
2281
"""See RepositoryFormat.get_format_description()."""
2282
return ("Development repository format, currently the same as "
2285
def check_conversion_target(self, target_format):
2289
class RepositoryFormatPackDevelopment0Subtree(RepositoryFormatPack):
2290
"""A subtrees development repository.
2292
This format should be retained until the second release after bzr 1.0.
2294
No changes to the disk behaviour from pack-0.92-subtree.
2297
repository_class = KnitPackRepository
2298
_commit_builder_class = PackRootCommitBuilder
2299
rich_root_data = True
2300
supports_tree_reference = True
2301
_serializer = xml7.serializer_v7
2303
def _get_matching_bzrdir(self):
2304
return bzrdir.format_registry.make_bzrdir(
2305
'development0-subtree')
2307
def _ignore_setting_bzrdir(self, format):
2310
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
2312
def check_conversion_target(self, target_format):
2313
if not target_format.rich_root_data:
2314
raise errors.BadConversionTarget(
2315
'Does not support rich root data.', target_format)
2316
if not getattr(target_format, 'supports_tree_reference', False):
2317
raise errors.BadConversionTarget(
2318
'Does not support nested trees', target_format)
2320
def get_format_string(self):
2321
"""See RepositoryFormat.get_format_string()."""
2322
return ("Bazaar development format 0 with subtree support "
2323
"(needs bzr.dev from before 1.3)\n")
2325
def get_format_description(self):
2326
"""See RepositoryFormat.get_format_description()."""
2327
return ("Development repository format, currently the same as "
2328
"pack-0.92-subtree\n")