You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/03/15 01:15:06 UTC

svn commit: r1081616 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Author: rhuijben
Date: Tue Mar 15 00:15:05 2011
New Revision: 1081616

URL: http://svn.apache.org/viewvc?rev=1081616&view=rev
Log:
* subversion/libsvn_wc/wc_db.c
  (flush_entries): Remove unused argument. Do nothing if there are no cached
    entries.
  (*): Update callers.

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

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1081616&r1=1081615&r2=1081616&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Mar 15 00:15:05 2011
@@ -1072,14 +1072,16 @@ gather_repo_children(const apr_array_hea
 
 /* */
 static svn_error_t *
-flush_entries(svn_wc__db_t *db,
-              svn_wc__db_wcroot_t *wcroot,
+flush_entries(svn_wc__db_wcroot_t *wcroot,
               const char *local_abspath,
               apr_pool_t *scratch_pool)
 {
   svn_wc_adm_access_t *adm_access;
   const char *parent_abspath;
 
+  if (apr_hash_count(wcroot->access_cache) == 0)
+    return SVN_NO_ERROR;
+
   adm_access = apr_hash_get(wcroot->access_cache, local_abspath,
                             APR_HASH_KEY_STRING);
 
@@ -1440,7 +1442,7 @@ svn_wc__db_base_add_directory(svn_wc__db
                               scratch_pool));
 
   /* ### worry about flushing child subdirs?  */
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
   return SVN_NO_ERROR;
 }
 
@@ -1512,7 +1514,7 @@ svn_wc__db_base_add_file(svn_wc__db_t *d
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_base_node, &ibb,
                               scratch_pool));
 
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
   return SVN_NO_ERROR;
 }
 
@@ -1582,7 +1584,7 @@ svn_wc__db_base_add_symlink(svn_wc__db_t
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_base_node, &ibb,
                               scratch_pool));
 
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
   return SVN_NO_ERROR;
 }
 
@@ -1647,7 +1649,7 @@ add_absent_excluded_not_present_node(svn
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_base_node, &ibb,
                               scratch_pool));
 
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -1748,7 +1750,7 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, db_base_remove, NULL,
                               scratch_pool));
 
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -2723,7 +2725,7 @@ svn_wc__db_op_copy_dir(svn_wc__db_t *db,
 
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_working_node, &iwb,
                               scratch_pool));
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -2796,7 +2798,7 @@ svn_wc__db_op_copy_file(svn_wc__db_t *db
 
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_working_node, &iwb,
                               scratch_pool));
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -2865,7 +2867,7 @@ svn_wc__db_op_copy_symlink(svn_wc__db_t 
 
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_working_node, &iwb,
                               scratch_pool));
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -2898,7 +2900,7 @@ svn_wc__db_op_add_directory(svn_wc__db_t
 
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_working_node, &iwb,
                               scratch_pool));
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -2931,7 +2933,7 @@ svn_wc__db_op_add_file(svn_wc__db_t *db,
 
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_working_node, &iwb,
                               scratch_pool));
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -2968,7 +2970,7 @@ svn_wc__db_op_add_symlink(svn_wc__db_t *
 
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_working_node, &iwb,
                               scratch_pool));
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -3259,9 +3261,7 @@ svn_wc__db_op_set_changelist(svn_wc__db_
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, set_changelist_txn,
                               (void *) changelist, scratch_pool));
 
-  /* No need to flush the parent entries; changelists were not stored in the
-     stub */
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -3321,7 +3321,7 @@ svn_wc__db_op_mark_resolved(svn_wc__db_t
     }
 
   /* Some entries have cached the above values. Kapow!!  */
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -3415,7 +3415,7 @@ svn_wc__db_op_set_tree_conflict(svn_wc__
                               (void *) tree_conflict, scratch_pool));
 
   /* There may be some entries, and the lock info is now out of date.  */
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -3457,7 +3457,7 @@ svn_wc__db_op_revert_actual(svn_wc__db_t
     }
 
   /* Some entries have cached the above values. Kapow!!  */
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -3858,7 +3858,7 @@ svn_wc__db_temp_op_remove_entry(svn_wc__
                               scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, STMT_DELETE_NODES));
   SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
@@ -3890,7 +3890,7 @@ svn_wc__db_temp_op_remove_working(svn_wc
                               scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_DELETE_WORKING_NODE));
@@ -3913,7 +3913,7 @@ update_depth_values(svn_wc__db_t *db,
   svn_sqlite__stmt_t *stmt;
 
   /* Flush any entries before we start monkeying the database.  */
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     excluded
@@ -4499,7 +4499,7 @@ svn_wc__db_temp_op_delete(svn_wc__db_t *
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, temp_op_delete_txn, &b,
                               scratch_pool));
 
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -6169,7 +6169,7 @@ svn_wc__db_global_commit(svn_wc__db_t *d
                               scratch_pool));
 
   /* We *totally* monkeyed the entries. Toss 'em.  */
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -6254,7 +6254,7 @@ svn_wc__db_global_update(svn_wc__db_t *d
 #endif
 
   /* We *totally* monkeyed the entries. Toss 'em.  */
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -6275,7 +6275,7 @@ db_op_set_rev_and_repos_relpath(svn_wc__
 {
   svn_sqlite__stmt_t *stmt;
 
-  SVN_ERR(flush_entries(NULL /* db */, wcroot, 
+  SVN_ERR(flush_entries(wcroot,
                         svn_dirent_join(wcroot->abspath, local_relpath,
                                         scratch_pool),
                         scratch_pool));
@@ -6666,7 +6666,7 @@ svn_wc__db_global_record_fileinfo(svn_wc
                               scratch_pool));
 
   /* We *totally* monkeyed the entries. Toss 'em.  */
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -6727,7 +6727,7 @@ svn_wc__db_lock_add(svn_wc__db_t *db,
                               (void *) lock, scratch_pool));
 
   /* There may be some entries, and the lock info is now out of date.  */
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -6776,7 +6776,7 @@ svn_wc__db_lock_remove(svn_wc__db_t *db,
                               scratch_pool));
 
   /* There may be some entries, and the lock info is now out of date.  */
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -8792,7 +8792,7 @@ svn_wc__db_temp_op_set_base_incomplete(s
   affected_rows = affected_node_rows;
 
   if (affected_rows > 0)
-    SVN_ERR(flush_entries(db, wcroot, local_dir_abspath, scratch_pool));
+    SVN_ERR(flush_entries(wcroot, local_dir_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -8857,7 +8857,7 @@ svn_wc__db_temp_op_start_directory_updat
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath,
                               start_directory_update_txn, &du, scratch_pool));
 
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -9004,7 +9004,7 @@ make_copy_txn(void *baton,
       SVN_ERR(svn_sqlite__step_done(stmt));
     }
 
-  SVN_ERR(flush_entries(mcb->db, wcroot, mcb->local_abspath, iterpool));
+  SVN_ERR(flush_entries(wcroot, mcb->local_abspath, iterpool));
 
   svn_pool_destroy(iterpool);
 
@@ -9207,7 +9207,7 @@ svn_wc__db_temp_op_set_file_external(svn
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, set_file_external_txn,
                               &sfeb, scratch_pool));
 
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -9418,7 +9418,7 @@ svn_wc__db_temp_op_set_new_dir_to_incomp
 
   VERIFY_USABLE_WCROOT(wcroot);
 
-  SVN_ERR(flush_entries(db, wcroot, local_abspath, scratch_pool));
+  SVN_ERR(flush_entries(wcroot, local_abspath, scratch_pool));
 
   SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath,
                               set_new_dir_to_incomplete_txn,