[MERGE/RFC] LocalTransport.abspath() should return a drive letter if the transport has one

Mark Hammond mhammond at skippinet.com.au
Sat Sep 6 08:47:15 BST 2008


I'm seeing 32 test failures on Windows caused by a recent change that allows
'file:///' to mean 'the root of all drives' on Windows.  It turns out that
all the errors are due to LocalTransport.abspath() always returning a URL
without a drive letter even when the transport itself is specifed with one.

For example, currently in bzr.dev:

>>> from bzrlib.transport.local import LocalTransport
>>> t=LocalTransport("file:///")
>>> t.abspath("/")
'file:///'
# The above is fine.  However:
>>> t2=LocalTransport("file:///c:/foo")
>>> t2.abspath("/")
'file:///'
# We have 'lost' the fully qualified path we had.

I've attached a bundle to address this in abspath - with my patch applied:

>>> from bzrlib.transport.local import LocalTransport
>>> t=LocalTransport("file:///")
>>> t.abspath("/")
'file:///'
# Same as above
>>> t2=LocalTransport("file:///c:/foo")
>>> t2.abspath("/")
'file:///C:/'
>>>
# different than above.

The results of the test suite when running 'selftest
bzrlib.tests.test_transport_implementations'

Before the patch: 
Ran 1207 tests in 87.575s
FAILED (failures=35)
59 tests skipped

After the patch:
Ran 1207 tests in 86.120s
FAILED (failures=3)
59 tests skipped

Cheers,

Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: local_transport_abspatch.patch
Type: application/octet-stream
Size: 2906 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080906/a7a69314/attachment.obj 


More information about the bazaar mailing list