[MERGE] fix relpath calls at '/'

Robert Collins robertc at robertcollins.net
Thu Apr 6 06:19:20 BST 2006


On Wed, 2006-04-05 at 13:43 +1000, Martin Pool wrote:
> On 4 Apr 2006, at 18:55 , Robert Collins wrote:
> 
> > currently as per bug 37036 transport.relpath('foo') when the transport
> > is at the root of its file system has a number of glitches.
> >
> > I've added tests to check that relpath and abspath work correctly  
> > at the
> > root of their file system, and by implication that clone to the root
> > works for all transports.
> >
> > This should fix bug 37036 but is rather less trivial than I had
> > hoped :O.
> 
> +1, with comments:
> 
> > +
> > +
> > +def ensure_netloc(protocol):
> > +    """Ensure that protocol is setup to be used with urlparse  
> > netloc parsing."""
> > +    if protocol not in urlparse.uses_netloc:
> > +        urlparse.uses_netloc.append(protocol)
> 
> >
> >
> >> I also wonder whether ensuring netloc couldn't happen when  
> >> registering
> >> protocols.
> >>
> >
> > I don't think so - not all out registered protocols use urlparse, and
> > several (the decorators) are not even protocols - they are prefixes.
> 
> But shouldn't urlparse still treat them as protocols?

Heck no. 'readonly+' -> meaningless
'readonly+file:///foo' -> becomes
'file:///foo' which is where urlparse kicks in.

> Is "netloc" meaningful except in urlparse?  I'd prefer say  
> "register_urlparse_protocol" or some such?

Done as 'register_urlparse_netloc_protocol'. The netloc bit is important
- the problem is not that urlparse doesn't handle the protocol, its that
it does not handle it as a netloc protocol.

Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060406/8264d9e4/attachment.pgp 


More information about the bazaar mailing list