~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

Get a working chk_map using inventory implementation bootstrapped.

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
                    text_keys.extend([(file_id, revision) for revision in
176
176
                        revisions])
177
177
                elif knit_kind == "inventory":
178
 
                    # Now copy the file texts.
 
178
                    # When the inventory keys start being reported, all text
 
179
                    # keys have already been issued - and we want the text keys
 
180
                    # inserted before inventory keys: copy the texts.
179
181
                    to_texts = self.to_repository.texts
180
182
                    from_texts = self.from_repository.texts
181
183
                    to_texts.insert_record_stream(from_texts.get_record_stream(
240
242
            # know for unselected inventories whether all their required
241
243
            # texts are present in the other repository - it could be
242
244
            # corrupt.
243
 
            to_weave.insert_record_stream(from_weave.get_record_stream(
244
 
                [(rev_id,) for rev_id in revs],
245
 
                self.to_repository._fetch_order,
246
 
                not self.to_repository._fetch_uses_deltas))
 
245
            if self.to_repository._format.supports_chks:
 
246
                # Hack to make chk->chk fetch: copy the inventories as
 
247
                # inventories.
 
248
                total = len(revs)
 
249
                for pos, inv in enumerate(
 
250
                    self.from_repository.iter_inventories(revs)):
 
251
                    pb.update("Copying inventories", pos, total)
 
252
                    self.to_repository.add_inventory(inv.revision_id, inv, [])
 
253
            else:
 
254
                to_weave.insert_record_stream(from_weave.get_record_stream(
 
255
                    [(rev_id,) for rev_id in revs],
 
256
                    self.to_repository._fetch_order,
 
257
                    not self.to_repository._fetch_uses_deltas))
247
258
        finally:
248
259
            child_pb.finished()
249
260