Fix pysvn handling of URLs with whitespace in list_dir.

Review Request #8151 — Created May 9, 2016 and discarded — Latest diff uploaded

Information

Review Board
master

Reviewers

The pysvn Client.list_dir() method did not properly handle SVN URLs which contain whitespace. pysvn.Client internally converts whitespace in URLs to '%20' which causes the url string to be 2 chars longer than the whitespace version.

list_dir() did rely on the length of the repo_path string to extract the directory name. This resulted in directory names prefixed with two bytes from the original URL.

Example:
list_dir("http://my-svn-server.local/svn/123 project/")
returned 'cttrunk/', 'ctbranches', 'cttags/' when in reality the
directories trunk, branches and tags were present

This fix uses self.repository_info['url'] as repository root, which is already parsed by the pysvn.Client library and contains the '%20' replacements.

Ran unit tests.

When creating a new review request to a Subversion repository containing whitespace in the URL, the trunk/branches/tags selection field did not work. This now is fixed and the branches/trunk/tags are listed as expected.

Did not check whether this affects the subvertpy implementation as well.