~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-04-26 10:41:48 UTC
  • mfrom: (2420.1.22 bzr.http.auth)
  • Revision ID: pqm@pqm.ubuntu.com-20070426104148-4l5wq2zemlzv0shg
http authentication and other integrated fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
    sha_string,
58
58
    )
59
59
from bzrlib.smart.client import _SmartClient
 
60
from bzrlib.smart import protocol
60
61
from bzrlib.store.revision.text import TextRevisionStore
61
62
from bzrlib.store.text import TextStore
62
63
from bzrlib.store.versioned import WeaveStore
2232
2233
    def probe_transport(klass, transport):
2233
2234
        """Return a RemoteBzrDirFormat object if it looks possible."""
2234
2235
        try:
2235
 
            transport.get_smart_client()
 
2236
            client = transport.get_smart_client()
2236
2237
        except (NotImplementedError, AttributeError,
2237
2238
                errors.TransportNotPossible):
2238
2239
            # no smart server, so not a branch for this format type.
2239
2240
            raise errors.NotBranchError(path=transport.base)
2240
2241
        else:
 
2242
            # Send a 'hello' request in protocol version one, and decline to
 
2243
            # open it if the server doesn't support our required version (2) so
 
2244
            # that the VFS-based transport will do it.
 
2245
            request = client.get_request()
 
2246
            smart_protocol = protocol.SmartClientRequestProtocolOne(request)
 
2247
            server_version = smart_protocol.query_version()
 
2248
            if server_version != 2:
 
2249
                raise errors.NotBranchError(path=transport.base)
2241
2250
            return klass()
2242
2251
 
2243
2252
    def initialize_on_transport(self, transport):