643
643
self.pb.update("Copying inventory texts", 2)
644
644
total_items, readv_group_iter = self._least_readv_node_readv(inv_nodes)
645
# Only grab the output lines if we will be processing them
646
output_lines = bool(self.revision_ids)
647
645
inv_lines = self._copy_nodes_graph(inventory_index_map,
648
646
self.new_pack._writer, self.new_pack.inventory_index,
649
readv_group_iter, total_items, output_lines=output_lines)
647
readv_group_iter, total_items, output_lines=True)
650
648
if self.revision_ids:
651
649
self._process_inventory_lines(inv_lines)
658
656
time.ctime(), self._pack_collection._upload_transport.base,
659
657
self.new_pack.random_name,
660
658
self.new_pack.inventory_index.key_count(),
661
time.time() - self.new_pack.start_time)
659
time.time() - new_pack.start_time)
663
661
def _copy_text_texts(self):
664
662
# select text keys
1928
1926
found_parents[key[0]] = parents
1929
1927
return found_parents
1932
def get_revision_graph(self, revision_id=None):
1933
"""Return a dictionary containing the revision graph.
1935
:param revision_id: The revision_id to get a graph from. If None, then
1936
the entire revision graph is returned. This is a deprecated mode of
1937
operation and will be removed in the future.
1938
:return: a dictionary of revision_id->revision_parents_list.
1940
if 'evil' in debug.debug_flags:
1942
"get_revision_graph scales with size of history.")
1943
# special case NULL_REVISION
1944
if revision_id == _mod_revision.NULL_REVISION:
1946
if revision_id is None:
1947
revision_vf = self._get_revision_vf()
1948
return revision_vf.get_graph()
1949
g = self.get_graph()
1950
first = g.get_parent_map([revision_id])
1951
if revision_id not in first:
1952
raise errors.NoSuchRevision(self, revision_id)
1956
NULL_REVISION = _mod_revision.NULL_REVISION
1957
ghosts = set([NULL_REVISION])
1958
for rev_id, parent_ids in g.iter_ancestry([revision_id]):
1959
if parent_ids is None: # This is a ghost
1962
ancestry[rev_id] = parent_ids
1963
for p in parent_ids:
1965
children[p].append(rev_id)
1967
children[p] = [rev_id]
1969
if NULL_REVISION in ancestry:
1970
del ancestry[NULL_REVISION]
1972
# Find all nodes that reference a ghost, and filter the ghosts out
1973
# of their parent lists. To preserve the order of parents, and
1974
# avoid double filtering nodes, we just find all children first,
1976
children_of_ghosts = set()
1977
for ghost in ghosts:
1978
children_of_ghosts.update(children[ghost])
1980
for child in children_of_ghosts:
1981
ancestry[child] = tuple(p for p in ancestry[child]
1985
1929
def has_revisions(self, revision_ids):
1986
1930
"""See Repository.has_revisions()."""
1987
1931
revision_ids = set(revision_ids)
2307
2249
def get_format_description(self):
2308
2250
"""See RepositoryFormat.get_format_description()."""
2309
2251
return "Packs containing knits with rich root support\n"
2312
class RepositoryFormatPackDevelopment0(RepositoryFormatPack):
2313
"""A no-subtrees development repository.
2315
This format should be retained until the second release after bzr 1.0.
2317
No changes to the disk behaviour from pack-0.92.
2320
repository_class = KnitPackRepository
2321
_commit_builder_class = PackCommitBuilder
2322
_serializer = xml5.serializer_v5
2324
def _get_matching_bzrdir(self):
2325
return bzrdir.format_registry.make_bzrdir('development0')
2327
def _ignore_setting_bzrdir(self, format):
2330
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
2332
def get_format_string(self):
2333
"""See RepositoryFormat.get_format_string()."""
2334
return "Bazaar development format 0 (needs bzr.dev from before 1.3)\n"
2336
def get_format_description(self):
2337
"""See RepositoryFormat.get_format_description()."""
2338
return ("Development repository format, currently the same as "
2341
def check_conversion_target(self, target_format):
2345
class RepositoryFormatPackDevelopment0Subtree(RepositoryFormatPack):
2346
"""A subtrees development repository.
2348
This format should be retained until the second release after bzr 1.0.
2350
No changes to the disk behaviour from pack-0.92-subtree.
2353
repository_class = KnitPackRepository
2354
_commit_builder_class = PackRootCommitBuilder
2355
rich_root_data = True
2356
supports_tree_reference = True
2357
_serializer = xml7.serializer_v7
2359
def _get_matching_bzrdir(self):
2360
return bzrdir.format_registry.make_bzrdir(
2361
'development0-subtree')
2363
def _ignore_setting_bzrdir(self, format):
2366
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
2368
def check_conversion_target(self, target_format):
2369
if not target_format.rich_root_data:
2370
raise errors.BadConversionTarget(
2371
'Does not support rich root data.', target_format)
2372
if not getattr(target_format, 'supports_tree_reference', False):
2373
raise errors.BadConversionTarget(
2374
'Does not support nested trees', target_format)
2376
def get_format_string(self):
2377
"""See RepositoryFormat.get_format_string()."""
2378
return ("Bazaar development format 0 with subtree support "
2379
"(needs bzr.dev from before 1.3)\n")
2381
def get_format_description(self):
2382
"""See RepositoryFormat.get_format_description()."""
2383
return ("Development repository format, currently the same as "
2384
"pack-0.92-subtree\n")