I've been playing with SVNIndexXSLT recently and I noticed that in the
XML output from mod_dav_svn, the name parameter of the index markup
was not set when using the SVNParentPath directive in Apache HTTPd
After a closer look at the code, I managed to identify where the XML
output function gets his repository information from : the
dav_svn_get_resource() function, from mod_dav_svn/repos.c.
This function builds an information structure containing the repository
name we are looking for. This particular field is filled in using the
dav_svn_get_repo_name() function, from mod_dav_svn/mod_dav_svn.c.
Unfortunately, this function is only able to return a repository name if
one was set using the SVNReposName/SVNPath directives (it just returns the
repo_name field from the Apache conf structure related to the relevant
directory), thus it can't return a repository name when SVNParentPath is
The attached patch creates a new function, revved from the actual
dav_svn_get_repo_name(). It's prototype changed so it can propagate an
eventual error during the processing. Basically, the new
dav_svn_get_repo_name2() function uses the dav_svn_split_uri function to
retrieve the repository name from the current requested URI if the
SVNParentPath directive is used, otherwise it acts like the old
The corresponding function prototype has been added to dav_svn.h, and
the call from dav_svn_get_resource() has been updated to use this new
function. I did not find any other call to the dav_svn_get_repo_name
function in the Subversion source code.
You can find a current Debian's Subversion (1.2.3) example at
https://ssl.bulix.org/svn/demo/ using the SVNParentPath directive and
thus not giving the name parameter in the XML output. A development
Subversion is currently running on my dev box with this patch working
Make mod_dav_svn retrieve a repository name even when configured to
operate with SVNParentPath.
(dav_svn_get_repo_name2): New function, revved from
dav_svn_get_repo_name. Takes new root_path and repo_name arguments
and returns a dav_error for error propagation. Retrieves the
repository name in a SVNParentPath setup using dav_svn_split_uri.
(dav_svn_get_repo_name2): Declare the new function in the API.
(dav_svn_get_resource): Use dav_svn_get_repo_name2 to retrieve the
repository name, and propagate any dav_error values received.
Maxime Petazzoni (http://www.bulix.org)
-- gone crazy, back soon. leave message.
Received on Sat Jan 14 15:37:50 2006