subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r1328040 - in /subversion/branches/ev2-export: ./ CHANGES subversion/include/private/svn_repos_private.h subversion/libsvn_client/commit.c subversion/libsvn_fs/fs-loader.c subversion/libsvn_repos/repos.c subversion/mod_dav_svn/repos.c
Date Thu, 19 Apr 2012 16:30:32 GMT
Author: hwright
Date: Thu Apr 19 16:30:31 2012
New Revision: 1328040

URL: http://svn.apache.org/viewvc?rev=1328040&view=rev
Log:
On the ev2-export branch:
Bring up-to-date with trunk (yet again).

Modified:
    subversion/branches/ev2-export/   (props changed)
    subversion/branches/ev2-export/CHANGES
    subversion/branches/ev2-export/subversion/include/private/svn_repos_private.h
    subversion/branches/ev2-export/subversion/libsvn_client/commit.c
    subversion/branches/ev2-export/subversion/libsvn_fs/fs-loader.c
    subversion/branches/ev2-export/subversion/libsvn_repos/repos.c
    subversion/branches/ev2-export/subversion/mod_dav_svn/repos.c

Propchange: subversion/branches/ev2-export/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1327809-1328039

Modified: subversion/branches/ev2-export/CHANGES
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/CHANGES?rev=1328040&r1=1328039&r2=1328040&view=diff
==============================================================================
--- subversion/branches/ev2-export/CHANGES (original)
+++ subversion/branches/ev2-export/CHANGES Thu Apr 19 16:30:31 2012
@@ -58,10 +58,12 @@ http://svn.apache.org/repos/asf/subversi
     * libsvn_wc: reduce resources use while looking for the wc root (r1306334)
     * cmdline: fix segfault during 'svn diff' argument processing (r1311702)
     * fix regression with deep commit followed by depthy update (issue #4136)
+    * propset: avoid reading unitialised variable in error path (r1325361)
 
   Developer-visible changes:
     * swig-py tests: avoid FAILs on APR hash order (r1296137, r1292248)
     * swig-rb tests: avoid FAILs on APR hash order (r1310535, r1310594)
+    * windows example distribution scripts: include svnrdump (r1295007)
 
 
 Version 1.7.4

Modified: subversion/branches/ev2-export/subversion/include/private/svn_repos_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/include/private/svn_repos_private.h?rev=1328040&r1=1328039&r2=1328040&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/include/private/svn_repos_private.h (original)
+++ subversion/branches/ev2-export/subversion/include/private/svn_repos_private.h Thu Apr
19 16:30:31 2012
@@ -81,6 +81,12 @@ const char *
 svn_repos__post_commit_error_str(svn_error_t *err,
                                  apr_pool_t *pool);
 
+/* A repos version of svn_fs_type */
+svn_error_t *
+svn_repos__fs_type(const char **fs_type,
+                   const char *repos_path,
+                   apr_pool_t *pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/ev2-export/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/commit.c?rev=1328040&r1=1328039&r2=1328040&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/commit.c Thu Apr 19 16:30:31 2012
@@ -276,68 +276,42 @@ import_file(const svn_delta_editor_t *ed
 }
 
 
-/* Import directory LOCAL_ABSPATH into the repository directory indicated by
- * DIR_BATON in EDITOR.  EDIT_PATH is the path imported as the root
- * directory, so all edits are relative to that.
- *
- * DEPTH is the depth at this point in the descent (it may be changed
- * for recursive calls).
- *
- * Accumulate file paths and their batons in FILES, which must be
- * non-null.  (These are used to send postfix textdeltas later).
- *
- * EXCLUDES is a hash whose keys are absolute paths to exclude from
- * the import (values are unused).
- *
- * If NO_IGNORE is FALSE, don't import files or directories that match
- * ignore patterns.
+/* Return in CHILDREN a mapping of basenames to dirents for the importable
+ * children of DIR_ABSPATH.  EXCLUDES is a hash of absolute paths to filter
+ * out.  IGNORES, if non-NULL, is a list of basenames to filter out.
+ * FILTER_CALLBACK and FILTER_BATON will be called for each absolute path,
+ * allowing users to further filter the list of returned entries.
  *
- * If FILTER_CALLBACK is not NULL, call it with FILTER_BATON on each to be
- * imported node below LOCAL_ABSPATH to allow filtering nodes.
- *
- * If CTX->NOTIFY_FUNC is non-null, invoke it with CTX->NOTIFY_BATON for each
- * directory.
- *
- * Use POOL for any temporary allocation.  */
+ * Results are returned in RESULT_POOL; use SCRATCH_POOL for temporary data.*/
 static svn_error_t *
-import_dir(const svn_delta_editor_t *editor,
-           void *dir_baton,
-           const char *local_abspath,
-           const char *edit_path,
-           svn_depth_t depth,
-           apr_hash_t *excludes,
-           svn_boolean_t no_ignore,
-           svn_boolean_t ignore_unknown_node_types,
-           svn_client_import_filter_func_t filter_callback,
-           void *filter_baton,
-           import_ctx_t *import_ctx,
-           svn_client_ctx_t *ctx,
-           apr_pool_t *pool)
+get_filtered_children(apr_hash_t **children,
+                      const char *dir_abspath,
+                      apr_hash_t *excludes,
+                      apr_array_header_t *ignores,
+                      svn_client_import_filter_func_t filter_callback,
+                      void *filter_baton,
+                      svn_client_ctx_t *ctx,
+                      apr_pool_t *result_pool,
+                      apr_pool_t *scratch_pool)
 {
-  apr_pool_t *subpool = svn_pool_create(pool);  /* iteration pool */
   apr_hash_t *dirents;
   apr_hash_index_t *hi;
-  apr_array_header_t *ignores;
-
-  SVN_ERR(svn_path_check_valid(local_abspath, pool));
-
-  if (!no_ignore)
-    SVN_ERR(svn_wc_get_default_ignores(&ignores, ctx->config, pool));
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
-  SVN_ERR(svn_io_get_dirents3(&dirents, local_abspath, TRUE, pool, pool));
+  SVN_ERR(svn_io_get_dirents3(&dirents, dir_abspath, TRUE, result_pool,
+                              scratch_pool));
 
-  for (hi = apr_hash_first(pool, dirents); hi; hi = apr_hash_next(hi))
+  for (hi = apr_hash_first(scratch_pool, dirents); hi; hi = apr_hash_next(hi))
     {
-      const char *this_abspath, *this_edit_path;
-      const char *filename = svn__apr_hash_index_key(hi);
+      const char *basename = svn__apr_hash_index_key(hi);
       const svn_io_dirent2_t *dirent = svn__apr_hash_index_val(hi);
+      const char *local_abspath;
 
-      svn_pool_clear(subpool);
+      svn_pool_clear(iterpool);
 
-      if (ctx->cancel_func)
-        SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
+      local_abspath = svn_dirent_join(dir_abspath, basename, iterpool);
 
-      if (svn_wc_is_adm_dir(filename, subpool))
+      if (svn_wc_is_adm_dir(basename, iterpool))
         {
           /* If someone's trying to import a directory named the same
              as our administrative directories, that's probably not
@@ -348,95 +322,125 @@ import_dir(const svn_delta_editor_t *edi
           if (ctx->notify_func2)
             {
               svn_wc_notify_t *notify
-                = svn_wc_create_notify(svn_dirent_join(local_abspath, filename,
-                                                       subpool),
-                                       svn_wc_notify_skip, subpool);
+                = svn_wc_create_notify(svn_dirent_join(local_abspath, basename,
+                                                       iterpool),
+                                       svn_wc_notify_skip, iterpool);
               notify->kind = svn_node_dir;
               notify->content_state = notify->prop_state
                 = svn_wc_notify_state_inapplicable;
               notify->lock_state = svn_wc_notify_lock_state_inapplicable;
-              (*ctx->notify_func2)(ctx->notify_baton2, notify, subpool);
+              (*ctx->notify_func2)(ctx->notify_baton2, notify, iterpool);
             }
+
+          apr_hash_set(dirents, basename, APR_HASH_KEY_STRING, NULL);
+          continue;
+        }
+            /* If this is an excluded path, exclude it. */
+      if (apr_hash_get(excludes, local_abspath, APR_HASH_KEY_STRING))
+        {
+          apr_hash_set(dirents, basename, APR_HASH_KEY_STRING, NULL);
           continue;
         }
 
-      /* Typically, we started importing from ".", in which case
-         edit_path is "".  So below, this_path might become "./blah",
-         and this_edit_path might become "blah", for example. */
-      this_abspath = svn_dirent_join(local_abspath, filename, subpool);
-      this_edit_path = svn_relpath_join(edit_path, filename, subpool);
-
-      /* If this is an excluded path, exclude it. */
-      if (apr_hash_get(excludes, this_abspath, APR_HASH_KEY_STRING))
-        continue;
-
-      if ((!no_ignore) && svn_wc_match_ignore_list(filename, ignores,
-                                                   subpool))
-        continue;
+      if (ignores && svn_wc_match_ignore_list(basename, ignores, iterpool))
+        {
+          apr_hash_set(dirents, basename, APR_HASH_KEY_STRING, NULL);
+          continue;
+        }
 
-      if (filter_callback != NULL)
+      if (filter_callback)
         {
           svn_boolean_t filter = FALSE;
 
-          SVN_ERR(filter_callback(filter_baton, &filter, this_abspath,
-                                  dirent, subpool));
+          SVN_ERR(filter_callback(filter_baton, &filter, local_abspath,
+                                  dirent, iterpool));
 
           if (filter)
-            continue;
+            {
+              apr_hash_set(dirents, basename, APR_HASH_KEY_STRING, NULL);
+              continue;
+            }
         }
+    }
+  svn_pool_destroy(iterpool);
 
-      if (dirent->kind == svn_node_dir && depth >= svn_depth_immediates)
-        {
-          void *this_dir_baton;
+  *children = dirents;
+  return SVN_NO_ERROR;
+}
 
-          /* Add the new subdirectory, getting a descent baton from
-             the editor. */
-          SVN_ERR(editor->add_directory(this_edit_path, dir_baton,
-                                        NULL, SVN_INVALID_REVNUM, subpool,
-                                        &this_dir_baton));
+static svn_error_t *
+import_dir(const svn_delta_editor_t *editor,
+           void *dir_baton,
+           const char *local_abspath,
+           const char *edit_path,
+           svn_depth_t depth,
+           apr_hash_t *excludes,
+           svn_boolean_t no_ignore,
+           svn_boolean_t ignore_unknown_node_types,
+           svn_client_import_filter_func_t filter_callback,
+           void *filter_baton,
+           import_ctx_t *import_ctx,
+           svn_client_ctx_t *ctx,
+           apr_pool_t *pool);
 
-          /* Remember that the repository was modified */
-          import_ctx->repos_changed = TRUE;
 
-          /* By notifying before the recursive call below, we display
-             a directory add before displaying adds underneath the
-             directory.  To do it the other way around, just move this
-             after the recursive call. */
-          if (ctx->notify_func2)
-            {
-              svn_wc_notify_t *notify
-                = svn_wc_create_notify(this_abspath,
-                                       svn_wc_notify_commit_added,
-                                       subpool);
-              notify->kind = svn_node_dir;
-              notify->content_state = notify->prop_state
-                = svn_wc_notify_state_inapplicable;
-              notify->lock_state = svn_wc_notify_lock_state_inapplicable;
-              (*ctx->notify_func2)(ctx->notify_baton2, notify, subpool);
-            }
+/* Import the children of DIR_ABSPATH, with other arguments similar to
+ * import_dir(). */
+static svn_error_t *
+import_children(const char *dir_abspath,
+                const char *edit_path,
+                apr_hash_t *dirents,
+                const svn_delta_editor_t *editor,
+                void *dir_baton,
+                svn_depth_t depth,
+                apr_hash_t *excludes,
+                svn_boolean_t no_ignore,
+                svn_boolean_t ignore_unknown_node_types,
+                svn_client_import_filter_func_t filter_callback,
+                void *filter_baton,
+                import_ctx_t *import_ctx,
+                svn_client_ctx_t *ctx,
+                apr_pool_t *scratch_pool)
+{
+  apr_hash_index_t *hi;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
-          /* Recurse. */
-          {
-            svn_depth_t depth_below_here = depth;
-            if (depth == svn_depth_immediates)
-              depth_below_here = svn_depth_empty;
-
-            SVN_ERR(import_dir(editor, this_dir_baton, this_abspath,
-                               this_edit_path, depth_below_here, excludes,
-                               no_ignore, ignore_unknown_node_types,
-                               filter_callback, filter_baton,
-                               import_ctx, ctx,
-                               subpool));
-          }
+  for (hi = apr_hash_first(scratch_pool, dirents); hi; hi = apr_hash_next(hi))
+    {
+      const char *this_abspath, *this_edit_path;
+      const char *filename = svn__apr_hash_index_key(hi);
+      const svn_io_dirent2_t *dirent = svn__apr_hash_index_val(hi);
+
+      svn_pool_clear(iterpool);
+
+      if (ctx->cancel_func)
+        SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
+
+      /* Typically, we started importing from ".", in which case
+         edit_path is "".  So below, this_path might become "./blah",
+         and this_edit_path might become "blah", for example. */
+      this_abspath = svn_dirent_join(dir_abspath, filename, iterpool);
+      this_edit_path = svn_relpath_join(edit_path, filename, iterpool);
 
-          /* Finally, close the sub-directory. */
-          SVN_ERR(editor->close_directory(this_dir_baton, subpool));
+      if (dirent->kind == svn_node_dir && depth >= svn_depth_immediates)
+        {
+          /* Recurse. */
+          svn_depth_t depth_below_here = depth;
+          if (depth == svn_depth_immediates)
+            depth_below_here = svn_depth_empty;
+
+          SVN_ERR(import_dir(editor, dir_baton, this_abspath,
+                             this_edit_path, depth_below_here, excludes,
+                             no_ignore, ignore_unknown_node_types,
+                             filter_callback, filter_baton,
+                             import_ctx, ctx,
+                             iterpool));
         }
       else if (dirent->kind == svn_node_file && depth >= svn_depth_files)
         {
           SVN_ERR(import_file(editor, dir_baton, this_abspath,
                               this_edit_path, dirent,
-                              import_ctx, ctx, subpool));
+                              import_ctx, ctx, iterpool));
         }
       else if (dirent->kind != svn_node_dir && dirent->kind != svn_node_file)
         {
@@ -447,23 +451,114 @@ import_dir(const svn_delta_editor_t *edi
                 {
                   svn_wc_notify_t *notify
                     = svn_wc_create_notify(this_abspath,
-                                           svn_wc_notify_skip, subpool);
+                                           svn_wc_notify_skip, iterpool);
                   notify->kind = svn_node_dir;
                   notify->content_state = notify->prop_state
                     = svn_wc_notify_state_inapplicable;
                   notify->lock_state = svn_wc_notify_lock_state_inapplicable;
-                  (*ctx->notify_func2)(ctx->notify_baton2, notify, subpool);
+                  (*ctx->notify_func2)(ctx->notify_baton2, notify, iterpool);
                 }
             }
           else
             return svn_error_createf
               (SVN_ERR_NODE_UNKNOWN_KIND, NULL,
                _("Unknown or unversionable type for '%s'"),
-               svn_dirent_local_style(this_abspath, subpool));
+               svn_dirent_local_style(this_abspath, iterpool));
         }
     }
 
-  svn_pool_destroy(subpool);
+  svn_pool_destroy(iterpool);
+  return SVN_NO_ERROR;
+}
+
+
+/* Import directory LOCAL_ABSPATH into the repository directory indicated by
+ * DIR_BATON in EDITOR.  EDIT_PATH is the path imported as the root
+ * directory, so all edits are relative to that.
+ *
+ * DEPTH is the depth at this point in the descent (it may be changed
+ * for recursive calls).
+ *
+ * Accumulate file paths and their batons in FILES, which must be
+ * non-null.  (These are used to send postfix textdeltas later).
+ *
+ * EXCLUDES is a hash whose keys are absolute paths to exclude from
+ * the import (values are unused).
+ *
+ * If NO_IGNORE is FALSE, don't import files or directories that match
+ * ignore patterns.
+ *
+ * If FILTER_CALLBACK is not NULL, call it with FILTER_BATON on each to be
+ * imported node below LOCAL_ABSPATH to allow filtering nodes.
+ *
+ * If CTX->NOTIFY_FUNC is non-null, invoke it with CTX->NOTIFY_BATON for each
+ * directory.
+ *
+ * Use POOL for any temporary allocation.  */
+static svn_error_t *
+import_dir(const svn_delta_editor_t *editor,
+           void *dir_baton,
+           const char *local_abspath,
+           const char *edit_path,
+           svn_depth_t depth,
+           apr_hash_t *excludes,
+           svn_boolean_t no_ignore,
+           svn_boolean_t ignore_unknown_node_types,
+           svn_client_import_filter_func_t filter_callback,
+           void *filter_baton,
+           import_ctx_t *import_ctx,
+           svn_client_ctx_t *ctx,
+           apr_pool_t *pool)
+{
+  apr_hash_t *dirents;
+  apr_array_header_t *ignores = NULL;
+  void *this_dir_baton;
+
+  SVN_ERR(svn_path_check_valid(local_abspath, pool));
+
+  if (!no_ignore)
+    SVN_ERR(svn_wc_get_default_ignores(&ignores, ctx->config, pool));
+
+  SVN_ERR(get_filtered_children(&dirents, local_abspath, excludes, ignores,
+                                filter_callback, filter_baton, ctx,
+                                pool, pool));
+
+  /* Import this directory, but not yet its children. */
+  {
+    /* Add the new subdirectory, getting a descent baton from the editor. */
+    SVN_ERR(editor->add_directory(edit_path, dir_baton, NULL,
+                                  SVN_INVALID_REVNUM, pool, &this_dir_baton));
+
+    /* Remember that the repository was modified */
+    import_ctx->repos_changed = TRUE;
+
+    /* By notifying before the recursive call below, we display
+       a directory add before displaying adds underneath the
+       directory.  To do it the other way around, just move this
+       after the recursive call. */
+    if (ctx->notify_func2)
+      {
+        svn_wc_notify_t *notify
+          = svn_wc_create_notify(local_abspath, svn_wc_notify_commit_added,
+                                 pool);
+        notify->kind = svn_node_dir;
+        notify->content_state = notify->prop_state
+          = svn_wc_notify_state_inapplicable;
+        notify->lock_state = svn_wc_notify_lock_state_inapplicable;
+        (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
+      }
+  }
+
+  /* Now import the children recursively. */
+  SVN_ERR(import_children(local_abspath, edit_path, dirents, editor,
+                          this_dir_baton, depth, excludes, no_ignore, 
+                          ignore_unknown_node_types,
+                          filter_callback, filter_baton,
+                          import_ctx, ctx, pool));
+
+  /* Finally, close the sub-directory. */
+  SVN_ERR(editor->close_directory(this_dir_baton, pool));
+
   return SVN_NO_ERROR;
 }
 
@@ -596,11 +691,20 @@ import(const char *local_abspath,
     }
   else if (dirent->kind == svn_node_dir)
     {
-      SVN_ERR(import_dir(editor, root_baton, local_abspath, edit_path,
-                         depth, excludes, no_ignore,
-                         ignore_unknown_node_types,
-                         filter_callback, filter_baton,
-                         import_ctx, ctx, pool));
+      apr_hash_t *dirents;
+
+      if (!no_ignore)
+        SVN_ERR(svn_wc_get_default_ignores(&ignores, ctx->config, pool));
+
+      SVN_ERR(get_filtered_children(&dirents, local_abspath, excludes, ignores,
+                                    filter_callback, filter_baton, ctx,
+                                    pool, pool));
+
+      SVN_ERR(import_children(local_abspath, edit_path, dirents, editor,
+                              root_baton, depth, excludes, no_ignore,
+                              ignore_unknown_node_types,
+                              filter_callback, filter_baton,
+                              import_ctx, ctx, pool));
 
     }
   else if (dirent->kind == svn_node_none

Modified: subversion/branches/ev2-export/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_fs/fs-loader.c?rev=1328040&r1=1328039&r2=1328040&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_fs/fs-loader.c Thu Apr 19 16:30:31 2012
@@ -199,14 +199,27 @@ svn_fs_type(const char **fs_type, const 
   apr_size_t len;
 
   /* Read the fsap-name file to get the FSAP name, or assume the (old)
-     default. */
+     default.  For old repositories I suppose we could check some
+     other file, DB_CONFIG or strings say, but for now just check the
+     directory exists. */
   filename = svn_dirent_join(path, FS_TYPE_FILENAME, pool);
   err = svn_io_file_open(&file, filename, APR_READ|APR_BUFFERED, 0, pool);
   if (err && APR_STATUS_IS_ENOENT(err->apr_err))
     {
-      svn_error_clear(err);
-      *fs_type = apr_pstrdup(pool, SVN_FS_TYPE_BDB);
-      return SVN_NO_ERROR;
+      svn_node_kind_t kind;
+      svn_error_t *err2 = svn_io_check_path(path, &kind, pool);
+      if (err2)
+        {
+          svn_error_clear(err2);
+          return err;
+        }
+      if (kind == svn_node_dir)
+        {
+          svn_error_clear(err);
+          *fs_type = SVN_FS_TYPE_BDB;
+          return SVN_NO_ERROR;
+        }
+      return err;
     }
   else if (err)
     return err;

Modified: subversion/branches/ev2-export/subversion/libsvn_repos/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_repos/repos.c?rev=1328040&r1=1328039&r2=1328040&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_repos/repos.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_repos/repos.c Thu Apr 19 16:30:31 2012
@@ -1968,3 +1968,17 @@ svn_repos_remember_client_capabilities(s
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_repos__fs_type(const char **fs_type,
+                   const char *repos_path,
+                   apr_pool_t *pool)
+{
+  svn_repos_t repos;
+  repos.path = (char*)repos_path;
+
+  SVN_ERR(check_repos_format(&repos, pool));
+
+  return svn_fs_type(fs_type,
+                     svn_dirent_join(repos_path, SVN_REPOS__DB_DIR, pool),
+                     pool);
+}

Modified: subversion/branches/ev2-export/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/mod_dav_svn/repos.c?rev=1328040&r1=1328039&r2=1328040&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/ev2-export/subversion/mod_dav_svn/repos.c Thu Apr 19 16:30:31 2012
@@ -34,6 +34,9 @@
 #include <http_core.h>  /* for ap_construct_url */
 #include <mod_dav.h>
 
+#define CORE_PRIVATE      /* To make ap_show_mpm public in 2.2 */
+#include <http_config.h>
+
 #include "svn_types.h"
 #include "svn_pools.h"
 #include "svn_error.h"
@@ -50,6 +53,7 @@
 #include "svn_dirent_uri.h"
 #include "private/svn_log.h"
 #include "private/svn_fspath.h"
+#include "private/svn_repos_private.h"
 
 #include "dav_svn.h"
 
@@ -2144,6 +2148,8 @@ get_resource(request_rec *r,
   repos->repos = userdata;
   if (repos->repos == NULL)
     {
+      const char *fs_type;
+
       /* construct FS configuration parameters */
       fs_config = apr_hash_make(r->connection->pool);
       apr_hash_set(fs_config,
@@ -2159,9 +2165,24 @@ get_resource(request_rec *r,
                    APR_HASH_KEY_STRING,
                    dav_svn__get_revprop_cache_flag(r) ? "1" : "0");
 
+      /* Disallow BDB/event until issue 4157 is fixed. */
+      serr = svn_repos__fs_type(&fs_type, fs_path, r->connection->pool);
+      if (serr)
+        {
+          /* svn_repos_open2 is going to fail, use that error. */
+          svn_error_clear(serr);
+          serr = NULL;
+        }
+      else if (!strcmp(fs_type, "bdb") && !strcmp(ap_show_mpm(), "event"))
+        serr = svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+                                 "BDB repository at '%s' is not compatible "
+                                 "with event MPM",
+                                 fs_path);
+
       /* open the FS */
-      serr = svn_repos_open2(&(repos->repos), fs_path, fs_config,
-                             r->connection->pool);
+      if (!serr)
+        serr = svn_repos_open2(&(repos->repos), fs_path, fs_config,
+                               r->connection->pool);
       if (serr != NULL)
         {
           /* The error returned by svn_repos_open2 might contain the



Mime
View raw message