[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

root_dir in mod_dav_svn

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Thu, 17 Nov 2011 11:12:02 +0000

[From users]

Philip Martin <philip.martin_at_wandisco.com> writes:
> Sergey Skvortsov <skv_at_protey.ru> writes:
>
>> Also, in 1.7 reading repos is working fine:
>>
>> "OPTIONS /svn/foo/bar HTTP/1.1" 200
>> "REPORT /svn/foo/bar/!svn/me HTTP/1.1" 200
>>
>> but only POST fails:
>> "POST /svn/foo/bar/!svn/me HTTP/1.1" 500
>>
>> So the problem is not in Apache or configuration but in mod_dav_svn itself.
>
> Yes, POST requests are handled differently. You should be able to work
> around the problem by disabling the v2 protocol using:
>
> SVNAdvertiseV2Protocol off

The config is nested Locations with SVNParentPath:

<Location /svn>
  ...
  SVNParentPath /home/svn
</Location>

<Location /svn/foo>
  ...
  SVNParentPath /home/svn/foo
</Location>

This works apart from v2 commits to the nested Location. The reason it
fails is that the POST gets directed to the containing Location, and
that happens because of the way dir_conf_t.root_dir is setup in
mod_dav_svn.c:merge_dir_config:

  /* Prefer our parent's value over our new one - hence the swap. */
  newconf->root_dir = INHERIT_VALUE(parent, child, root_dir);

All the other fields use INHERIT_VALUE(child, parent, ...). This code
was added in the first commit to the dav-mirror branch in 2006 and has
not been changed since.

If I change it to prefer the child value for root_dir then POSTs go to
the right Location and commits work. Changing it doesn't break my
simple mirror setup.

I don't understand why the code prefers the parent root_dir. I can't
think of any reason why mirroring would make a difference. Can anyone
explain?

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com
Received on 2011-11-17 12:12:39 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.