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 2010/01/15 18:42:24 UTC
svn commit: r899731 - in /subversion/trunk/subversion/libsvn_wc: entries.c
wc_db.c wc_db.h workqueue.c
Author: hwright
Date: Fri Jan 15 17:42:23 2010
New Revision: 899731
URL: http://svn.apache.org/viewvc?rev=899731&view=rev
Log:
Move the determine_keep_local() function from entries.c into a temporary
function in wc_db. Use it elsewhere, instead of grabbing an entry to read
that value.
* subversion/libsvn_wc/entries.c
(determine_keep_local): Remove.
(read_entries_new): Call the wc_db API in place of the local function.
* subversion/libsvn_wc/wc_db.c
(svn_wc__db_temp_determine_keep_local): New.
* subversion/libsvn_wc/wc_db.h
(svn_wc__db_temp_determine_keep_local): New.
* subversion/libsvn_wc/workqueue.c
(run_deletion_postcommit): Use the wc_db API instead of reading the entire
entry.
Modified:
subversion/trunk/subversion/libsvn_wc/entries.c
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/libsvn_wc/wc_db.h
subversion/trunk/subversion/libsvn_wc/workqueue.c
Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=899731&r1=899730&r2=899731&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Fri Jan 15 17:42:23 2010
@@ -194,24 +194,6 @@
}
-static svn_error_t *
-determine_keep_local(svn_boolean_t *keep_local,
- svn_sqlite__db_t *sdb,
- apr_int64_t wc_id,
- const char *local_relpath)
-{
- svn_sqlite__stmt_t *stmt;
-
- SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_SELECT_KEEP_LOCAL_FLAG));
- SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, local_relpath));
- SVN_ERR(svn_sqlite__step_row(stmt));
-
- *keep_local = svn_sqlite__column_boolean(stmt, 0);
-
- return svn_error_return(svn_sqlite__reset(stmt));
-}
-
-
/* Hit the database to check the file external information for the given
entry. The entry will be modified in place. */
static svn_error_t *
@@ -521,7 +503,7 @@
entries = apr_hash_make(result_pool);
- /* ### need database to determine: incomplete, keep_local, ACTUAL info. */
+ /* ### need database to determine: incomplete, ACTUAL info. */
SVN_ERR(svn_wc__db_temp_get_sdb(&sdb, db, local_abspath, FALSE,
handle_pool, iterpool));
@@ -709,8 +691,9 @@
directories after the delete operation are always kept locally.
*/
if (*entry->name == '\0')
- SVN_ERR(determine_keep_local(&entry->keep_local, sdb,
- wc_id, entry->name));
+ SVN_ERR(svn_wc__db_temp_determine_keep_local(&entry->keep_local,
+ db, entry_abspath,
+ scratch_pool));
}
else if (status == svn_wc__db_status_added
|| status == svn_wc__db_status_obstructed_add)
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=899731&r1=899730&r2=899731&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Jan 15 17:42:23 2010
@@ -5273,6 +5273,23 @@
}
svn_error_t *
+svn_wc__db_temp_determine_keep_local(svn_boolean_t *keep_local,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool)
+{
+ svn_sqlite__stmt_t *stmt;
+
+ SVN_ERR(get_statement_for_path(&stmt, db, local_abspath,
+ STMT_SELECT_KEEP_LOCAL_FLAG, scratch_pool));
+ SVN_ERR(svn_sqlite__step_row(stmt));
+
+ *keep_local = svn_sqlite__column_boolean(stmt, 0);
+
+ return svn_error_return(svn_sqlite__reset(stmt));
+}
+
+svn_error_t *
svn_wc__db_read_conflict_victims(const apr_array_header_t **victims,
svn_wc__db_t *db,
const char *local_abspath,
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=899731&r1=899730&r2=899731&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Fri Jan 15 17:42:23 2010
@@ -1891,6 +1891,12 @@
const char *local_abspath,
apr_pool_t *scratch_pool);
+svn_error_t *
+svn_wc__db_temp_determine_keep_local(svn_boolean_t *keep_local,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool);
+
/* Removes all references of LOCAL_ABSPATH from its working copy
using DB. When FLUSH_ENTRY_CACHE is set to TRUE, flush the related
entries caches. */
Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=899731&r1=899730&r2=899731&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Fri Jan 15 17:42:23 2010
@@ -903,7 +903,7 @@
processing this logfile. */
if (kind == svn_wc__db_kind_dir)
{
- const svn_wc_entry_t *orig_entry;
+ svn_boolean_t keep_local;
svn_wc_entry_t tmp_entry;
/* Bump the revision number of this_dir anyway, so that it
@@ -918,14 +918,14 @@
SVN_WC__ENTRY_MODIFY_REVISION,
scratch_pool));
- SVN_ERR(svn_wc__get_entry(&orig_entry, db, local_abspath, FALSE,
- svn_node_unknown, FALSE,
- scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_temp_determine_keep_local(&keep_local, db,
+ local_abspath,
+ scratch_pool));
/* Ensure the directory is deleted later. */
return svn_error_return(svn_wc__wq_add_killme(
db, local_abspath,
- orig_entry->keep_local /* adm_only */,
+ keep_local /* adm_only */,
scratch_pool));
}