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)
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.
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():
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)
2459
2461
def initialize_on_transport(self, transport):