~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: John Arbash Meinel
  • Date: 2010-02-10 17:52:08 UTC
  • mfrom: (5021 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5023.
  • Revision ID: john@arbash-meinel.com-20100210175208-bubuwav4uqigu291
Merge bzr.dev 5021 to resolve NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
2165
2165
        """
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()
2169
 
        try:
2170
 
            return self._find_file_ids_from_xml_inventory_lines(
2171
 
                w.iter_lines_added_or_present_in_keys(
2172
 
                    selected_keys, pb=pb),
2173
 
                selected_keys)
2174
 
        finally:
2175
 
            pb.finished()
 
2168
        return self._find_file_ids_from_xml_inventory_lines(
 
2169
            w.iter_lines_added_or_present_in_keys(
 
2170
                selected_keys, pb=None),
 
2171
            selected_keys)
2176
2172
 
2177
2173
    def iter_files_bytes(self, desired_files):
2178
2174
        """Iterate through file versions.
3415
3411
 
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.
 
3414
        :param pb: ignored.
3420
3415
        :return: None.
3421
3416
        """
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)
3427
3422
 
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.
4091
4086
        """
4092
 
        self.pb = pb
 
4087
        pb = ui.ui_factory.nested_progress_bar()
4093
4088
        self.count = 0
4094
4089
        self.total = 4
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,
4104
4099
            _found=True,
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()
4110
4105
        try:
4111
 
            self.step('Copying content')
 
4106
            pb.update('Copying content')
4112
4107
            self.source_repo.copy_content_into(converted)
4113
4108
        finally:
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')
4118
 
 
4119
 
    def step(self, message):
4120
 
        """Update the pb by a step."""
4121
 
        self.count +=1
4122
 
        self.pb.update(message, self.count, self.total)
 
4113
        pb.finished()
4123
4114
 
4124
4115
 
4125
4116
_unescape_map = {