Index: subversion/include/mod_dav_svn.h
===================================================================
--- subversion/include/mod_dav_svn.h	(revision 13816)
+++ subversion/include/mod_dav_svn.h	(working copy)
@@ -74,6 +74,13 @@
                                                  const char **repos_path);
 
 
+/* Given an apache request R and a ROOT_PATH to the svn location
+   block set *REPOS_PATH to the path of the repository on disk.
+*/
+AP_MODULE_DECLARE(dav_error *) dav_svn_get_repos_path(request_rec *r,
+                                                      const char *root_path,
+                                                      const char **repos_path);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
Index: subversion/mod_dav_svn/mod_dav_svn.c
===================================================================
--- subversion/mod_dav_svn/mod_dav_svn.c	(revision 13816)
+++ subversion/mod_dav_svn/mod_dav_svn.c	(working copy)
@@ -32,6 +32,7 @@
 
 #include "dav_svn.h"
 
+#include <mod_dav_svn.h>
 
 /* This is the default "special uri" used for SVN's special resources
    (e.g. working resources, activities) */
@@ -248,7 +249,50 @@
     return conf->fs_parent_path;
 }
 
+AP_MODULE_DECLARE(dav_error *) dav_svn_get_repos_path(request_rec *r, 
+                                                      const char *root_path,
+                                                      const char **repos_path)
+{
 
+    const char *fs_path;     /* the path to the repository on disk */
+    const char *repos_name;
+    const char *ignored_path_in_repos;
+    const char *ignored_cleaned_uri;
+    const char *ignored_relative;
+    int ignored_had_slash;
+
+    dav_error *err;
+
+    /* The path that we will eventually try to open as an svn
+       repository.  Normally defined by the SVNPath directive. */
+    fs_path = dav_svn_get_fs_path(r);
+
+    if (fs_path != NULL)
+      {
+        /* The config object is long-lived enough,
+         * we just directly assign a pointer. */
+        *repos_path = fs_path;
+        return NULL;
+      }
+
+    /* If the SVNParentPath directive was used instead... */
+    fs_path = dav_svn_get_fs_parent_path(r);
+
+    /* This does all the work of interpreting/splitting the request uri. */
+    err = dav_svn_split_uri(r, r->uri, root_path,
+                            &ignored_cleaned_uri, &ignored_had_slash,
+                            &repos_name,
+                            &ignored_relative, &ignored_path_in_repos);
+
+    /* push the error to the caller */
+    if (err)
+      return err;
+
+    /* ...and we need to specify exactly what repository to open. */
+    *repos_path = svn_path_join(fs_path, repos_name, r->pool);
+    return NULL;
+}
+
 const char *dav_svn_get_repo_name(request_rec *r)
 {
     dav_svn_dir_conf *conf;

