~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-05-12 03:07:05 UTC
  • mfrom: (3350.3.22 data_stream_revamp)
  • Revision ID: pqm@pqm.ubuntu.com-20080512030705-nvl2q1tuls904eru
Deprecate bzrlib.versionedfiles.VersionedFile.join.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        )
41
41
from bzrlib.trace import mutter
42
42
import bzrlib.ui
43
 
 
44
 
from bzrlib.lazy_import import lazy_import
 
43
from bzrlib.versionedfile import filter_absent
45
44
 
46
45
# TODO: Avoid repeatedly opening weaves so many times.
47
46
 
217
216
            self.to_repository.get_transaction())
218
217
        from_weave = self.from_weaves.get_weave(file_id,
219
218
            self.from_repository.get_transaction())
220
 
        # we fetch all the texts, because texts do
221
 
        # not reference anything, and its cheap enough
222
 
        to_weave.join(from_weave, version_ids=required_versions)
 
219
        # Fetch all the texts.
 
220
        to_weave.insert_record_stream(from_weave.get_record_stream(
 
221
            required_versions, 'topological', False))
223
222
 
224
223
    def _fetch_inventory_weave(self, revs, pb):
225
224
        pb.update("fetch inventory", 0, 2)
235
234
            # know for unselected inventories whether all their required
236
235
            # texts are present in the other repository - it could be
237
236
            # corrupt.
238
 
            to_weave.join(from_weave, pb=child_pb, msg='merge inventory',
239
 
                          version_ids=revs)
 
237
            to_weave.insert_record_stream(from_weave.get_record_stream(revs,
 
238
                'topological', False))
240
239
        finally:
241
240
            child_pb.finished()
242
241
 
301
300
            to_transaction)
302
301
        from_sf = self.from_repository._revision_store.get_signature_file(
303
302
            from_transaction)
304
 
        to_sf.join(from_sf, version_ids=revs, ignore_missing=True)
 
303
        # A missing signature is just skipped.
 
304
        to_sf.insert_record_stream(filter_absent(from_sf.get_record_stream(revs,
 
305
            'unordered', False)))
305
306
        self._fetch_just_revision_texts(revs, from_transaction, to_transaction)
306
307
 
307
308
    def _fetch_just_revision_texts(self, version_ids, from_transaction,
310
311
            to_transaction)
311
312
        from_rf = self.from_repository._revision_store.get_revision_file(
312
313
            from_transaction)
313
 
        to_rf.join(from_rf, version_ids=version_ids)
 
314
        to_rf.insert_record_stream(from_rf.get_record_stream(version_ids,
 
315
            'topological', False))
314
316
 
315
317
 
316
318
class Inter1and2Helper(object):