Index: /root/down/svn/subversion/subversion/mod_dav_svn/mod_dav_svn.c
===================================================================
--- /root/down/svn/subversion/subversion/mod_dav_svn/mod_dav_svn.c	(revision 8118)
+++ /root/down/svn/subversion/subversion/mod_dav_svn/mod_dav_svn.c	(working copy)
@@ -45,6 +45,7 @@
 
 /* per-dir configuration */
 typedef struct {
+  svn_boolean_t has_path;       /* whether path is given */
   const char *fs_path;          /* path to the SVN FS */
   const char *repo_name;        /* repository name */
   const char *xslt_uri;         /* XSL transform URI */
@@ -101,6 +102,7 @@
 
     newconf = apr_pcalloc(p, sizeof(*newconf));
 
+    newconf->has_path = INHERIT_VALUE(parent, child, has_path);
     newconf->fs_path = INHERIT_VALUE(parent, child, fs_path);
     newconf->repo_name = INHERIT_VALUE(parent, child, repo_name);
     newconf->xslt_uri = INHERIT_VALUE(parent, child, xslt_uri);
@@ -151,6 +153,7 @@
     if (conf->fs_parent_path != NULL)
       return "SVNPath cannot be defined at same time as SVNParentPath.";
 
+    conf->has_path = TRUE;
     conf->fs_path
       = svn_path_canonicalize(apr_pstrdup(cmd->pool, arg1), cmd->pool);
 
@@ -166,6 +169,7 @@
     if (conf->fs_path != NULL)
       return "SVNParentPath cannot be defined at same time as SVNPath.";
 
+    conf->has_path = TRUE;
     conf->fs_parent_path
       = svn_path_canonicalize(apr_pstrdup(cmd->pool, arg1), cmd->pool);
 
@@ -214,6 +218,15 @@
     return conf->fs_path;
 }
 
+
+svn_boolean_t dav_svn_get_has_path(request_rec *r)
+{
+    dav_svn_dir_conf *conf;
+
+    conf = ap_get_module_config(r->per_dir_config, &dav_svn_module);
+    return conf->has_path;
+}
+
 const char *dav_svn_get_fs_parent_path(request_rec *r)
 {
     dav_svn_dir_conf *conf;
Index: /root/down/svn/subversion/subversion/mod_dav_svn/repos.c
===================================================================
--- /root/down/svn/subversion/subversion/mod_dav_svn/repos.c	(revision 8118)
+++ /root/down/svn/subversion/subversion/mod_dav_svn/repos.c	(working copy)
@@ -807,6 +807,34 @@
 }
 
 
+
+/*
+ * Find out the Svn path, if SVNPath and SVNParentPath are not given.
+ * It uses r->canonical_filename and root_path
+ *
+ * FIXME: How can I get the Root Htdocs perserver? Then is is just RootHtdocs+root_path.
+ * This is a kind of hack rules:
+ *  1. If root_path == '/' use only path part of r->canonical_filename;
+ *  2. If root_path != '/' (like '/aa'), Scn repos is r->canonical_filename;
+ */
+static const char* dav_guess_fs_path(request_rec *r, const char* root_path) {
+    char *fs_path;
+
+    /* Applied rule 1 */
+    if (strcmp(root_path, "/")==0) 
+      {
+	fs_path = ap_make_dirstr_parent(r->pool, r->canonical_filename);
+      }
+    else
+      {
+        /* Applied rule 2 */
+        fs_path = apr_pstrdup(r->pool, r->canonical_filename);
+      }
+
+    return svn_path_canonicalize(fs_path, r->pool);
+}
+
+
 AP_MODULE_DECLARE(dav_error *)
 dav_svn_split_uri (request_rec *r,
                    const char *uri_to_split,
@@ -824,10 +852,26 @@
   const char *relative;
   char *uri;
 
-  /* one of these is NULL, the other non-NULL. */
-  fs_path = dav_svn_get_fs_path(r);
-  fs_parent_path = dav_svn_get_fs_parent_path(r);
 
+  if (dav_svn_get_has_path(r)==FALSE)
+    {
+	/* Why we bother?
+       * Just assume the SVN repository is HtdocsRoot + xx directory in <Drectory xx>
+       * r->filename and root_path is used.
+       * ## FIXME : Can we figure out the HtdocsRoot per server?
+       */
+	fs_path = dav_guess_fs_path(r, root_path);
+      
+        DBG3("SVNPath is guessed: [%s] from filename [%s] and root_path [%s]",
+	   fs_path, r->canonical_filename, root_path);
+    }
+  else 
+    {
+      /* one of these is NULL, the other non-NULL. */
+      fs_path = dav_svn_get_fs_path(r);
+      fs_parent_path = dav_svn_get_fs_parent_path(r);
+    }
+
   if ((fs_path == NULL) && (fs_parent_path == NULL))
     {
       /* ### are SVN_ERR_APMOD codes within the right numeric space? */
@@ -1093,9 +1137,16 @@
   if (err)
     return 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 (dav_svn_get_has_path(r)==FALSE) 
+    {
+      fs_path = dav_guess_fs_path(r, root_path); 
+      DBG1("fs_path here: [%s]", fs_path);
+    } else {
+      /* 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 the SVNParentPath directive was used instead... */
   fs_parent_path = dav_svn_get_fs_parent_path(r);


