~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Andrew Bennetts
  • Date: 2008-05-08 06:29:07 UTC
  • mto: This revision was merged to the branch mainline in revision 3428.
  • Revision ID: andrew.bennetts@canonical.com-20080508062907-gk5ycaa6wm6qrggq
Don't automatically send 'hello' requests from RemoteBzrDirFormat.probe_transport unless we have to (i.e. the transport is HTTP).

Show diffs side-by-side

added added

removed removed

Lines of Context:
2440
2440
        try:
2441
2441
            medium = transport.get_smart_medium()
2442
2442
        except (NotImplementedError, AttributeError,
2443
 
                errors.TransportNotPossible, errors.NoSmartMedium):
 
2443
                errors.TransportNotPossible, errors.NoSmartMedium,
 
2444
                errors.SmartProtocolError):
2444
2445
            # no smart server, so not a branch for this format type.
2445
2446
            raise errors.NotBranchError(path=transport.base)
2446
2447
        else:
2447
2448
            # Decline to open it if the server doesn't support our required
2448
2449
            # version (3) so that the VFS-based transport will do it.
2449
 
            try:
2450
 
                server_version = medium.protocol_version()
2451
 
            except errors.SmartProtocolError:
2452
 
                # Apparently there's no usable smart server there, even though
2453
 
                # the medium supports the smart protocol.
2454
 
                raise errors.NotBranchError(path=transport.base)
2455
 
            if server_version not in (2, 3):
2456
 
                raise errors.NotBranchError(path=transport.base)
 
2450
            if medium.should_probe():
 
2451
                try:
 
2452
                    server_version = medium.protocol_version()
 
2453
                except errors.SmartProtocolError:
 
2454
                    # Apparently there's no usable smart server there, even though
 
2455
                    # the medium supports the smart protocol.
 
2456
                    raise errors.NotBranchError(path=transport.base)
 
2457
                if server_version != '2':
 
2458
                    raise errors.NotBranchError(path=transport.base)
2457
2459
            return klass()
2458
2460
 
2459
2461
    def initialize_on_transport(self, transport):