/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

  • Committer: Andrew Bennetts
  • Date: 2009-07-15 06:40:06 UTC
  • mto: (4476.3.44 inventory-delta)
  • mto: This revision was merged to the branch mainline in revision 4608.
  • Revision ID: andrew.bennetts@canonical.com-20090715064006-iirougzknhfi9bvx
Add Repository.get_stream_1.18 verb.

Show diffs side-by-side

added added

removed removed

Lines of Context:
583
583
        self._ensure_real()
584
584
        return self._custom_format._serializer
585
585
 
 
586
    @property
 
587
    def repository_class(self):
 
588
        self._ensure_real()
 
589
        return self._custom_format.repository_class
 
590
 
586
591
 
587
592
class RemoteRepository(_RpcHelper):
588
593
    """Repository accessed over rpc.
1830
1835
            return self._real_stream(repo, search)
1831
1836
        client = repo._client
1832
1837
        medium = client._medium
1833
 
        if medium._is_remote_before((1, 13)):
1834
 
            # streaming was added in 1.13
1835
 
            return self._real_stream(repo, search)
1836
1838
        path = repo.bzrdir._path_for_remote_call(client)
1837
 
        try:
1838
 
            search_bytes = repo._serialise_search_result(search)
1839
 
            response = repo._call_with_body_bytes_expecting_body(
1840
 
                'Repository.get_stream',
1841
 
                (path, self.to_format.network_name()), search_bytes)
1842
 
            response_tuple, response_handler = response
1843
 
        except errors.UnknownSmartMethod:
1844
 
            medium._remember_remote_is_before((1,13))
 
1839
        search_bytes = repo._serialise_search_result(search)
 
1840
        args = (path, self.to_format.network_name())
 
1841
        candidate_verbs = [
 
1842
            ('Repository.get_stream_1.18', (1, 18)),
 
1843
            ('Repository.get_stream', (1, 13))]
 
1844
        found_verb = False
 
1845
        for verb, version in candidate_verbs:
 
1846
            if medium._is_remote_before(version):
 
1847
                continue
 
1848
            try:
 
1849
                response = repo._call_with_body_bytes_expecting_body(
 
1850
                    verb, args, search_bytes)
 
1851
            except errors.UnknownSmartMethod:
 
1852
                medium._remember_remote_is_before(version)
 
1853
            else:
 
1854
                response_tuple, response_handler = response
 
1855
                found_verb = True
 
1856
                break
 
1857
        if not found_verb:
1845
1858
            return self._real_stream(repo, search)
1846
1859
        if response_tuple[0] != 'ok':
1847
1860
            raise errors.UnexpectedSmartServerResponse(response_tuple)