You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/03/17 22:10:52 UTC

svn commit: r1082699 - /subversion/trunk/subversion/libsvn_wc/lock.c

Author: hwright
Date: Thu Mar 17 21:10:51 2011
New Revision: 1082699

URL: http://svn.apache.org/viewvc?rev=1082699&view=rev
Log:
Fold a one-line function into its callsites.

* subversion/libsvn_wc/lock.c
  (alloc_db): Remove.
  (pool_cleanup_locked, svn_wc_adm_open3, open_anchor): Call
    svn_wc__db_open() directly.

Modified:
    subversion/trunk/subversion/libsvn_wc/lock.c

Modified: subversion/trunk/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/lock.c?rev=1082699&r1=1082698&r2=1082699&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/lock.c (original)
+++ subversion/trunk/subversion/libsvn_wc/lock.c Thu Mar 17 21:10:51 2011
@@ -97,12 +97,6 @@ close_single(svn_wc_adm_access_t *adm_ac
              svn_boolean_t preserve_lock,
              apr_pool_t *scratch_pool);
 
-static svn_error_t *
-alloc_db(svn_wc__db_t **db,
-         svn_config_t *config,
-         apr_pool_t *result_pool,
-         apr_pool_t *scratch_pool);
-
 
 svn_error_t *
 svn_wc__internal_check_wc(int *wc_format,
@@ -256,7 +250,8 @@ pool_cleanup_locked(void *p)
          run, but the subpools will NOT be destroyed)  */
       scratch_pool = svn_pool_create(lock->pool);
 
-      err = alloc_db(&db, NULL /* config */, scratch_pool, scratch_pool);
+      err = svn_wc__db_open(&db, NULL /* ### config. need! */, TRUE, TRUE,
+                            scratch_pool, scratch_pool);
       if (!err)
         {
           err = svn_wc__db_wq_fetch(&id, &work_item, db, lock->abspath,
@@ -417,19 +412,6 @@ adm_access_alloc(svn_wc_adm_access_t **a
 
 /* */
 static svn_error_t *
-alloc_db(svn_wc__db_t **db,
-         svn_config_t *config,
-         apr_pool_t *result_pool,
-         apr_pool_t *scratch_pool)
-{
-  SVN_ERR(svn_wc__db_open(db, config, TRUE, TRUE, result_pool, scratch_pool));
-
-  return SVN_NO_ERROR;
-}
-
-
-/* */
-static svn_error_t *
 add_to_shared(svn_wc_adm_access_t *lock, apr_pool_t *scratch_pool)
 {
   /* ### sometimes we replace &missing with a now-valid lock.  */
@@ -811,7 +793,8 @@ svn_wc_adm_open3(svn_wc_adm_access_t **a
          do it here.  */
       /* ### we could optimize around levels_to_lock==0, but much of this
          ### is going to be simplified soon anyways.  */
-      SVN_ERR(alloc_db(&db, NULL /* ### config. need! */, pool, pool));
+      SVN_ERR(svn_wc__db_open(&db, NULL /* ### config. need! */, TRUE, TRUE,
+                              pool, pool));
       db_provided = FALSE;
     }
 
@@ -1180,7 +1163,8 @@ open_anchor(svn_wc_adm_access_t **anchor
      ### given that we need DB for format detection, may as well keep this.
      ### in any case, much of this is going to be simplified soon anyways.  */
   if (!db_provided)
-    SVN_ERR(alloc_db(&db, NULL /* ### config. need! */, pool, pool));
+    SVN_ERR(svn_wc__db_open(&db, NULL, /* ### config. need! */ TRUE, TRUE,
+                            pool, pool));
 
   if (svn_path_is_empty(path)
       || svn_dirent_is_root(path, strlen(path))