[MERGE][Bug #188855] Fix MemoryTransport._abspath() for relpath=''

John Arbash Meinel john at arbash-meinel.com
Mon Feb 4 19:37:40 GMT 2008


James Henstridge wrote:
> 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.
> 

BB:approve

John
=:->




More information about the bazaar mailing list