[MERGE][Bug #188855] Fix MemoryTransport._abspath() for relpath=''
James Henstridge
james at jamesh.id.au
Mon Feb 4 09:42:22 GMT 2008
I was writing some tests using TestCaseWithMemoryTransport that make
use of BzrDir.find_branches(), and found that they led to an infinite
loop.
The find_branches() code was calling transport.list_dir('') on cloned
transports in order to traverse the directory hierarchy.
In MemoryTransport's implementation, the relative path is converted to
an absolute path with _abspath(). The _abspath() method includes a
special case where it will return '/' if relpath is ''. This is
broken for any transport representing a subdirectory of the memory
server.
The result is that all the list_dir('') calls list the base directory
of the memory server and find_branches() continues to recurse into
non-existent directories.
The attached patch does two things:
1. tests that list_dir() on a cloned transport works.
2. removes the special case in MemoryTransport._abspath().
James.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug-188855.patch
Type: text/x-patch
Size: 5796 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080204/52e11a1b/attachment.bin
More information about the bazaar
mailing list