~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

  • Committer: Andrew Bennetts
  • Date: 2008-03-28 08:05:51 UTC
  • mto: This revision was merged to the branch mainline in revision 3321.
  • Revision ID: andrew.bennetts@canonical.com-20080328080551-n7f6rejuycnzn0p8
Change _SmartClient's API to accept a medium and a base, rather than a _SharedConnection.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
        self._real_bzrdir = None
63
63
 
64
64
        if _client is None:
65
 
            self._shared_medium = transport.get_shared_medium()
66
 
            self._client = client._SmartClient(self._shared_medium)
 
65
            shared_connection = transport.get_shared_medium()
 
66
            self._client = client._SmartClient(
 
67
                shared_connection.connection, shared_connection.base)
67
68
        else:
68
69
            self._client = _client
69
 
            self._shared_medium = None
70
70
            return
71
71
 
72
72
        path = self._path_for_remote_call(self._client)
277
277
            self._real_repository = None
278
278
        self.bzrdir = remote_bzrdir
279
279
        if _client is None:
280
 
            self._client = client._SmartClient(self.bzrdir._shared_medium)
 
280
            self._client = remote_bzrdir._client
281
281
        else:
282
282
            self._client = _client
283
283
        self._format = format
836
836
 
837
837
    def _get_parent_map(self, keys):
838
838
        """Helper for get_parent_map that performs the RPC."""
839
 
        medium = self._client.get_smart_medium()
 
839
        medium = self._client._medium
840
840
        if not medium._remote_is_at_least_1_2:
841
841
            # We already found out that the server can't understand
842
842
            # Repository.get_parent_map requests, so just fetch the whole
1055
1055
        return self._real_repository.has_signature_for_revision_id(revision_id)
1056
1056
 
1057
1057
    def get_data_stream_for_search(self, search):
1058
 
        medium = self._client.get_smart_medium()
 
1058
        medium = self._client._medium
1059
1059
        if not medium._remote_is_at_least_1_2:
1060
1060
            self._ensure_real()
1061
1061
            return self._real_repository.get_data_stream_for_search(search)
1229
1229
        if _client is not None:
1230
1230
            self._client = _client
1231
1231
        else:
1232
 
            self._client = client._SmartClient(self.bzrdir._shared_medium)
 
1232
            self._client = remote_bzrdir._client
1233
1233
        self.repository = remote_repository
1234
1234
        if real_branch is not None:
1235
1235
            self._real_branch = real_branch