[MERGE] Move protocol version querying logic into the medium

Robert Collins robertc at robertcollins.net
Fri Feb 29 05:39:26 GMT 2008


On Fri, 2008-02-29 at 01:42 +1100, Andrew Bennetts wrote:
> --- bzrlib/bzrdir.py    2008-02-24 16:42:13 +0000
> +++ bzrlib/bzrdir.py    2008-02-28 14:21:20 +0000
> @@ -2393,18 +2393,15 @@
>      def probe_transport(klass, transport):
>          """Return a RemoteBzrDirFormat object if it looks
> possible."""
>          try:
> -            client = transport.get_smart_client()
> +            medium = transport.get_smart_client()

please use transport.get_smart_medium() here :).


> +            # Decline to open it if the server doesn't support our
> required
> +            # version (2) so that the VFS-based transport will do it.
> +            server_version = medium.protocol_version()
>              if server_version != 2:
>                  raise errors.NotBranchError(path=transport.base)
>              return klass()

Comment: I still don't like probing for versions at all; it should
really just be deferred to the first request/response pair's result on a
given stream.

bb:approve

-Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080229/818a7162/attachment.pgp 


More information about the bazaar mailing list