You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2010/09/10 19:33:25 UTC
svn commit: r995885 [3/3] - in /subversion/branches/atomic-revprop: ./
subversion/include/private/ subversion/libsvn_client/
subversion/libsvn_fs_fs/ subversion/libsvn_ra_neon/
subversion/libsvn_ra_serf/ subversion/libsvn_repos/
subversion/libsvn_subr/...
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c?rev=995885&r1=995884&r2=995885&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c Fri Sep 10 17:33:24 2010
@@ -747,39 +747,28 @@ copy_working_from_base(void *baton,
const insert_working_baton_t *piwb = baton;
svn_sqlite__stmt_t *stmt;
-#ifdef SVN_WC__NODE_DATA
- /* Insert NODE_DATA stuff */
+#ifdef SVN_WC__NODES
+
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
- STMT_INSERT_WORKING_NODE_DATA_FROM_BASE_NODE_1));
- SVN_ERR(svn_sqlite__bindf(stmt, "isti", piwb->wc_id,
+ STMT_INSERT_WORKING_NODE_FROM_BASE));
+ SVN_ERR(svn_sqlite__bindf(stmt, "isit", piwb->wc_id,
piwb->local_relpath,
- presence_map, piwb->presence,
- piwb->op_depth));
+ piwb->op_depth,
+ presence_map, piwb->presence));
SVN_ERR(svn_sqlite__insert(NULL, stmt));
-#if 0
- /* This doesn't work yet, due to the fact that other constraints
- are active on the WORKING NODE table while we haven't removed the
- NODE_TABLE columns. */
-
- /* Insert WORKING_NODE stuff */
- SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
- STMT_INSERT_WORKING_NODE_DATA_FROM_BASE_NODE_2));
- SVN_ERR(svn_sqlite__bindf(stmt, "is", piwb->wc_id, piwb->local_relpath));
- SVN_ERR(svn_sqlite__insert(NULL, stmt));
-#endif
#endif
+#ifndef SVN_WC__NODES_ONLY
/* Run the sequence below instead, which copies all the columns, including
- those with the restrictions
-
- ### REMOVE when fully migrating to NODE_DATA */
+ those with the restrictions */
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
STMT_INSERT_WORKING_NODE_FROM_BASE_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "ist", piwb->wc_id, piwb->local_relpath,
presence_map, piwb->presence));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
return SVN_NO_ERROR;
}
@@ -850,7 +839,7 @@ insert_working_node(void *baton,
const insert_working_baton_t *piwb = baton;
const char *parent_relpath;
svn_sqlite__stmt_t *stmt;
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
svn_sqlite__stmt_t *stmt_node;
apr_int64_t op_depth;
#endif
@@ -863,6 +852,7 @@ insert_working_node(void *baton,
else
parent_relpath = svn_relpath_dirname(piwb->local_relpath, scratch_pool);
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_INSERT_WORKING_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "isstt",
piwb->wc_id, piwb->local_relpath,
@@ -918,55 +908,51 @@ insert_working_node(void *baton,
SVN_ERR(svn_sqlite__insert(NULL, stmt));
+#endif
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
op_depth = (parent_relpath == NULL) ? 1 /* THIS_DIR */
: 2; /* immediate children */
- SVN_ERR(svn_sqlite__get_statement(&stmt_node, sdb, STMT_INSERT_NODE_DATA));
- SVN_ERR(svn_sqlite__bindf(stmt_node, "isistt",
- piwb->wc_id, piwb->local_relpath,
- op_depth,
- parent_relpath,
- presence_map, piwb->presence,
- kind_map, piwb->kind));
+ SVN_ERR(svn_sqlite__get_statement(&stmt_node, sdb, STMT_INSERT_NODE));
+ SVN_ERR(svn_sqlite__bindf(stmt_node, "isisnnntstrisn"
+ "nnnn" /* properties translated_size last_mod_time dav_cache */
+ "s",
+ piwb->wc_id, piwb->local_relpath,
+ op_depth,
+ parent_relpath,
+ presence_map, piwb->presence,
+ (piwb->kind == svn_wc__db_kind_dir)
+ ? svn_depth_to_word(piwb->depth) : NULL,
+ kind_map, piwb->kind,
+ piwb->changed_rev,
+ piwb->changed_date,
+ piwb->changed_author,
+ (piwb->kind == svn_wc__db_kind_symlink)
+ ? piwb->target : NULL));
- if (SVN_IS_VALID_REVNUM(piwb->changed_rev))
- SVN_ERR(svn_sqlite__bind_int64(stmt_node, 7, piwb->changed_rev));
- if (piwb->changed_date)
- SVN_ERR(svn_sqlite__bind_int64(stmt_node, 8, piwb->changed_date));
- if (piwb->changed_author)
- SVN_ERR(svn_sqlite__bind_text(stmt_node, 9, piwb->changed_author));
- if (piwb->kind == svn_wc__db_kind_dir)
- {
- SVN_ERR(svn_sqlite__bind_text(stmt_node, 10,
- svn_depth_to_word(piwb->depth)));
- }
- else if (piwb->kind == svn_wc__db_kind_file)
+ if (piwb->kind == svn_wc__db_kind_file)
{
- SVN_ERR(svn_sqlite__bind_checksum(stmt_node, 11, piwb->checksum,
+ SVN_ERR(svn_sqlite__bind_checksum(stmt_node, 14, piwb->checksum,
scratch_pool));
}
else if (piwb->kind == svn_wc__db_kind_symlink)
{
/* Note: incomplete nodes may have a NULL target. */
if (piwb->target)
- SVN_ERR(svn_sqlite__bind_text(stmt_node, 12, piwb->target));
+ SVN_ERR(svn_sqlite__bind_text(stmt_node, 19, piwb->target));
}
if (piwb->original_repos_relpath != NULL)
{
- SVN_ERR(svn_sqlite__bind_int64(stmt_node, 13, piwb->original_repos_id));
- SVN_ERR(svn_sqlite__bind_text(stmt_node, 14,
+ SVN_ERR(svn_sqlite__bind_int64(stmt_node, 5, piwb->original_repos_id));
+ SVN_ERR(svn_sqlite__bind_text(stmt_node, 6,
piwb->original_repos_relpath));
- SVN_ERR(svn_sqlite__bind_int64(stmt_node, 15, piwb->original_revnum));
+ SVN_ERR(svn_sqlite__bind_int64(stmt_node, 7, piwb->original_revnum));
}
- /* Don't bind original_repos_id, original_repos_path and original_revision */
-
-
- SVN_ERR(svn_sqlite__bind_properties(stmt_node, 16, piwb->props,
+ SVN_ERR(svn_sqlite__bind_properties(stmt_node, 15, piwb->props,
scratch_pool));
SVN_ERR(svn_sqlite__insert(NULL, stmt_node));
@@ -1393,11 +1379,6 @@ create_db(svn_sqlite__db_t **sdb,
/* Create the database's schema. */
SVN_ERR(svn_sqlite__exec_statements(*sdb, STMT_CREATE_SCHEMA));
-#ifdef SVN_WC__NODE_DATA
- /* Create the NODE_DATA table for the experimental schema */
- SVN_ERR(svn_sqlite__exec_statements(*sdb, STMT_CREATE_NODE_DATA));
-#endif
-
#ifdef SVN_WC__NODES
/* Create the NODES table for the experimental schema */
SVN_ERR(svn_sqlite__exec_statements(*sdb, STMT_CREATE_NODES));
@@ -1919,15 +1900,17 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
scratch_pool, scratch_pool));
VERIFY_USABLE_PDH(pdh);
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
STMT_DELETE_BASE_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
- STMT_DELETE_NODE_DATA_BASE));
+ STMT_DELETE_BASE_NODE_1));
SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
@@ -3216,6 +3199,7 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
const char *dst_parent_relpath = svn_relpath_dirname(dst_relpath,
scratch_pool);
+#ifndef SVN_WC__NODES_ONLY
if (have_work)
SVN_ERR(svn_sqlite__get_statement(&stmt, src_pdh->wcroot->sdb,
STMT_INSERT_WORKING_NODE_COPY_FROM_WORKING));
@@ -3235,17 +3219,18 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
SVN_ERR(svn_sqlite__bind_int64(stmt, 8, copyfrom_rev));
}
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
if (have_work)
SVN_ERR(svn_sqlite__get_statement(&stmt, src_pdh->wcroot->sdb,
- STMT_INSERT_WORKING_NODE_DATA_COPY_FROM_WORKING_1));
+ STMT_INSERT_WORKING_NODE_COPY_FROM_WORKING_1));
else
SVN_ERR(svn_sqlite__get_statement(&stmt, src_pdh->wcroot->sdb,
- STMT_INSERT_WORKING_NODE_DATA_COPY_FROM_BASE_1));
+ STMT_INSERT_WORKING_NODE_COPY_FROM_BASE_1));
- SVN_ERR(svn_sqlite__bindf(stmt, "issist",
+ SVN_ERR(svn_sqlite__bindf(stmt, "issisnnnt",
src_pdh->wcroot->wc_id, src_relpath,
dst_relpath,
(children == NULL) ? (apr_int64_t)2 :
@@ -3255,28 +3240,12 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
if (copyfrom_relpath)
{
- SVN_ERR(svn_sqlite__bind_int64(stmt, 7, copyfrom_id));
- SVN_ERR(svn_sqlite__bind_text(stmt, 8, copyfrom_relpath));
- SVN_ERR(svn_sqlite__bind_int64(stmt, 9, copyfrom_rev));
+ SVN_ERR(svn_sqlite__bind_int64(stmt, 6, copyfrom_id));
+ SVN_ERR(svn_sqlite__bind_text(stmt, 7, copyfrom_relpath));
+ SVN_ERR(svn_sqlite__bind_int64(stmt, 8, copyfrom_rev));
}
SVN_ERR(svn_sqlite__step_done(stmt));
-#if 0
- /* ### NODE_DATA the section below can only be enabled once we stop
- running STMT_INSERT_WORKING_NODE_COPY_FROM_{BASE,WORKING} above */
- if (have_work)
- SVN_ERR(svn_sqlite__get_statement(&stmt, src_pdh->wcroot->sdb,
- STMT_INSERT_WORKING_NODE_DATA_COPY_FROM_WORKING_2));
- else
- SVN_ERR(svn_sqlite__get_statement(&stmt, src_pdh->wcroot->sdb,
- STMT_INSERT_WORKING_NODE_DATA_COPY_FROM_BASE_2));
-
- SVN_ERR(svn_sqlite__bindf(stmt, "isss",
- src_pdh->wcroot->wc_id, src_relpath,
- dst_relpath, dst_parent_relpath));
-
- SVN_ERR(svn_sqlite__step_done(stmt));
-#endif
#endif
/* ### Copying changelist is OK for a move but what about a copy? */
@@ -3749,15 +3718,20 @@ svn_wc__db_temp_base_set_props(svn_wc__d
const apr_hash_t *props,
apr_pool_t *scratch_pool)
{
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
SVN_ERR(set_properties(db, local_abspath, props,
- STMT_UPDATE_NODE_DATA_BASE_PROPS,
+ STMT_UPDATE_NODE_BASE_PROPS,
"base node", scratch_pool));
#endif
+
+#ifndef SVN_WC__NODES_ONLY
return svn_error_return(set_properties(db, local_abspath, props,
STMT_UPDATE_BASE_PROPS,
"base_node",
scratch_pool));
+#else
+ return SVN_NO_ERROR;
+#endif
}
@@ -3767,15 +3741,20 @@ svn_wc__db_temp_working_set_props(svn_wc
const apr_hash_t *props,
apr_pool_t *scratch_pool)
{
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
SVN_ERR(set_properties(db, local_abspath, props,
- STMT_UPDATE_NODE_DATA_WORKING_PROPS,
+ STMT_UPDATE_NODE_WORKING_PROPS,
"working node", scratch_pool));
#endif
+
+#ifndef SVN_WC__NODES_ONLY
return svn_error_return(set_properties(db, local_abspath, props,
STMT_UPDATE_WORKING_PROPS,
"working_node",
scratch_pool));
+#else
+ return SVN_NO_ERROR;
+#endif
}
#endif /* SVN__SUPPORT_BASE_MERGE */
@@ -4195,6 +4174,7 @@ svn_wc__db_temp_op_remove_entry(svn_wc__
sdb = pdh->wcroot->sdb;
wc_id = pdh->wcroot->wc_id;
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_DELETE_BASE_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
@@ -4202,10 +4182,11 @@ svn_wc__db_temp_op_remove_entry(svn_wc__
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_DELETE_WORKING_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
-#ifdef SVN_WC__NODE_DATA
- SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_DELETE_NODE_DATA_LAYERS));
- SVN_ERR(svn_sqlite__bindf(stmt, "isi", wc_id, local_relpath, (apr_int64_t)0));
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_DELETE_NODES));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
#endif
@@ -4236,14 +4217,16 @@ svn_wc__db_temp_op_remove_working(svn_wc
SVN_ERR(flush_entries(db, pdh, local_abspath, scratch_pool));
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
STMT_DELETE_WORKING_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
- STMT_DELETE_NODE_DATA_WORKING));
+ STMT_DELETE_WORKING_NODES));
SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
#endif
@@ -4266,6 +4249,7 @@ update_depth_values(svn_wc__db_t *db,
/* Flush any entries before we start monkeying the database. */
SVN_ERR(flush_entries(db, pdh, local_abspath, scratch_pool));
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
excluded
? STMT_UPDATE_BASE_EXCLUDED
@@ -4274,8 +4258,9 @@ update_depth_values(svn_wc__db_t *db,
if (!excluded)
SVN_ERR(svn_sqlite__bind_text(stmt, 3, svn_depth_to_word(depth)));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
excluded
? STMT_UPDATE_NODE_BASE_EXCLUDED
@@ -4286,6 +4271,7 @@ update_depth_values(svn_wc__db_t *db,
SVN_ERR(svn_sqlite__step_done(stmt));
#endif
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
excluded
? STMT_UPDATE_WORKING_EXCLUDED
@@ -4294,8 +4280,9 @@ update_depth_values(svn_wc__db_t *db,
if (!excluded)
SVN_ERR(svn_sqlite__bind_text(stmt, 3, svn_depth_to_word(depth)));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
excluded
? STMT_UPDATE_NODE_WORKING_EXCLUDED
@@ -4354,13 +4341,15 @@ db_working_update_presence(svn_wc__db_st
scratch_pool, scratch_pool));
VERIFY_USABLE_PDH(pdh);
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
STMT_UPDATE_WORKING_PRESENCE));
SVN_ERR(svn_sqlite__bindf(stmt, "ist", pdh->wcroot->wc_id, local_relpath,
presence_map, status));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
STMT_UPDATE_NODE_WORKING_PRESENCE));
SVN_ERR(svn_sqlite__bindf(stmt, "ist", pdh->wcroot->wc_id, local_relpath,
@@ -4389,14 +4378,16 @@ db_working_actual_remove(svn_wc__db_t *d
VERIFY_USABLE_PDH(pdh);
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
STMT_DELETE_WORKING_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
- STMT_DELETE_NODE_DATA_WORKING));
+ STMT_DELETE_WORKING_NODES));
SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
#endif
@@ -5237,16 +5228,19 @@ relocate_txn(void *baton, svn_sqlite__db
escape_sqlite_like(rb->local_relpath, scratch_pool),
"/%", NULL);
+#ifndef SVN_WC__NODES_ONLY
/* Update non-NULL WORKING_NODE.copyfrom_repos_id. */
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
STMT_UPDATE_WORKING_RECURSIVE_COPYFROM_REPO));
SVN_ERR(svn_sqlite__bindf(stmt, "issi", rb->wc_id, rb->local_relpath,
like_arg, new_repos_id));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
+ /* Set the (base and working) repos_ids and clear the dav_caches */
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
- STMT_UPDATE_NODE_DATA_RECURSIVE_ORIGINAL_REPO));
+ STMT_RECURSIVE_UPDATE_NODE_REPO));
SVN_ERR(svn_sqlite__bindf(stmt, "issii",
rb->wc_id, rb->local_relpath,
like_arg, rb->old_repos_id,
@@ -5258,6 +5252,7 @@ relocate_txn(void *baton, svn_sqlite__db
base_node in the first place. */
if (rb->have_base_node)
{
+#ifndef SVN_WC__NODES_ONLY
/* Purge the DAV cache (wcprops) from any BASE that have 'em. */
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
STMT_CLEAR_BASE_RECURSIVE_DAV_CACHE));
@@ -5271,6 +5266,7 @@ relocate_txn(void *baton, svn_sqlite__db
SVN_ERR(svn_sqlite__bindf(stmt, "issi", rb->wc_id, rb->local_relpath,
like_arg, new_repos_id));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
/* Update any locks for the root or its children. */
if (rb->repos_relpath[0] == 0)
@@ -5540,6 +5536,7 @@ commit_node(void *baton, svn_sqlite__db_
/* ### other presences? or reserve that for separate functions? */
new_presence = svn_wc__db_status_normal;
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, cb->pdh->wcroot->sdb,
STMT_APPLY_CHANGES_TO_BASE));
SVN_ERR(svn_sqlite__bindf(stmt, "issttiisb",
@@ -5569,27 +5566,30 @@ commit_node(void *baton, svn_sqlite__db_
scratch_pool));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
SVN_ERR(svn_sqlite__get_statement(&stmt, cb->pdh->wcroot->sdb,
- STMT_APPLY_CHANGES_TO_BASE_NODE_DATA));
- SVN_ERR(svn_sqlite__bindf(stmt, "issttisb",
+ STMT_APPLY_CHANGES_TO_BASE_NODE));
+ SVN_ERR(svn_sqlite__bindf(stmt, "issisrtstrinsbns",
cb->pdh->wcroot->wc_id, cb->local_relpath,
parent_relpath,
+ cb->repos_id,
+ cb->repos_relpath,
+ cb->new_revision,
presence_map, new_presence,
+ new_depth_str,
kind_map, new_kind,
- (apr_int64_t)cb->changed_rev,
+ cb->changed_rev,
+ cb->changed_date,
cb->changed_author,
- prop_blob.data, prop_blob.len));
+ prop_blob.data, prop_blob.len,
+ cb->new_dav_cache));
- SVN_ERR(svn_sqlite__bind_checksum(stmt, 9, cb->new_checksum,
+ SVN_ERR(svn_sqlite__bind_checksum(stmt, 14, cb->new_checksum,
scratch_pool));
- if (cb->changed_date > 0)
- SVN_ERR(svn_sqlite__bind_int64(stmt, 10, cb->changed_date));
- SVN_ERR(svn_sqlite__bind_text(stmt, 11, new_depth_str));
- /* ### 12. target. */
- SVN_ERR(svn_sqlite__bind_properties(stmt, 12, cb->new_dav_cache,
+ SVN_ERR(svn_sqlite__bind_properties(stmt, 15, cb->new_dav_cache,
scratch_pool));
SVN_ERR(svn_sqlite__step_done(stmt));
@@ -5606,9 +5606,9 @@ commit_node(void *baton, svn_sqlite__db_
cb->pdh->wcroot->wc_id, cb->local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
SVN_ERR(svn_sqlite__get_statement(&stmt, cb->pdh->wcroot->sdb,
- STMT_DELETE_NODE_DATA_WORKING));
+ STMT_DELETE_WORKING_NODES));
SVN_ERR(svn_sqlite__bindf(stmt, "is",
cb->pdh->wcroot->wc_id, cb->local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
@@ -7931,7 +7931,7 @@ svn_wc__db_temp_op_set_base_incomplete(s
svn_sqlite__stmt_t *stmt;
svn_wc__db_pdh_t *pdh;
int affected_rows;
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
int affected_node_rows;
#endif
svn_wc__db_status_t base_status;
@@ -7945,12 +7945,14 @@ svn_wc__db_temp_op_set_base_incomplete(s
SVN_ERR_ASSERT(base_status == svn_wc__db_status_normal ||
base_status == svn_wc__db_status_incomplete);
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(get_statement_for_path(&stmt, db, local_dir_abspath,
STMT_UPDATE_BASE_PRESENCE, scratch_pool));
SVN_ERR(svn_sqlite__bind_text(stmt, 3, incomplete ? "incomplete" : "normal"));
SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
+#endif
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
SVN_ERR(get_statement_for_path(&stmt, db, local_dir_abspath,
STMT_UPDATE_NODE_BASE_PRESENCE, scratch_pool));
SVN_ERR(svn_sqlite__bind_text(stmt, 3, incomplete ? "incomplete" : "normal"));
@@ -8184,6 +8186,8 @@ make_copy_txn(void *baton,
if (remove_working)
{
+
+#ifndef SVN_WC__NODES_ONLY
/* Remove current WORKING_NODE record */
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
STMT_DELETE_WORKING_NODE));
@@ -8191,10 +8195,11 @@ make_copy_txn(void *baton,
mcb->pdh->wcroot->wc_id,
mcb->local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
-#ifdef SVN_WC_NODE_DATA
+#ifdef SVN_WC__NODES
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
- STMT_DELETE_NODE_DATA_WORKING));
+ STMT_DELETE_WORKING_NODES));
SVN_ERR(svn_sqlite__bindf(stmt, "is",
mcb->pdh->wcroot->wc_id,
mcb->local_relpath));
@@ -8206,6 +8211,7 @@ make_copy_txn(void *baton,
{
/* Add a copy of the BASE_NODE to WORKING_NODE */
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(
&stmt, sdb,
STMT_INSERT_WORKING_NODE_NORMAL_FROM_BASE_NODE));
@@ -8215,11 +8221,12 @@ make_copy_txn(void *baton,
mcb->local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
SVN_ERR(svn_sqlite__get_statement(
&stmt, sdb,
- STMT_INSERT_WORKING_NODE_DATA_NORMAL_FROM_BASE_NODE_1));
+ STMT_INSERT_WORKING_NODE_NORMAL_FROM_BASE));
SVN_ERR(svn_sqlite__bindf(stmt, "isi",
mcb->pdh->wcroot->wc_id,
@@ -8227,20 +8234,6 @@ make_copy_txn(void *baton,
(*mcb->local_relpath == '\0') ? 1 : 2));
SVN_ERR(svn_sqlite__step_done(stmt));
-
-#if 0
- /* ### NODE_DATA we can't enable the bit below until we stop
- running STMT_INSERT_WORKING_NODE_NORMAL_FROM_BASE_NODE above */
- SVN_ERR(svn_sqlite__get_statement(
- &stmt, sdb,
- STMT_INSERT_WORKING_NODE_DATA_NORMAL_FROM_BASE_NODE_2));
-
- SVN_ERR(svn_sqlite__bindf(stmt, "is",
- mcb->pdh->wcroot->wc_id,
- mcb->local_relpath));
-
- SVN_ERR(svn_sqlite__step_done(stmt));
-#endif
#endif
}
@@ -8248,6 +8241,7 @@ make_copy_txn(void *baton,
{
/* Add a not present WORKING_NODE */
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(
&stmt, sdb,
STMT_INSERT_WORKING_NODE_NOT_PRESENT_FROM_BASE_NODE));
@@ -8257,13 +8251,12 @@ make_copy_txn(void *baton,
mcb->local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
-
-#ifdef SVN_WC__NODE_DATA
-
+#ifdef SVN_WC__NODES
SVN_ERR(svn_sqlite__get_statement(
&stmt, sdb,
- STMT_INSERT_WORKING_NODE_DATA_NOT_PRESENT_FROM_BASE_NODE_1));
+ STMT_INSERT_WORKING_NODE_NOT_PRESENT_FROM_BASE));
SVN_ERR(svn_sqlite__bindf(stmt, "isi",
mcb->pdh->wcroot->wc_id,
@@ -8271,23 +8264,6 @@ make_copy_txn(void *baton,
(*mcb->local_relpath == '\0') ? 1 : 2));
SVN_ERR(svn_sqlite__step_done(stmt));
-
-#if 0
- /* ### NODE_DATA we can't enable the bit below until we stop
- running STMT_INSERT_WORKING_NODE_NORMAL_FROM_BASE_NODE above */
- SVN_ERR(svn_sqlite__get_statement(
- &stmt, sdb,
- STMT_INSERT_WORKING_NODE_DATA_NOT_PRESENT_FROM_BASE_NODE_2));
-
- SVN_ERR(svn_sqlite__bindf(stmt, "iss",
- mcb->pdh->wcroot->wc_id,
- mcb->local_relpath,
- (*mcb->local_relpath == '\0') ? NULL
- : svn_relpath_dirname(pibb->local_relpath,
- scratch_pool)));
-
- SVN_ERR(svn_sqlite__step_done(stmt));
-#endif
#endif
}
@@ -8322,16 +8298,18 @@ make_copy_txn(void *baton,
/* Remove the BASE_NODE if the caller asked us to do that */
if (mcb->remove_base)
{
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
STMT_DELETE_BASE_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "is",
mcb->pdh->wcroot->wc_id,
mcb->local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
- STMT_DELETE_NODE_DATA_BASE));
+ STMT_DELETE_BASE_NODE_1));
SVN_ERR(svn_sqlite__bindf(stmt, "is",
mcb->pdh->wcroot->wc_id,
mcb->local_relpath));
@@ -8909,6 +8887,7 @@ set_new_dir_to_incomplete_txn(void *bato
SVN_ERR(create_repos_id(&repos_id, dtb->repos_root_url, dtb->repos_uuid,
sdb, scratch_pool));
+#ifndef SVN_WC__NODES_ONLY
/* Delete the working node */
SVN_ERR(svn_sqlite__get_statement(&stmt, dtb->pdh->wcroot->sdb,
STMT_DELETE_WORKING_NODE));
@@ -8922,14 +8901,14 @@ set_new_dir_to_incomplete_txn(void *bato
SVN_ERR(svn_sqlite__bindf(stmt, "is", dtb->pdh->wcroot->wc_id,
dtb->local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
-#ifdef SVN_WC__NODE_DATA
+#ifdef SVN_WC__NODES
/* Delete the base and working node data */
SVN_ERR(svn_sqlite__get_statement(&stmt, dtb->pdh->wcroot->sdb,
- STMT_DELETE_NODE_DATA_LAYERS));
- SVN_ERR(svn_sqlite__bindf(stmt, "isi", dtb->pdh->wcroot->wc_id,
- dtb->local_relpath,
- (apr_int64_t)0));
+ STMT_DELETE_NODES));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", dtb->pdh->wcroot->wc_id,
+ dtb->local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
#endif
@@ -8954,7 +8933,6 @@ set_new_dir_to_incomplete_txn(void *bato
#ifdef SVN_WC__NODES
-
/* Insert the incomplete base node */
SVN_ERR(svn_sqlite__get_statement(&stmt, dtb->pdh->wcroot->sdb,
STMT_INSERT_NODE));
@@ -8976,8 +8954,6 @@ set_new_dir_to_incomplete_txn(void *bato
#endif
-
-
return SVN_NO_ERROR;
}
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db_pdh.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db_pdh.c?rev=995885&r1=995884&r2=995885&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db_pdh.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db_pdh.c Fri Sep 10 17:33:24 2010
@@ -85,52 +85,6 @@ get_old_version(int *version,
return SVN_NO_ERROR;
}
-#ifndef SVN_WC__SINGLE_DB
-/* The filesystem has a directory at LOCAL_RELPATH. Examine the metadata
- to determine if a *file* was supposed to be there.
-
- ### this function is only required for per-dir .svn support. once all
- ### metadata is collected in a single wcroot, then we won't need to
- ### look in subdirs for other metadata. */
-static svn_error_t *
-determine_obstructed_file(svn_boolean_t *obstructed_file,
- const svn_wc__db_wcroot_t *wcroot,
- const char *local_relpath,
- apr_pool_t *scratch_pool)
-{
- svn_sqlite__stmt_t *stmt;
- svn_boolean_t have_row;
-
- SVN_ERR_ASSERT(wcroot->sdb != NULL && wcroot->wc_id != UNKNOWN_WC_ID);
-
- SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
- STMT_SELECT_WORKING_IS_FILE));
- SVN_ERR(svn_sqlite__bindf(stmt, "is",
- wcroot->wc_id,
- local_relpath));
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- if (have_row)
- {
- *obstructed_file = svn_sqlite__column_boolean(stmt, 0);
- }
- else
- {
- SVN_ERR(svn_sqlite__reset(stmt));
-
- SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
- STMT_SELECT_BASE_IS_FILE));
- SVN_ERR(svn_sqlite__bindf(stmt, "is",
- wcroot->wc_id,
- local_relpath));
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- if (have_row)
- *obstructed_file = svn_sqlite__column_boolean(stmt, 0);
- }
-
- return svn_sqlite__reset(stmt);
-}
-#endif
-
/* */
static svn_error_t *
@@ -326,12 +280,10 @@ svn_wc__db_pdh_create_wcroot(svn_wc__db_
(*wcroot)->sdb = sdb;
(*wcroot)->wc_id = wc_id;
(*wcroot)->format = format;
-#ifdef SVN_WC__SINGLE_DB
/* 8 concurrent locks is probably more than a typical wc_ng based svn client
uses. */
(*wcroot)->owned_locks = apr_array_make(result_pool, 8,
sizeof(svn_wc__db_wclock_t));
-#endif
/* SDB will be NULL for pre-NG working copies. We only need to run a
cleanup when the SDB is present. */
@@ -392,7 +344,6 @@ svn_wc__db_pdh_parse_local_abspath(svn_w
const char *build_relpath;
svn_wc__db_pdh_t *found_pdh = NULL;
svn_wc__db_pdh_t *child_pdh;
- svn_boolean_t obstruction_possible = FALSE;
svn_sqlite__db_t *sdb;
svn_boolean_t moved_upwards = FALSE;
svn_boolean_t always_check = FALSE;
@@ -473,14 +424,6 @@ svn_wc__db_pdh_parse_local_abspath(svn_w
/* Start the local_relpath empty. If *this* directory contains the
wc.db, then relpath will be the empty string. */
build_relpath = "";
-
- /* It is possible that LOCAL_ABSPATH was *intended* to be a file,
- but we just found a directory in its place. After we build
- the PDH, then we'll examine the parent to see how it describes
- this particular path.
-
- ### this is only possible with per-dir wc.db databases. */
- obstruction_possible = TRUE;
}
/* LOCAL_ABSPATH refers to a directory at this point. The PDH corresponding
@@ -548,16 +491,6 @@ svn_wc__db_pdh_parse_local_abspath(svn_w
moved_upwards = TRUE;
- /* An obstruction is no longer possible.
-
- Example: we were given "/some/file" and "file" turned out to be
- a directory. We did not find an SDB at "/some/file/.svn/wc.db",
- so we are now going to look at "/some/.svn/wc.db". That SDB will
- contain the correct information for "file".
-
- ### obstruction is only possible with per-dir wc.db databases. */
- obstruction_possible = FALSE;
-
/* Is the parent directory recorded in our hash? */
found_pdh = apr_hash_get(db->dir_data,
local_abspath, APR_HASH_KEY_STRING);
@@ -614,10 +547,6 @@ svn_wc__db_pdh_parse_local_abspath(svn_w
NULL, UNKNOWN_WC_ID, wc_format,
db->auto_upgrade, db->enforce_empty_wq,
db->state_pool, scratch_pool));
-
- /* Don't test for a directory obstructing a versioned file. The wc-1
- code can manage that itself. */
- obstruction_possible = FALSE;
}
{
@@ -631,96 +560,6 @@ svn_wc__db_pdh_parse_local_abspath(svn_w
*local_relpath = svn_relpath_join(dir_relpath, build_relpath, result_pool);
}
- /* Check to see if this (versioned) directory is obstructing what should
- be a file in the parent directory.
-
- ### obstruction is only possible with per-dir wc.db databases. */
- if (obstruction_possible)
- {
- const char *parent_dir;
- svn_wc__db_pdh_t *parent_pdh;
-
- /* We should NOT have moved up a directory. */
- assert(!moved_upwards);
-
- /* Get/make a PDH for the parent. */
- parent_dir = svn_dirent_dirname(local_abspath, scratch_pool);
- parent_pdh = apr_hash_get(db->dir_data, parent_dir, APR_HASH_KEY_STRING);
- if (parent_pdh == NULL || parent_pdh->wcroot == NULL)
- {
- svn_error_t *err = svn_wc__db_util_open_db(&sdb, parent_dir,
- SDB_FILE, smode,
- db->state_pool,
- scratch_pool);
- if (err)
- {
- if (err->apr_err != SVN_ERR_SQLITE_ERROR
- && !APR_STATUS_IS_ENOENT(err->apr_err))
- return svn_error_return(err);
- svn_error_clear(err);
-
- /* No parent, so we're at a wcroot apparently. An obstruction
- is (therefore) not possible. */
- parent_pdh = NULL;
- }
- else
- {
- /* ### construct this according to per-dir semantics. */
- if (parent_pdh == NULL)
- {
- parent_pdh = apr_pcalloc(db->state_pool,
- sizeof(*parent_pdh));
- parent_pdh->local_abspath = apr_pstrdup(db->state_pool,
- parent_dir);
- }
- else
- {
- /* The PDH should have been built correctly (so far). */
- SVN_ERR_ASSERT(strcmp(parent_pdh->local_abspath,
- parent_dir) == 0);
- }
-
- SVN_ERR(svn_wc__db_pdh_create_wcroot(&parent_pdh->wcroot,
- parent_pdh->local_abspath,
- sdb,
- 1 /* ### hack. */,
- FORMAT_FROM_SDB,
- db->auto_upgrade, db->enforce_empty_wq,
- db->state_pool, scratch_pool));
-
- apr_hash_set(db->dir_data,
- parent_pdh->local_abspath, APR_HASH_KEY_STRING,
- parent_pdh);
-
- (*pdh)->parent = parent_pdh;
- }
- }
-
-#ifndef SVN_WC__SINGLE_DB
- if (parent_pdh)
- {
- const char *lookfor_relpath = svn_dirent_basename(local_abspath,
- scratch_pool);
-
- /* Was there supposed to be a file sitting here? */
- SVN_ERR(determine_obstructed_file(&(*pdh)->obstructed_file,
- parent_pdh->wcroot,
- lookfor_relpath,
- scratch_pool));
-
- /* If we determined that a file was supposed to be at the
- LOCAL_ABSPATH requested, then return the PDH and LOCAL_RELPATH
- which describes that file. */
- if ((*pdh)->obstructed_file)
- {
- *pdh = parent_pdh;
- *local_relpath = apr_pstrdup(result_pool, lookfor_relpath);
- return SVN_NO_ERROR;
- }
- }
-#endif
- }
-
/* The PDH is complete. Stash it into DB. */
apr_hash_set(db->dir_data,
(*pdh)->local_abspath, APR_HASH_KEY_STRING,
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/workqueue.c?rev=995885&r1=995884&r2=995885&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/workqueue.c Fri Sep 10 17:33:24 2010
@@ -42,7 +42,6 @@
/* Workqueue operation names. */
#define OP_REVERT "revert"
-#define OP_KILLME "killme"
#define OP_BASE_REMOVE "base-remove"
#define OP_DELETION_POSTCOMMIT "deletion-postcommit"
/* Arguments of OP_POSTCOMMIT:
@@ -187,10 +186,12 @@ run_revert(svn_wc__db_t *db,
svn_wc__db_status_t status;
const char *parent_abspath;
svn_boolean_t conflicted;
+ apr_int64_t val;
/* We need a NUL-terminated path, so copy it out of the skel. */
local_abspath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
- replaced = svn_skel__parse_int(arg1->next, scratch_pool) != 0;
+ SVN_ERR(svn_skel__parse_int(&val, arg1->next, scratch_pool));
+ replaced = (val != 0);
/* magic_changed is extracted further below. */
/* use_commit_times is extracted further below. */
@@ -214,7 +215,8 @@ run_revert(svn_wc__db_t *db,
svn_boolean_t magic_changed;
svn_boolean_t reinstall_working;
- magic_changed = svn_skel__parse_int(arg1->next->next, scratch_pool) != 0;
+ SVN_ERR(svn_skel__parse_int(&val, arg1->next->next, scratch_pool));
+ magic_changed = (val != 0);
/* If there was a magic property change, then we'll reinstall the
working-file to pick up any/all appropriate changes. If there was
@@ -276,8 +278,9 @@ run_revert(svn_wc__db_t *db,
svn_boolean_t use_commit_times;
svn_skel_t *wi_file_install;
- use_commit_times = svn_skel__parse_int(arg1->next->next->next,
- scratch_pool) != 0;
+ SVN_ERR(svn_skel__parse_int(&val, arg1->next->next->next,
+ scratch_pool));
+ use_commit_times = (val != 0);
SVN_ERR(svn_wc__wq_build_file_install(&wi_file_install,
db, local_abspath,
@@ -293,7 +296,6 @@ run_revert(svn_wc__db_t *db,
{
SVN__NOT_IMPLEMENTED();
}
-#ifdef SVN_WC__SINGLE_DB
else if (kind == svn_wc__db_kind_dir)
{
svn_node_kind_t disk_kind;
@@ -302,7 +304,6 @@ run_revert(svn_wc__db_t *db,
if (disk_kind == svn_node_none)
SVN_ERR(svn_io_dir_make(local_abspath, APR_OS_DEFAULT, scratch_pool));
}
-#endif
if (kind == svn_wc__db_kind_dir)
parent_abspath = local_abspath;
@@ -528,132 +529,6 @@ svn_wc__wq_add_revert(svn_boolean_t *wil
}
/* ------------------------------------------------------------------------ */
-#ifndef SVN_WC__SINGLE_DB
-/* OP_KILLME */
-
-/* Process the OP_KILLME work item WORK_ITEM.
- * See svn_wc__wq_add_killme() which generates this work item.
- * Implements (struct work_item_dispatch).func. */
-static svn_error_t *
-run_killme(svn_wc__db_t *db,
- const svn_skel_t *work_item,
- const char *wri_abspath,
- svn_cancel_func_t cancel_func,
- void *cancel_baton,
- apr_pool_t *scratch_pool)
-{
- const svn_skel_t *arg1 = work_item->children->next;
- const char *dir_abspath;
- svn_boolean_t adm_only;
- svn_wc__db_status_t status;
- svn_revnum_t original_revision;
- svn_revnum_t parent_revision;
- const char *repos_relpath;
- const char *repos_root_url;
- const char *repos_uuid;
- svn_error_t *err;
-
- /* We need a NUL-terminated path, so copy it out of the skel. */
- dir_abspath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
- adm_only = svn_skel__parse_int(arg1->next, scratch_pool) != 0;
-
- err = svn_wc__db_base_get_info(&status, NULL, &original_revision,
- NULL, NULL, NULL,
- NULL, NULL, NULL,
- NULL, NULL, NULL,
- NULL, NULL, NULL,
- db, dir_abspath,
- scratch_pool, scratch_pool);
- if (err)
- {
- if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
- return svn_error_return(err);
-
- /* The administrative area in the subdir is gone, and the subdir
- is also removed from its parent's record. */
- svn_error_clear(err);
-
- /* When we removed the directory, if ADM_ONLY was TRUE, then that
- has definitely been done and there is nothing left to do.
-
- If ADM_ONLY was FALSE, then the subdir and its contents were
- removed *before* the administrative was removed. Anything that
- may be left are unversioned nodes. We don't want to do anything
- to those, so we're done for this case, too. */
- return SVN_NO_ERROR;
- }
- if (status == svn_wc__db_status_obstructed)
- {
- /* The subdir's administrative area has already been removed, but
- there was still an entry in the parent. Whatever is in that
- record, it doesn't matter. The subdir has been handled already. */
- return SVN_NO_ERROR;
- }
-
- SVN_ERR(svn_wc__db_read_info(NULL, NULL, &parent_revision,
- NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- db, svn_dirent_dirname(dir_abspath,
- scratch_pool),
- scratch_pool, scratch_pool));
-
- /* Remember the repository this node is associated with. */
- SVN_ERR(svn_wc__db_scan_base_repos(&repos_relpath, &repos_root_url,
- &repos_uuid,
- db, dir_abspath,
- scratch_pool, scratch_pool));
-
- /* Blow away the administrative directories, and possibly the working
- copy tree too. */
- err = svn_wc__internal_remove_from_revision_control(
- db, dir_abspath,
- !adm_only /* destroy_wf */, FALSE /* instant_error */,
- cancel_func, cancel_baton,
- scratch_pool);
- if (err && err->apr_err != SVN_ERR_WC_LEFT_LOCAL_MOD)
- return svn_error_return(err);
- svn_error_clear(err);
-
- /* If revnum of this dir is greater than parent's revnum, then
- recreate 'deleted' entry in parent. */
- if (original_revision > parent_revision)
- {
- SVN_ERR(svn_wc__db_base_add_absent_node(
- db, dir_abspath,
- repos_relpath, repos_root_url, repos_uuid,
- original_revision, svn_wc__db_kind_dir,
- svn_wc__db_status_not_present,
- NULL, NULL,
- scratch_pool));
- }
-
- return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
-svn_wc__wq_add_killme(svn_wc__db_t *db,
- const char *dir_abspath,
- svn_boolean_t adm_only,
- apr_pool_t *scratch_pool)
-{
- svn_skel_t *work_item = svn_skel__make_empty_list(scratch_pool);
-
- /* The skel still points at DIR_ABSPATH, but the skel will be serialized
- just below in the wq_add call. */
- svn_skel__prepend_int(adm_only, work_item, scratch_pool);
- svn_skel__prepend_str(dir_abspath, work_item, scratch_pool);
- svn_skel__prepend_str(OP_KILLME, work_item, scratch_pool);
-
- SVN_ERR(svn_wc__db_wq_add(db, dir_abspath, work_item, scratch_pool));
-
- return SVN_NO_ERROR;
-}
-#endif
-
-/* ------------------------------------------------------------------------ */
/* OP_REMOVE_BASE */
/* Removes a BASE_NODE and all it's data, leaving any adds and copies as is.
@@ -681,15 +556,7 @@ remove_base_node(svn_wc__db_t *db,
&have_work, NULL, NULL,
db, local_abspath, scratch_pool, scratch_pool));
-#ifndef SVN_WC__SINGLE_DB
- if (!have_base)
- return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
- _("Node '%s' not found."),
- svn_dirent_local_style(local_abspath,
- scratch_pool));
-#else
SVN_ERR_ASSERT(have_base); /* Verified in caller and _base_get_children() */
-#endif
if (wrk_status == svn_wc__db_status_normal
|| wrk_status == svn_wc__db_status_not_present
@@ -734,17 +601,8 @@ remove_base_node(svn_wc__db_t *db,
if (base_status == svn_wc__db_status_normal
&& wrk_status != svn_wc__db_status_added
-#ifndef SVN_WC__SINGLE_DB
- && wrk_status != svn_wc__db_status_obstructed_add
-#endif
&& wrk_status != svn_wc__db_status_excluded)
{
-#ifndef SVN_WC__SINGLE_DB
- if (base_kind == svn_wc__db_kind_dir)
- SVN_ERR(svn_wc__adm_destroy(db, local_abspath, cancel_func, cancel_baton,
- scratch_pool));
-#endif
-
if (wrk_status != svn_wc__db_status_deleted
&& (base_kind == svn_wc__db_kind_file
|| base_kind == svn_wc__db_kind_symlink))
@@ -752,10 +610,7 @@ remove_base_node(svn_wc__db_t *db,
SVN_ERR(svn_io_remove_file2(local_abspath, TRUE, scratch_pool));
}
else if (base_kind == svn_wc__db_kind_dir
-#ifdef SVN_WC__SINGLE_DB
- && wrk_status != svn_wc__db_status_deleted
-#endif
- )
+ && wrk_status != svn_wc__db_status_deleted)
{
svn_error_t *err = svn_io_dir_remove_nonrecursive(local_abspath,
scratch_pool);
@@ -773,9 +628,6 @@ remove_base_node(svn_wc__db_t *db,
SVN_ERR(svn_wc__db_temp_op_remove_entry(db, local_abspath, scratch_pool));
}
else if (wrk_status == svn_wc__db_status_added
-#ifndef SVN_WC__SINGLE_DB
- || wrk_status == svn_wc__db_status_obstructed_add
-#endif
|| (have_work && wrk_status == svn_wc__db_status_excluded))
/* ### deletes of working additions should fall in this case, but
### we can't express these without the 4th tree */
@@ -807,9 +659,11 @@ run_base_remove(svn_wc__db_t *db,
svn_revnum_t revision;
const char *repos_relpath, *repos_root_url, *repos_uuid;
svn_wc__db_kind_t kind;
+ apr_int64_t val;
local_abspath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
- keep_not_present = svn_skel__parse_int(arg1->next, scratch_pool) != 0;
+ SVN_ERR(svn_skel__parse_int(&val, arg1->next, scratch_pool));
+ keep_not_present = (val != 0);
if (keep_not_present)
{
@@ -825,18 +679,6 @@ run_base_remove(svn_wc__db_t *db,
&repos_uuid,
db, local_abspath, scratch_pool,
scratch_pool));
-
-#ifndef SVN_WC__SINGLE_DB
- /* ### When LOCAL_ABSPATH is obstructed, we might not receive a valid
- ### revision here. For the small time that is left until Single-DB
- ### just mark the not-present node as revision 0, as we are not
- ### interested in the revision of not-present nodes anyway.
-
- ### Triggered by update_tests.py 15: issue #919, updates that delete
- */
- if (!SVN_IS_VALID_REVNUM(revision))
- revision = 0;
-#endif
}
SVN_ERR(remove_base_node(db, local_abspath,
@@ -901,13 +743,16 @@ run_deletion_postcommit(svn_wc__db_t *db
svn_revnum_t new_revision;
svn_boolean_t no_unlock;
svn_wc__db_kind_t kind;
+ apr_int64_t val;
/* ### warning: this code has not been vetted for running multiple times */
/* We need a NUL-terminated path, so copy it out of the skel. */
local_abspath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
- new_revision = (svn_revnum_t)svn_skel__parse_int(arg1->next, scratch_pool);
- no_unlock = svn_skel__parse_int(arg1->next->next, scratch_pool) != 0;
+ SVN_ERR(svn_skel__parse_int(&val, arg1->next, scratch_pool));
+ new_revision = (svn_revnum_t)val;
+ SVN_ERR(svn_skel__parse_int(&val, arg1->next->next, scratch_pool));
+ no_unlock = (val != 0);
SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath, FALSE, scratch_pool));
@@ -920,40 +765,6 @@ run_deletion_postcommit(svn_wc__db_t *db
const char *repos_uuid;
svn_revnum_t parent_revision;
-#ifndef SVN_WC__SINGLE_DB
- /* If we are suppose to delete "this dir", drop a 'killme' file
- into my own administrative dir as a signal for svn_wc__run_log()
- to blow away the administrative area after it is finished
- processing this logfile. */
- if (kind == svn_wc__db_kind_dir)
- {
- svn_boolean_t keep_local;
-
- /* Bump the revision number of this_dir anyway, so that it
- might be higher than its parent's revnum. If it's
- higher, then the process that sees KILLME and destroys
- the directory can also place a 'deleted' dir entry in the
- parent. */
- SVN_ERR(svn_wc__db_temp_op_set_rev_and_repos_relpath(db,
- local_abspath,
- new_revision,
- FALSE,
- NULL, NULL,
- NULL, FALSE,
- 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,
- keep_local /* adm_only */,
- scratch_pool));
- }
-#endif
-
/* Get hold of repository info, if we are going to need it,
before deleting the file, */
SVN_ERR(svn_wc__db_base_get_info(NULL, NULL, &parent_revision, NULL,
@@ -1297,11 +1108,7 @@ log_do_committed(svn_wc__db_t *db,
db, child_abspath, iterpool, iterpool));
/* Committing a deletion should remove the local nodes. */
- if (child_status == svn_wc__db_status_deleted
-#ifndef SVN_WC__SINGLE_DB
- || child_status == svn_wc__db_status_obstructed_delete
-#endif
- )
+ if (child_status == svn_wc__db_status_deleted)
{
SVN_ERR(svn_wc__internal_remove_from_revision_control(
db, child_abspath,
@@ -1464,12 +1271,6 @@ log_do_committed(svn_wc__db_t *db,
return SVN_NO_ERROR;
}
-#ifndef SVN_WC__SINGLE_DB
- /* Make sure we have a parent stub in a clean/unmodified state. */
- SVN_ERR(svn_wc__db_temp_set_parent_stub_to_normal(db, local_abspath,
- TRUE, scratch_pool));
-#endif
-
return SVN_NO_ERROR;
}
@@ -1496,10 +1297,13 @@ run_postcommit(svn_wc__db_t *db,
svn_boolean_t keep_changelist, no_unlock;
const char *tmp_text_base_abspath;
svn_error_t *err;
+ apr_int64_t val;
local_abspath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
- new_revision = (svn_revnum_t)svn_skel__parse_int(arg1->next, scratch_pool);
- changed_date = svn_skel__parse_int(arg1->next->next, scratch_pool);
+ SVN_ERR(svn_skel__parse_int(&val, arg1->next, scratch_pool));
+ new_revision = (svn_revnum_t)val;
+ SVN_ERR(svn_skel__parse_int(&val, arg1->next->next, scratch_pool));
+ changed_date = (apr_time_t)val;
if (arg1->next->next->next->len == 0)
changed_author = NULL;
else
@@ -1521,7 +1325,8 @@ run_postcommit(svn_wc__db_t *db,
else
SVN_ERR(svn_skel__parse_proplist(&new_dav_cache, arg5->next,
scratch_pool));
- keep_changelist = svn_skel__parse_int(arg5->next->next, scratch_pool) != 0;
+ SVN_ERR(svn_skel__parse_int(&val, arg5->next->next, scratch_pool));
+ keep_changelist = (val != 0);
/* Before r927056, this WQ item didn't have this next field. Catch any
* attempt to run this code on a WC having a stale WQ item in it. */
@@ -1534,14 +1339,20 @@ run_postcommit(svn_wc__db_t *db,
arg5->next->next->next->len);
if (arg5->next->next->next->next)
- no_unlock = svn_skel__parse_int(arg5->next->next->next->next,
- scratch_pool) != 0;
+ {
+ SVN_ERR(svn_skel__parse_int(&val, arg5->next->next->next->next,
+ scratch_pool));
+ no_unlock = (val != 0);
+ }
else
no_unlock = TRUE;
if (arg5->next->next->next->next->next)
- changed_rev = svn_skel__parse_int(arg5->next->next->next->next->next,
- scratch_pool);
+ {
+ SVN_ERR(svn_skel__parse_int(&val, arg5->next->next->next->next->next,
+ scratch_pool));
+ changed_rev = (svn_revnum_t)val;
+ }
else
changed_rev = new_revision; /* Behavior before fixing issue #3676 */
@@ -1666,10 +1477,13 @@ run_file_install(svn_wc__db_t *db,
const char *temp_dir_abspath;
svn_stream_t *dst_stream;
const char *dst_abspath;
+ apr_int64_t val;
local_abspath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
- use_commit_times = svn_skel__parse_int(arg1->next, scratch_pool) != 0;
- record_fileinfo = svn_skel__parse_int(arg1->next->next, scratch_pool) != 0;
+ SVN_ERR(svn_skel__parse_int(&val, arg1->next, scratch_pool));
+ use_commit_times = (val != 0);
+ SVN_ERR(svn_skel__parse_int(&val, arg1->next->next, scratch_pool));
+ record_fileinfo = (val != 0);
if (arg4 == NULL)
{
@@ -2145,7 +1959,12 @@ run_record_fileinfo(svn_wc__db_t *db,
local_abspath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
if (arg1->next)
- set_time = svn_skel__parse_int(arg1->next, scratch_pool);
+ {
+ apr_int64_t val;
+
+ SVN_ERR(svn_skel__parse_int(&val, arg1->next, scratch_pool));
+ set_time = (apr_time_t)val;
+ }
if (set_time != 0)
{
@@ -2424,10 +2243,6 @@ static const struct work_item_dispatch d
{ OP_PRISTINE_GET_TRANSLATED, run_pristine_get_translated },
{ OP_POSTUPGRADE, run_postupgrade },
-#ifndef SVN_WC__SINGLE_DB
- { OP_KILLME, run_killme },
-#endif
-
/* Sentinel. */
{ NULL }
};
Modified: subversion/branches/atomic-revprop/subversion/svnserve/cyrus_auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svnserve/cyrus_auth.c?rev=995885&r1=995884&r2=995885&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svnserve/cyrus_auth.c (original)
+++ subversion/branches/atomic-revprop/subversion/svnserve/cyrus_auth.c Fri Sep 10 17:33:24 2010
@@ -297,13 +297,13 @@ svn_error_t *cyrus_auth_request(svn_ra_s
SVN_CONFIG_SECTION_SASL,
SVN_CONFIG_OPTION_MIN_SSF,
"0");
- secprops.min_ssf = atoi(val);
+ SVN_ERR(svn_cstring_atoui(&secprops.min_ssf, val));
svn_config_get(b->cfg, &val,
SVN_CONFIG_SECTION_SASL,
SVN_CONFIG_OPTION_MAX_SSF,
"256");
- secprops.max_ssf = atoi(val);
+ SVN_ERR(svn_cstring_atoui(&secprops.max_ssf, val));
/* Set security properties. */
result = sasl_setprop(sasl_ctx, SASL_SEC_PROPS, &secprops);
Modified: subversion/branches/atomic-revprop/subversion/svnserve/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svnserve/main.c?rev=995885&r1=995884&r2=995885&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svnserve/main.c (original)
+++ subversion/branches/atomic-revprop/subversion/svnserve/main.c Fri Sep 10 17:33:24 2010
@@ -44,11 +44,13 @@
#include "svn_path.h"
#include "svn_opt.h"
#include "svn_repos.h"
+#include "svn_string.h"
#include "svn_fs.h"
#include "svn_version.h"
#include "svn_io.h"
#include "svn_private_config.h"
+#include "private/svn_dep_compat.h"
#include "winservice.h"
#ifdef HAVE_UNISTD_H
@@ -473,7 +475,17 @@ int main(int argc, const char *argv[])
break;
case SVNSERVE_OPT_LISTEN_PORT:
- port = atoi(arg);
+ {
+ apr_uint64_t val;
+
+ err = svn_cstring_strtoui64(&val, arg, 0, APR_UINT16_MAX, 10);
+ if (err)
+ return svn_cmdline_handle_exit_error(
+ svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, err,
+ _("Invalid port '%s'"), arg),
+ pool, "svnserve: ");
+ port = (apr_uint16_t)val;
+ }
break;
case SVNSERVE_OPT_LISTEN_HOST:
Modified: subversion/branches/atomic-revprop/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/cmdline/merge_tests.py?rev=995885&r1=995884&r2=995885&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/atomic-revprop/subversion/tests/cmdline/merge_tests.py Fri Sep 10 17:33:24 2010
@@ -14922,32 +14922,6 @@ def merge_automatic_conflict_resolution(
A_COPY_path)
svntest.actions.run_and_verify_svn(None, None, [],
'revert', '--recursive', wc_dir)
- # Issue #3514 fails here with an error similar to:
- #
- # ..\..\..\subversion\svn\util.c:900: (apr_err=125007)
- #..\..\..\subversion\libsvn_client\merge.c:9408: (apr_err=125007)
- #..\..\..\subversion\libsvn_client\merge.c:8054: (apr_err=125007)
- #..\..\..\subversion\libsvn_client\merge.c:7733: (apr_err=125007)
- #..\..\..\subversion\libsvn_client\merge.c:4870: (apr_err=125007)
- #..\..\..\subversion\libsvn_repos\reporter.c:1266: (apr_err=125007)
- #..\..\..\subversion\libsvn_repos\reporter.c:1197: (apr_err=125007)
- #..\..\..\subversion\libsvn_repos\reporter.c:1135: (apr_err=125007)
- #..\..\..\subversion\libsvn_repos\reporter.c:854: (apr_err=125007)
- #..\..\..\subversion\libsvn_repos\reporter.c:1135: (apr_err=125007)
- #..\..\..\subversion\libsvn_repos\reporter.c:854: (apr_err=125007)
- #..\..\..\subversion\libsvn_repos\reporter.c:1135: (apr_err=125007)
- #..\..\..\subversion\libsvn_client\repos_diff.c:861: (apr_err=125007)
- #..\..\..\subversion\libsvn_client\merge.c:1511: (apr_err=125007)
- #..\..\..\subversion\libsvn_wc\merge.c:1309: (apr_err=125007)
- #..\..\..\subversion\libsvn_wc\merge.c:1252: (apr_err=125007)
- #..\..\..\subversion\libsvn_wc\merge.c:914: (apr_err=125007)
- #..\..\..\subversion\libsvn_wc\merge.c:794: (apr_err=125007)
- #..\..\..\subversion\libsvn_wc\merge.c:460: (apr_err=125007)
- #..\..\..\subversion\libsvn_wc\log.c:921: (apr_err=125007)
- #..\..\..\subversion\libsvn_wc\log.c:878: (apr_err=125007)
- #svn: Path 'C:\DOCUME~1\pburba\LOCALS~1\Temp\tempfile.149.tmp' is not a
- # child of 'C:\SVN\src-trunk\Debug\subversion\tests\cmdline\svn-test-work\
- # working_copies\merge_tests-137\A_COPY\D\H'
svntest.actions.run_and_verify_merge(A_COPY_path, '2', '3',
sbox.repo_url + '/A', None,
expected_output,
@@ -14963,16 +14937,11 @@ def merge_automatic_conflict_resolution(
svntest.actions.run_and_verify_svn(None, None, [],
'revert', '--recursive', wc_dir)
# Test --accept base
- #
- # Make a working change to A_COPY/D/H/psi.
- svntest.main.file_write(psi_COPY_path, "WORKING.\n")
expected_output = wc.State(A_COPY_path, {'D/H/psi' : Item(status='U ')})
expected_elision_output = wc.State(A_COPY_path, {
})
- expected_disk.tweak('D/H/psi', contents="BASE")
+ expected_disk.tweak('D/H/psi', contents="This is the file 'psi'.\n")
expected_status.tweak('D/H/psi', status='M ')
- # Issue #3514 fails here with an error similar to the one above for
- # --accept theirs-full.
svntest.actions.run_and_verify_merge(A_COPY_path, '2', '3',
sbox.repo_url + '/A', None,
expected_output,
@@ -16101,7 +16070,7 @@ test_list = [ None,
copy_then_replace_via_merge,
SkipUnless(record_only_merge,
server_has_mergeinfo),
- XFail(merge_automatic_conflict_resolution),
+ merge_automatic_conflict_resolution,
skipped_files_get_correct_mergeinfo,
committed_case_only_move_and_revert,
merge_into_wc_for_deleted_branch,
Modified: subversion/branches/atomic-revprop/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/cmdline/update_tests.py?rev=995885&r1=995884&r2=995885&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/atomic-revprop/subversion/tests/cmdline/update_tests.py Fri Sep 10 17:33:24 2010
@@ -26,6 +26,7 @@
# General modules
import sys, re, os, subprocess
+import time
# Our testing module
import svntest
@@ -5727,7 +5728,7 @@ def update_with_excluded_subdir(sbox):
def update_with_file_lock_and_keywords_property_set(sbox):
"""update with file lock & keywords property set"""
sbox.build()
-
+
wc_dir = sbox.wc_dir
mu_path = os.path.join(wc_dir, 'A', 'mu')
@@ -5735,7 +5736,10 @@ def update_with_file_lock_and_keywords_p
svntest.main.run_svn(None, 'ps', 'svn:keywords', 'Id', mu_path)
svntest.main.run_svn(None, 'lock', mu_path)
mu_ts_before_update = os.path.getmtime(mu_path)
-
+
+ # Make sure we are at a different timestamp to really notice a mtime change
+ time.sleep(1)
+
# Issue #3471 manifests itself here; The timestamp of 'mu' gets updated
# to the time of the last "svn up".
sbox.simple_update()
Propchange: subversion/branches/atomic-revprop/subversion/tests/libsvn_client/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Sep 10 17:33:24 2010
@@ -2,3 +2,4 @@
client-test
*.lo
test-patch*
+test-wc*
Modified: subversion/branches/atomic-revprop/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/libsvn_wc/db-test.c?rev=995885&r1=995884&r2=995885&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/branches/atomic-revprop/subversion/tests/libsvn_wc/db-test.c Fri Sep 10 17:33:24 2010
@@ -321,9 +321,6 @@ create_fake_wc(const char *subdir, int f
svn_sqlite__db_t *sdb;
const char * const my_statements[] = {
statements[STMT_CREATE_SCHEMA],
-#ifdef SVN_WC__NODE_DATA
- statements[STMT_CREATE_NODE_DATA],
-#endif
#ifdef SVN_WC__NODES
statements[STMT_CREATE_NODES],
#endif
Modified: subversion/branches/atomic-revprop/subversion/tests/libsvn_wc/entries-compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/libsvn_wc/entries-compat.c?rev=995885&r1=995884&r2=995885&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/tests/libsvn_wc/entries-compat.c (original)
+++ subversion/branches/atomic-revprop/subversion/tests/libsvn_wc/entries-compat.c Fri Sep 10 17:33:24 2010
@@ -362,16 +362,16 @@ create_fake_wc(const char *subdir, int f
const char *dirpath;
const char * const my_statements[] = {
statements[STMT_CREATE_SCHEMA],
-#ifdef SVN_WC__NODE_DATA
- statements[STMT_CREATE_NODE_DATA],
+#ifdef SVN_WC__NODES
+ statements[STMT_CREATE_NODES],
#endif
TESTING_DATA,
NULL
};
const char * const M_statements[] = {
statements[STMT_CREATE_SCHEMA],
-#ifdef SVN_WC__NODE_DATA
- statements[STMT_CREATE_NODE_DATA],
+#ifdef SVN_WC__NODES
+ statements[STMT_CREATE_NODES],
#endif
M_TESTING_DATA,
NULL