You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Philip Martin <ph...@wandisco.com> on 2011/11/17 12:12:02 UTC

root_dir in mod_dav_svn

[From users]

Philip Martin <ph...@wandisco.com> writes:
> Sergey Skvortsov <sk...@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