2166
2166
selected_keys = set((revid,) for revid in revision_ids)
2167
2167
w = _inv_weave or self.inventories
2168
pb = ui.ui_factory.nested_progress_bar()
2170
return self._find_file_ids_from_xml_inventory_lines(
2171
w.iter_lines_added_or_present_in_keys(
2172
selected_keys, pb=pb),
2168
return self._find_file_ids_from_xml_inventory_lines(
2169
w.iter_lines_added_or_present_in_keys(
2170
selected_keys, pb=None),
2177
2173
def iter_files_bytes(self, desired_files):
2178
2174
"""Iterate through file versions.
3416
3412
:param revision_id: if None all content is copied, if NULL_REVISION no
3417
3413
content is copied.
3418
:param pb: optional progress bar to use for progress reports. If not
3419
provided a default one will be created.
3422
3417
f = _mod_fetch.RepoFetcher(to_repository=self.target,
3423
3418
from_repository=self.source,
3424
3419
last_revision=revision_id,
3425
3420
fetch_spec=fetch_spec,
3426
pb=pb, find_ghosts=find_ghosts)
3421
find_ghosts=find_ghosts)
3428
3423
def _walk_to_common_revisions(self, revision_ids):
3429
3424
"""Walk out from revision_ids in source to revisions target has.
4089
4084
:param to_convert: The disk object to convert.
4090
4085
:param pb: a progress bar to use for progress information.
4087
pb = ui.ui_factory.nested_progress_bar()
4095
4090
# this is only useful with metadir layouts - separated repo content.
4096
4091
# trigger an assertion if not such
4097
4092
repo._format.get_format_string()
4098
4093
self.repo_dir = repo.bzrdir
4099
self.step('Moving repository to repository.backup')
4094
pb.update('Moving repository to repository.backup')
4100
4095
self.repo_dir.transport.move('repository', 'repository.backup')
4101
4096
backup_transport = self.repo_dir.transport.clone('repository.backup')
4102
4097
repo._format.check_conversion_target(self.target_format)
4103
4098
self.source_repo = repo._format.open(self.repo_dir,
4105
4100
_override_transport=backup_transport)
4106
self.step('Creating new repository')
4101
pb.update('Creating new repository')
4107
4102
converted = self.target_format.initialize(self.repo_dir,
4108
4103
self.source_repo.is_shared())
4109
4104
converted.lock_write()
4111
self.step('Copying content')
4106
pb.update('Copying content')
4112
4107
self.source_repo.copy_content_into(converted)
4114
4109
converted.unlock()
4115
self.step('Deleting old repository content')
4110
pb.update('Deleting old repository content')
4116
4111
self.repo_dir.transport.delete_tree('repository.backup')
4117
4112
ui.ui_factory.note('repository converted')
4119
def step(self, message):
4120
"""Update the pb by a step."""
4122
self.pb.update(message, self.count, self.total)
4125
4116
_unescape_map = {