[MERGE] Better infrastructure for dealing with 'bad request' responses from a smart server

Andrew Bennetts andrew at canonical.com
Tue Apr 8 02:59:23 BST 2008


This patch provides a more convenient and robust way to handle responses from a
smart server that say that the server doesn't recognise the request (because the
server version is too old).  This is important, because detecting this error is
how the client knows it needs to retry the request using older verbs.

Previously this was done ad hoc in bzrlib/remote.py and
bzrlib/transport/remote.py.  This patch instead makes the client protocol
responsible for detecting the error: read_response_tuple will now raise
UnknownSmartMethod (a new exception) if instead of an ordinary response it gets
that error from the server.

Aside from being a nicer API, a big advantage of this changes is that knowledge
of the protocol-level details of how this error is communicated over the wire is
now confined to the protocol logic.  This will make it easier to improve this
aspect of the protocol in the next protocol version.

-Andrew.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: unknown-response-3302.patch
Type: text/x-diff
Size: 28818 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080408/634946a2/attachment-0001.bin 


More information about the bazaar mailing list