svn commit: r1926683 - /subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <[email protected]>
Author: jorton
Date: Tue Jun 24 09:44:06 2025
New Revision: 1926683

URL: http://svn.apache.org/viewvc?rev=1926683&view=rev
Log:
mod_dav_svn: Use mod_dav's DAVBasePath setting to determine the
repository root path, allowing SVN to be configured via LocationMatch
like:

 <LocationMatch ^/repos/svn(.*)>
    DAV svn
    SVNParentPath /srv/repos
    DAVBasePath /repos
 </LocationMatch>

by mapping URL path "/repos/svnfoo" to the filesystem path of
"/srv/repos/svnfoo". This partially addresses issues like SVN-4790
(with minimal added complexity), though does not provide as much
flexibility as discussed in SVN-2679. (resolves #28)

* subversion/mod_dav_svn/mod_dav_svn.c
  (dav_svn__get_root_dir): Retrieve and return the setting from
  DavBasePath via dav_get_base_path() where that API is available
  and DavBasePath is configured.
  (dav_svn__translate_name): Use dav_svn__get_root_dir() to determine
  the repos root for the same reason.

Modified:
    subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c

Modified: subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c?rev=1926683&r1=1926682&r2=1926683&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c Tue Jun 24 09:44:06 2025
@@ -781,6 +781,15 @@ const char *
 dav_svn__get_root_dir(request_rec *r)
 {
   dir_conf_t *conf;
+#if AP_MODULE_MAGIC_AT_LEAST(20120211, 139)
+  const char *base;
+
+  /* Inherit the root path from mod_dav's DavBasePath iff configured
+     where e.g. LocationMatch is used for the repos. */
+  base = dav_get_base_path(r);
+  if (base)
+    return base;
+#endif
 
   conf = ap_get_module_config(r->per_dir_config, &dav_svn_module);
   return conf->root_dir;
@@ -1225,7 +1234,7 @@ static int dav_svn__translate_name(reque
   else
     {
       /* Retrieve path to repo and within repo for the request */
-      dav_error *err = dav_svn_split_uri(r, r->uri, conf->root_dir,
+      dav_error *err = dav_svn_split_uri(r, r->uri, dav_svn__get_root_dir(r),
                                          &ignore_cleaned_uri,
                                          &ignore_had_slash, &repos_basename,
                                          &ignore_relative_path, &repos_path);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.