~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

(mbp) merge bzr.dev to 0.8, prepare for release

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
    def _fetch_weave_texts(self, revs):
158
158
        texts_pb = bzrlib.ui.ui_factory.nested_progress_bar()
159
159
        try:
160
 
            file_ids = self.from_repository.fileid_involved_by_set(revs)
 
160
            file_ids = self.from_repository.fileids_altered_by_revision_ids(revs)
161
161
            count = 0
162
162
            num_file_ids = len(file_ids)
163
 
            for file_id in file_ids:
 
163
            for file_id, required_versions in file_ids.items():
164
164
                texts_pb.update("fetch texts", count, num_file_ids)
165
165
                count +=1
166
 
                try:
167
 
                    to_weave = self.to_weaves.get_weave(file_id,
168
 
                        self.to_repository.get_transaction())
169
 
                except errors.NoSuchFile:
170
 
                    # destination is empty, just copy it.
171
 
                    # this copies all the texts, which is useful and 
172
 
                    # on per-file basis quite cheap.
173
 
                    self.to_weaves.copy_multi(
174
 
                        self.from_weaves,
175
 
                        [file_id],
176
 
                        None,
177
 
                        self.from_repository.get_transaction(),
178
 
                        self.to_repository.get_transaction())
179
 
                else:
180
 
                    # destination has contents, must merge
181
 
                    from_weave = self.from_weaves.get_weave(file_id,
182
 
                        self.from_repository.get_transaction())
183
 
                    # we fetch all the texts, because texts do
184
 
                    # not reference anything, and its cheap enough
185
 
                    to_weave.join(from_weave)
 
166
                to_weave = self.to_weaves.get_weave_or_empty(file_id,
 
167
                    self.to_repository.get_transaction())
 
168
                from_weave = self.from_weaves.get_weave(file_id,
 
169
                    self.from_repository.get_transaction())
 
170
                # we fetch all the texts, because texts do
 
171
                # not reference anything, and its cheap enough
 
172
                to_weave.join(from_weave, version_ids=required_versions)
186
173
        finally:
187
174
            texts_pb.finished()
188
175