I tried this today, and by hiding my ssh key, I saw it connect 3 times. So we are doing slightly better as of 0.16 (RemoteTransport *does* pass around the reference)
I think this is because we are first using "to_transport = transport.get_transport(location)"
And from there we are trying to determine if the target exists or not (using BzrDir.open_from_transport(), etc)
Which is good so far.
But then bzrdir.clone() only takes a URL, not a Transport, so the transport cannot be re-used.
That accounts for 2 connections, I'm not sure how we get the 3rd.
Actually, it is probably because RemoteSSHTransport isn't properly cloning. (For one thing its __init__ doesn't have a clone_from. Second, the default RemoteTransport.clone() returns a RemoteTransport, rather than self.__class__()
see also bug 86392
I tried this today, and by hiding my ssh key, I saw it connect 3 times. So we are doing slightly better as of 0.16 (RemoteTransport *does* pass around the reference)
I think this is because we are first using "to_transport = transport. get_transport( location) " open_from_ transport( ), etc)
And from there we are trying to determine if the target exists or not (using BzrDir.
Which is good so far.
But then bzrdir.clone() only takes a URL, not a Transport, so the transport cannot be re-used.
That accounts for 2 connections, I'm not sure how we get the 3rd.
Actually, it is probably because RemoteSSHTransport isn't properly cloning. (For one thing its __init__ doesn't have a clone_from. Second, the default RemoteTransport .clone( ) returns a RemoteTransport, rather than self.__class__()