~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

Better infrastructure on SmartClientMedium for tracking the remote version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
839
839
    def _get_parent_map(self, keys):
840
840
        """Helper for get_parent_map that performs the RPC."""
841
841
        medium = self._client._medium
842
 
        if not medium._remote_is_at_least_1_2:
 
842
        if not medium._is_remote_at_least((1, 2)):
843
843
            # We already found out that the server can't understand
844
844
            # Repository.get_parent_map requests, so just fetch the whole
845
845
            # graph.
918
918
            medium.disconnect()
919
919
            # To avoid having to disconnect repeatedly, we keep track of the
920
920
            # fact the server doesn't understand remote methods added in 1.2.
921
 
            medium._remote_is_at_least_1_2 = False
 
921
            medium._remote_is_not((1, 2))
922
922
            return self.get_revision_graph(None)
923
923
        response_tuple, response_handler = response
924
924
        if response_tuple[0] not in ['ok']:
1079
1079
 
1080
1080
    def get_data_stream_for_search(self, search):
1081
1081
        medium = self._client._medium
1082
 
        if not medium._remote_is_at_least_1_2:
 
1082
        if not medium._is_remote_at_least((1, 2)):
1083
1083
            self._ensure_real()
1084
1084
            return self._real_repository.get_data_stream_for_search(search)
1085
1085
        REQUEST_NAME = 'Repository.stream_revisions_chunked'
1100
1100
            medium.disconnect()
1101
1101
            # To avoid having to disconnect repeatedly, we keep track of the
1102
1102
            # fact the server doesn't understand this remote method.
1103
 
            medium._remote_is_at_least_1_2 = False
 
1103
            medium._remote_is_not((1, 2))
1104
1104
            self._ensure_real()
1105
1105
            return self._real_repository.get_data_stream_for_search(search)
1106
1106