You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2011/03/11 15:45:22 UTC
svn commit: r1080582 - /subversion/trunk/subversion/libsvn_wc/wc_db.c
Author: julianfoad
Date: Fri Mar 11 14:45:21 2011
New Revision: 1080582
URL: http://svn.apache.org/viewvc?rev=1080582&view=rev
Log:
* subversion/libsvn_wc/wc_db.c
(svn_wc__db_node_hidden): Simplify, undoing premature optimisation. Now
that the NODES table is in place, this simpler implementation will be
the more efficient.
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=1080582&r1=1080581&r2=1080582&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Mar 11 14:45:21 2011
@@ -7726,13 +7726,7 @@ svn_wc__db_node_hidden(svn_boolean_t *hi
{
svn_wc__db_wcroot_t *wcroot;
const char *local_relpath;
- svn_wc__db_status_t base_status;
- svn_sqlite__stmt_t *stmt;
- svn_boolean_t have_row;
-
- /* This uses an optimisation that first reads the working node and
- then may read the base node. It could call svn_wc__db_read_info
- but that would always read both nodes. */
+ svn_wc__db_status_t status;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
@@ -7741,35 +7735,15 @@ svn_wc__db_node_hidden(svn_boolean_t *hi
scratch_pool, scratch_pool));
VERIFY_USABLE_WCROOT(wcroot);
- /* First check the working node. */
- SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
- STMT_SELECT_WORKING_NODE));
- SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
-
- if (have_row)
- {
- /* Note: this can ONLY be an add/copy-here/move-here. It is not
- possible to delete a "hidden" node. */
- svn_wc__db_status_t work_presence =
- svn_sqlite__column_token(stmt, 1, presence_map);
- *hidden = (work_presence == svn_wc__db_status_excluded);
- SVN_ERR(svn_sqlite__reset(stmt));
- return SVN_NO_ERROR;
- }
-
- SVN_ERR(svn_sqlite__reset(stmt));
+ SVN_ERR(read_info(&status, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ wcroot, local_relpath,
+ scratch_pool, scratch_pool));
- /* Now check the BASE node's status. */
- SVN_ERR(base_get_info(&base_status,
- NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- wcroot, local_relpath,
- scratch_pool, scratch_pool));
-
- *hidden = (base_status == svn_wc__db_status_absent
- || base_status == svn_wc__db_status_not_present
- || base_status == svn_wc__db_status_excluded);
+ *hidden = (status == svn_wc__db_status_absent
+ || status == svn_wc__db_status_not_present
+ || status == svn_wc__db_status_excluded);
return SVN_NO_ERROR;
}