[MERGE] Fix bug 146715: bzr+ssh:// and sftp:// transports should not assume port-not-specified means port 22

Martin Pool mbp at sourcefrog.net
Tue Oct 9 09:14:38 BST 2007


What I'd suggest is:

When parsing a url, if no port is specified, leave it as None in the
parsed tuple or transport.  When unparsing them, None goes back to
unspecified and any explicit port, even the default, is explicitly
shown.

The default port only comes in at the point of opening the network
socket if it's still None -- often this will be done inside pycurl or
something rather than bzrlib.

The only drawback is that if we ever get proto://foo/ and
proto://foo:defaultport/ they won't be parsed the same way.  We can
specifically list which protocols can or can't do this.  On the other
hand I'm not sure it's really critical - if we just keep urls as
they're passed in, then we should rarely see http://host:80/ with the
port number.



More information about the bazaar mailing list