~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

  • Committer: Robert Collins
  • Date: 2009-02-27 13:05:36 UTC
  • mto: This revision was merged to the branch mainline in revision 4067.
  • Revision ID: robertc@robertcollins.net-20090227130536-wsqoyhyt3n11nc8d
Implement the separate source component for fetch - repository.StreamSource.

Show diffs side-by-side

added added

removed removed

Lines of Context:
624
624
        """See Repository._get_sink()."""
625
625
        return RemoteStreamSink(self)
626
626
 
 
627
    def _get_source(self, to_format):
 
628
        """Return a source for streaming from this repository."""
 
629
        return RemoteStreamSource(self, to_format)
 
630
 
627
631
    def has_revision(self, revision_id):
628
632
        """See Repository.has_revision()."""
629
633
        if revision_id == NULL_REVISION:
1405
1409
 
1406
1410
class RemoteStreamSink(repository.StreamSink):
1407
1411
 
1408
 
    def __init__(self, target_repo):
1409
 
        repository.StreamSink.__init__(self, target_repo)
1410
 
 
1411
1412
    def _insert_real(self, stream, src_format, resume_tokens):
1412
1413
        self.target_repo._ensure_real()
1413
1414
        sink = self.target_repo._real_repository._get_sink()
1491
1492
            yield b
1492
1493
 
1493
1494
 
 
1495
class RemoteStreamSource(repository.StreamSource):
 
1496
    """Stream data from a remote server."""
 
1497
 
 
1498
 
1494
1499
class RemoteBranchLockableFiles(LockableFiles):
1495
1500
    """A 'LockableFiles' implementation that talks to a smart server.
1496
1501