[MERGE] fix relpath calls at '/'
Martin Pool
mbp at sourcefrog.net
Wed Apr 5 04:43:06 BST 2006
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?
Is "netloc" meaningful except in urlparse? I'd prefer say
"register_urlparse_protocol" or some such?
--
Martin Pool
More information about the bazaar
mailing list