Phil Endecott wrote:
> I wondered about "svn ls -R --xml | something", but it looks as if the XML doesn't actually have the recursive structure! It is just a flat list. So "something" would be more complex.
I do not think this would be hard,
but see below.
> The other problem with my setup is that "svn ls -R" is slow. I think that this is because it does lots of small http requests, and my mod_auth_pam authentication takes a noticeable time for each one. Or something like that.
> I just thought I'd mention it here in case anyone has found a good way to do this.
Yes, "svn ls -R" is terribly slow.
I believe Jean-Marc Godbout has created a patch that speeds things up
quite a bit, but
1) his patch does not achieve a factor of 100,
which IMHO would be reasonable.
2) AFAIK, his patch never got integrated.
As a workaround, we created a tiny cgi-bin shell script that
uses "svnlook tree" directly on the repository to output the tree.
This works with subversion as it is and it also does achieve
the factor 100 speed up.
I am using the following python function to connect to
the server, get the tree listing and convert it back to
the "svn list -R" output format:
""" get a recursive listing of url. """
list_lines = 
# open a connection to cgi-bin/svndir, which returns a directory tree
# with leading spaces that indicate the depth.
url_components = url.split('/')
connection = httplib.HTTPConnection(url_components)
connection.request("GET", "/cgi-bin/svndir?" + '/'.join(url_components[3:]))
# Convert into the format returned by svn list.
path = 
for entry in connection.getresponse().read().splitlines():
spaces = entry.count(' ')
path = path[0:spaces]
if entry[-1] == '/':
path = path + [entry[spaces:-1]]
list_lines.append('/'.join(path) + '/')
list_lines.append('/'.join(path + [entry[spaces:]]))
# Do not care what went wrong.
# In any event try using svn list -R if cgi-bin/svndir fails to return lines.
if list_lines == :
print "svndir returned no entries. Falling back to svn list."
list_lines = subprocess.Popen("svn list -R " + url, shell=True,
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Mon Feb 13 18:54:12 2006