Author: stefan2
Date: Sat May 21 15:50:41 2011
New Revision: 1125733

URL: http://svn.apache.org/viewvc?rev=1125733&view=rev
Log:
Add a bit plumbing: add an fs_config parameter to svn_repos_open,
so the latter may pass it on to svn_fs_open. Update all callers to use
a NULL configuration here. That will soon change.

* subversion/include/svn_repos.h
  (svn_repos_open2): declare new API function superseding svn_repos_open
  (svn_repos_open): deprecate
* subversion/libsvn_repos/repos.c
  (get_repos): add fs_config parameter & pass it on to svn_fs_open
  (svn_repos_open2): implement
  (svn_repos_upgrade2, svn_repos_recover4, svn_repos_db_logfiles,
   svn_repos_hotcopy): adapt callers
* subversion/libsvn_repos/deprecated.c
  (svn_repos_open): implement deprecated function in terms of the new API

* subversion/tests/svn_test_fs.c
  (svn_test__create_repos): call new API instead of deprecated one
* subversion/svnserve/serve.c
  (find_repos): dito
* subversion/svnlook/main.c
  (get_ctxt_baton): dito
* subversion/svnadmin/main.c
  (open_repos): dito
* subversion/mod_dav_svn/version.c
  (cleanup_deltify): dito
* subversion/mod_dav_svn/repos.c
  (get_resource): dito
* subversion/libsvn_ra_local/split_url.c
  (svn_ra_local__split_URL): dito
* subversion/bindings/javahl/native/SVNRepos.cpp
  (SVNRepos::deltify, SVNRepos::dump, SVNRepos::load, SVNRepos::lstxns, 
   SVNRepos::recover, SVNRepos::rmtxns, SVNRepos::setRevProp,
   SVNRepos::verify, SVNRepos::pack, SVNRepos::lslocks, SVNRepos::rmlocks): dito

* subversion/libsvn_repos/repos.h
  (svn_repos_t): update comment

Modified:
    subversion/trunk/subversion/bindings/javahl/native/SVNRepos.cpp
    subversion/trunk/subversion/include/svn_repos.h
    subversion/trunk/subversion/libsvn_ra_local/split_url.c
    subversion/trunk/subversion/libsvn_repos/deprecated.c
    subversion/trunk/subversion/libsvn_repos/repos.c
    subversion/trunk/subversion/libsvn_repos/repos.h
    subversion/trunk/subversion/mod_dav_svn/repos.c
    subversion/trunk/subversion/mod_dav_svn/version.c
    subversion/trunk/subversion/svnadmin/main.c
    subversion/trunk/subversion/svnlook/main.c
    subversion/trunk/subversion/svnserve/serve.c
    subversion/trunk/subversion/tests/svn_test_fs.c

Modified: subversion/trunk/subversion/bindings/javahl/native/SVNRepos.cpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNRepos.cpp?rev=1125733&r1=1125732&r2=1125733&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/SVNRepos.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/SVNRepos.cpp Sat May 21 
15:50:41 2011
@@ -107,8 +107,8 @@ void SVNRepos::deltify(File &path, Revis
       return;
     }
 
-  SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
-                             requestPool.pool()), );
+  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
+                              NULL, requestPool.pool()), );
   fs = svn_repos_fs(repos);
   SVN_JNI_ERR(svn_fs_youngest_rev(&youngest, fs, requestPool.pool()), );
 
@@ -176,8 +176,8 @@ void SVNRepos::dump(File &path, OutputSt
       return;
     }
 
-  SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
-                             requestPool.pool()), );
+  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
+                              NULL, requestPool.pool()), );
   fs = svn_repos_fs(repos);
   SVN_JNI_ERR(svn_fs_youngest_rev(&youngest, fs, requestPool.pool()), );
 
@@ -316,8 +316,8 @@ void SVNRepos::load(File &path,
       return;
     }
 
-  SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
-                             requestPool.pool()), );
+  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
+                              NULL, requestPool.pool()), );
 
   SVN_JNI_ERR(svn_repos_load_fs3(repos, dataIn.getStream(requestPool),
                                  uuid_action, relativePath,
@@ -343,8 +343,8 @@ void SVNRepos::lstxns(File &path, Messag
       return;
     }
 
-  SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
-                             requestPool.pool()), );
+  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
+                              NULL, requestPool.pool()), );
   fs = svn_repos_fs (repos);
   SVN_JNI_ERR(svn_fs_list_transactions(&txns, fs, requestPool.pool()), );
 
@@ -380,8 +380,8 @@ jlong SVNRepos::recover(File &path, Repo
   /* Since db transactions may have been replayed, it's nice to tell
    * people what the latest revision is.  It also proves that the
    * recovery actually worked. */
-  SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
-                             requestPool.pool()), -1);
+  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
+                              NULL, requestPool.pool()), -1);
   SVN_JNI_ERR(svn_fs_youngest_rev(&youngest_rev, svn_repos_fs (repos),
                                   requestPool.pool()),
               -1);
@@ -404,8 +404,8 @@ void SVNRepos::rmtxns(File &path, String
       return;
     }
 
-  SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
-                             requestPool.pool()), );
+  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
+                              NULL, requestPool.pool()), );
   fs = svn_repos_fs (repos);
 
   args = transactions.array(requestPool);
@@ -461,8 +461,8 @@ void SVNRepos::setRevProp(File &path, Re
 
   /* Open the filesystem. */
   svn_repos_t *repos;
-  SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
-                             requestPool.pool()), );
+  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
+                              NULL, requestPool.pool()), );
 
   /* If we are bypassing the hooks system, we just hit the filesystem
    * directly. */
@@ -535,8 +535,8 @@ SVNRepos::verify(File &path, Revision &r
 
   /* This whole process is basically just a dump of the repository
    * with no interest in the output. */
-  SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
-                             requestPool.pool()), );
+  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
+                              NULL, requestPool.pool()), );
   SVN_JNI_ERR(svn_fs_youngest_rev(&youngest, svn_repos_fs (repos),
                                   requestPool.pool()), );
 
@@ -582,8 +582,8 @@ void SVNRepos::pack(File &path, ReposNot
       return;
     }
 
-  SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
-                             requestPool.pool()), );
+  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
+                              NULL, requestPool.pool()), );
 
   SVN_JNI_ERR(svn_repos_fs_pack2(repos,
                                  notifyCallback != NULL
@@ -627,8 +627,8 @@ jobject SVNRepos::lslocks(File &path, sv
       return NULL;
     }
 
-  SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
-                             requestPool.pool()), NULL);
+  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
+                              NULL, requestPool.pool()), NULL);
   /* Fetch all locks on or below the root directory. */
   SVN_JNI_ERR(svn_repos_fs_get_locks2(&locks, repos, "/", depth, NULL, NULL,
                                       requestPool.pool()),
@@ -672,8 +672,8 @@ void SVNRepos::rmlocks(File &path, Strin
       return;
     }
 
-  SVN_JNI_ERR(svn_repos_open(&repos, path.getInternalStyle(requestPool),
-                             requestPool.pool()), );
+  SVN_JNI_ERR(svn_repos_open2(&repos, path.getInternalStyle(requestPool),
+                              NULL, requestPool.pool()), );
   fs = svn_repos_fs (repos);
   const char *username;
 

Modified: subversion/trunk/subversion/include/svn_repos.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_repos.h?rev=1125733&r1=1125732&r2=1125733&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_repos.h (original)
+++ subversion/trunk/subversion/include/svn_repos.h Sat May 21 15:50:41 2011
@@ -334,7 +334,20 @@ svn_repos_find_root_path(const char *pat
  * Acquires a shared lock on the repository, and attaches a cleanup
  * function to @a pool to remove the lock.  If no lock can be acquired,
  * returns error, with undefined effect on @a *repos_p.  If an exclusive
- * lock is present, this blocks until it's gone.
+ * lock is present, this blocks until it's gone.  @a fs_config will be
+ * passed to the filesystem initialization function and may be @c NULL.
+ * 
+ * @since New in 1.7.
+ */
+svn_error_t *
+svn_repos_open2(svn_repos_t **repos_p,
+                const char *path,
+                apr_hash_t *fs_config,
+                apr_pool_t *pool);
+
+/** Similar to @ref svn_repos_open2 with @a fs_config set to NULL.
+ * 
+ * @deprecated Provided for backward compatibility with 1.6 API.
  */
 svn_error_t *
 svn_repos_open(svn_repos_t **repos_p,

Modified: subversion/trunk/subversion/libsvn_ra_local/split_url.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_local/split_url.c?rev=1125733&r1=1125732&r2=1125733&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_local/split_url.c (original)
+++ subversion/trunk/subversion/libsvn_ra_local/split_url.c Sat May 21 15:50:41 
2011
@@ -49,7 +49,7 @@ svn_ra_local__split_URL(svn_repos_t **re
                              _("Unable to open repository '%s'"), URL);
 
   /* Attempt to open a repository at URL. */
-  err = svn_repos_open(repos, repos_root_dirent, pool);
+  err = svn_repos_open2(repos, repos_root_dirent, NULL, pool);
   if (err)
     return svn_error_createf(SVN_ERR_RA_LOCAL_REPOS_OPEN_FAILED, err,
                              _("Unable to open repository '%s'"), URL);

Modified: subversion/trunk/subversion/libsvn_repos/deprecated.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/deprecated.c?rev=1125733&r1=1125732&r2=1125733&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_repos/deprecated.c Sat May 21 15:50:41 
2011
@@ -136,6 +136,15 @@ svn_repos_get_commit_editor(const svn_de
                                       callback_baton, pool);
 }
 
+svn_error_t *
+svn_repos_open(svn_repos_t **repos_p,
+               const char *path,
+               apr_pool_t *pool)
+{
+  return svn_repos_open2(repos_p, path, NULL, pool);
+}
+
+
 /*** From repos.c ***/
 struct recover_baton
 {

Modified: subversion/trunk/subversion/libsvn_repos/repos.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/repos.c?rev=1125733&r1=1125732&r2=1125733&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/repos.c (original)
+++ subversion/trunk/subversion/libsvn_repos/repos.c Sat May 21 15:50:41 2011
@@ -1352,6 +1352,7 @@ get_repos(svn_repos_t **repos_p,
           svn_boolean_t exclusive,
           svn_boolean_t nonblocking,
           svn_boolean_t open_fs,
+          apr_hash_t *fs_config,
           apr_pool_t *pool)
 {
   svn_repos_t *repos;
@@ -1370,7 +1371,7 @@ get_repos(svn_repos_t **repos_p,
 
   /* Open up the filesystem only after obtaining the lock. */
   if (open_fs)
-    SVN_ERR(svn_fs_open(&repos->fs, repos->db_path, NULL, pool));
+    SVN_ERR(svn_fs_open(&repos->fs, repos->db_path, fs_config, pool));
 
   *repos_p = repos;
   return SVN_NO_ERROR;
@@ -1408,14 +1409,15 @@ svn_repos_find_root_path(const char *pat
 
 
 svn_error_t *
-svn_repos_open(svn_repos_t **repos_p,
-               const char *path,
-               apr_pool_t *pool)
+svn_repos_open2(svn_repos_t **repos_p,
+                const char *path,
+                apr_hash_t *fs_config,
+                apr_pool_t *pool)
 {
   /* Fetch a repository object initialized with a shared read/write
      lock on the database. */
 
-  return get_repos(repos_p, path, FALSE, FALSE, TRUE, pool);
+  return get_repos(repos_p, path, FALSE, FALSE, TRUE, fs_config, pool);
 }
 
 
@@ -1436,7 +1438,7 @@ svn_repos_upgrade2(const char *path,
      least prevent others from trying to read or write to it while we
      run recovery. (Other backends should do their own locking; see
      lock_repos.) */
-  SVN_ERR(get_repos(&repos, path, TRUE, nonblocking, FALSE, subpool));
+  SVN_ERR(get_repos(&repos, path, TRUE, nonblocking, FALSE, NULL, subpool));
 
   if (notify_func)
     {
@@ -1615,6 +1617,7 @@ svn_repos_recover4(const char *path,
      lock_repos.) */
   SVN_ERR(get_repos(&repos, path, TRUE, nonblocking,
                     FALSE,    /* don't try to open the db yet. */
+                    NULL,
                     subpool));
 
   if (notify_func)
@@ -1649,6 +1652,7 @@ svn_error_t *svn_repos_db_logfiles(apr_a
   SVN_ERR(get_repos(&repos, path,
                     FALSE, FALSE,
                     FALSE,     /* Do not open fs. */
+                    NULL,
                     pool));
 
   SVN_ERR(svn_fs_berkeley_logfiles(logfiles,
@@ -1762,6 +1766,7 @@ svn_repos_hotcopy(const char *src_path,
   SVN_ERR(get_repos(&src_repos, src_path,
                     FALSE, FALSE,
                     FALSE,    /* don't try to open the db yet. */
+                    NULL,
                     pool));
 
   /* If we are going to clean logs, then get an exclusive lock on

Modified: subversion/trunk/subversion/libsvn_repos/repos.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/repos.h?rev=1125733&r1=1125732&r2=1125733&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/repos.h (original)
+++ subversion/trunk/subversion/libsvn_repos/repos.h Sat May 21 15:50:41 2011
@@ -95,7 +95,7 @@ extern "C" {
 #define SVN_REPOS__CONF_PASSWD "passwd"
 #define SVN_REPOS__CONF_AUTHZ "authz"
 
-/* The Repository object, created by svn_repos_open() and
+/* The Repository object, created by svn_repos_open2() and
    svn_repos_create(). */
 struct svn_repos_t
 {

Modified: subversion/trunk/subversion/mod_dav_svn/repos.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/repos.c?rev=1125733&r1=1125732&r2=1125733&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/repos.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/repos.c Sat May 21 15:50:41 2011
@@ -2132,10 +2132,11 @@ get_resource(request_rec *r,
   repos->repos = userdata;
   if (repos->repos == NULL)
     {
-      serr = svn_repos_open(&(repos->repos), fs_path, r->connection->pool);
+      serr = svn_repos_open2(&(repos->repos), fs_path, NULL, 
+                             r->connection->pool);
       if (serr != NULL)
         {
-          /* The error returned by svn_repos_open might contain the
+          /* The error returned by svn_repos_open2 might contain the
              actual path to the failed repository.  We don't want to
              leak that path back to the client, because that would be
              a security risk, but we do want to log the real error on

Modified: subversion/trunk/subversion/mod_dav_svn/version.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/version.c?rev=1125733&r1=1125732&r2=1125733&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/version.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/version.c Sat May 21 15:50:41 2011
@@ -798,7 +798,7 @@ cleanup_deltify(void *data)
      subpool, then destroy it before exiting. */
   apr_pool_t *subpool = svn_pool_create(cdb->pool);
 
-  err = svn_repos_open(&repos, cdb->repos_path, subpool);
+  err = svn_repos_open2(&repos, cdb->repos_path, NULL, subpool);
   if (err)
     {
       ap_log_perror(APLOG_MARK, APLOG_ERR, err->apr_err, cdb->pool,

Modified: subversion/trunk/subversion/svnadmin/main.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnadmin/main.c?rev=1125733&r1=1125732&r2=1125733&view=diff
==============================================================================
--- subversion/trunk/subversion/svnadmin/main.c (original)
+++ subversion/trunk/subversion/svnadmin/main.c Sat May 21 15:50:41 2011
@@ -108,7 +108,7 @@ open_repos(svn_repos_t **repos,
            const char *path,
            apr_pool_t *pool)
 {
-  SVN_ERR(svn_repos_open(repos, path, pool));
+  SVN_ERR(svn_repos_open2(repos, path, NULL, pool));
   svn_fs_set_warning_func(svn_repos_fs(*repos), warning_func, NULL);
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/svnlook/main.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnlook/main.c?rev=1125733&r1=1125732&r2=1125733&view=diff
==============================================================================
--- subversion/trunk/subversion/svnlook/main.c (original)
+++ subversion/trunk/subversion/svnlook/main.c Sat May 21 15:50:41 2011
@@ -1872,7 +1872,8 @@ get_ctxt_baton(svnlook_ctxt_t **baton_p,
 {
   svnlook_ctxt_t *baton = apr_pcalloc(pool, sizeof(*baton));
 
-  SVN_ERR(svn_repos_open(&(baton->repos), opt_state->repos_path, pool));
+  SVN_ERR(svn_repos_open2(&(baton->repos), opt_state->repos_path, NULL, 
+                          pool));
   baton->fs = svn_repos_fs(baton->repos);
   svn_fs_set_warning_func(baton->fs, warning_func, NULL);
   baton->show_ids = opt_state->show_ids;

Modified: subversion/trunk/subversion/svnserve/serve.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnserve/serve.c?rev=1125733&r1=1125732&r2=1125733&view=diff
==============================================================================
--- subversion/trunk/subversion/svnserve/serve.c (original)
+++ subversion/trunk/subversion/svnserve/serve.c Sat May 21 15:50:41 2011
@@ -2998,7 +2998,7 @@ static svn_error_t *find_repos(const cha
                              "No repository found in '%s'", url);
 
   /* Open the repository and fill in b with the resulting information. */
-  SVN_ERR(svn_repos_open(&b->repos, repos_root, pool));
+  SVN_ERR(svn_repos_open2(&b->repos, repos_root, NULL, pool));
   SVN_ERR(svn_repos_remember_client_capabilities(b->repos, capabilities));
   b->fs = svn_repos_fs(b->repos);
   fs_path = full_path + strlen(repos_root);

Modified: subversion/trunk/subversion/tests/svn_test_fs.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/svn_test_fs.c?rev=1125733&r1=1125732&r2=1125733&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/svn_test_fs.c (original)
+++ subversion/trunk/subversion/tests/svn_test_fs.c Sat May 21 15:50:41 2011
@@ -223,7 +223,7 @@ svn_test__create_repos(svn_repos_t **rep
                                   pool));
   if (must_reopen)
     {
-      SVN_ERR(svn_repos_open(&repos, name, pool));
+      SVN_ERR(svn_repos_open2(&repos, name, NULL, pool));
       svn_fs_set_warning_func(svn_repos_fs(repos), fs_warning_handler, NULL);
     }
 


Reply via email to