~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/client.py

MergeĀ fromĀ smart-push-gpm.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
                    response_handler)
62
62
        else:
63
63
            for protocol_version in [3, 2]:
 
64
                if protocol_version == 2:
 
65
                    # If v3 doesn't work, the remote side is older than 1.6.
 
66
                    self._medium._remember_remote_is_before((1, 6))
64
67
                response_handler = self._send_request(
65
68
                    protocol_version, method, args, body=body,
66
69
                    readv_body=readv_body)
76
79
                        % (protocol_version,))
77
80
                    self._medium.disconnect()
78
81
                    continue
 
82
                except errors.ErrorFromSmartServer:
 
83
                    # If we received an error reply from the server, then it
 
84
                    # must be ok with this protocol version.
 
85
                    self._medium._protocol_version = protocol_version
 
86
                    raise
79
87
                else:
80
88
                    self._medium._protocol_version = protocol_version
81
89
                    return response_tuple, response_handler