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 [2/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/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/entries.c?rev=995885&r1=995884&r2=995885&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/entries.c Fri Sep 10 17:33:24 2010
@@ -271,11 +271,7 @@ get_base_info_for_deleted(svn_wc_entry_t
NULL, NULL, NULL, NULL, NULL, NULL,
db, parent_abspath,
scratch_pool, scratch_pool));
- if (parent_status == svn_wc__db_status_added
-#ifndef SVN_WC__SINGLE_DB
- || parent_status == svn_wc__db_status_obstructed_add
-#endif
- )
+ if (parent_status == svn_wc__db_status_added)
SVN_ERR(svn_wc__db_scan_addition(NULL, NULL,
&parent_repos_relpath,
&entry->repos,
@@ -407,11 +403,7 @@ get_base_info_for_deleted(svn_wc_entry_t
NULL, NULL, NULL, NULL, NULL, NULL,
db, parent_abspath,
scratch_pool, scratch_pool));
- if (parent_status == svn_wc__db_status_added
-#ifndef SVN_WC__SINGLE_DB
- || parent_status == svn_wc__db_status_obstructed_add
-#endif
- )
+ if (parent_status == svn_wc__db_status_added)
SVN_ERR(svn_wc__db_scan_addition(&parent_status,
NULL,
NULL, NULL, NULL,
@@ -654,38 +646,12 @@ read_one_entry(const svn_wc_entry_t **ne
entry->incomplete = (status == svn_wc__db_status_incomplete);
}
}
- else if (status == svn_wc__db_status_deleted
-#ifndef SVN_WC__SINGLE_DB
- || status == svn_wc__db_status_obstructed_delete
-#endif
- )
+ else if (status == svn_wc__db_status_deleted)
{
-#ifdef SVN_WC__SINGLE_DB
svn_node_kind_t path_kind;
-#endif
/* ### we don't have to worry about moves, so this is a delete. */
entry->schedule = svn_wc_schedule_delete;
- /* ### keep_local ... ugh. hacky. */
- /* We only read keep_local in the directory itself, because we
- can't rely on the actual record being available in the parent
- stub when the directory is recorded as deleted in the directory
- itself. (This last value is the status that brought us in this
- if block).
-
- This is safe because we will only write this flag in the
- directory itself (see mark_deleted() in adm_ops.c), and also
- because we will never use keep_local in the final version of
- WC-NG. With a central db and central pristine store we can
- remove working copy directories directly. So any left over
- directories after the delete operation are always kept locally.
- */
-#ifndef SVN_WC__SINGLE_DB
- if (*entry->name == '\0')
- SVN_ERR(svn_wc__db_temp_determine_keep_local(&entry->keep_local,
- db, entry_abspath,
- scratch_pool));
-#else
/* If there is still a directory on-disk we keep it, if not it is
already deleted. Simple, isn't it?
@@ -696,13 +662,8 @@ read_one_entry(const svn_wc_entry_t **ne
*/
SVN_ERR(svn_io_check_path(entry_abspath, &path_kind, scratch_pool));
entry->keep_local = (path_kind == svn_node_dir);
-#endif
}
- else if (status == svn_wc__db_status_added
-#ifndef SVN_WC__SINGLE_DB
- || status == svn_wc__db_status_obstructed_add
-#endif
- )
+ else if (status == svn_wc__db_status_added)
{
svn_wc__db_status_t work_status;
const char *op_root_abspath;
@@ -784,18 +745,7 @@ read_one_entry(const svn_wc_entry_t **ne
&& !SVN_IS_VALID_REVNUM(entry->cmt_rev))
entry->revision = 0;
-#ifndef SVN_WC__SINGLE_DB
- if (status == svn_wc__db_status_obstructed_add)
- entry->revision = SVN_INVALID_REVNUM;
-
- /* ### when we're reading a directory that is not present,
- ### then it must be "normal" rather than "add". */
- if (*entry->name == '\0'
- && status == svn_wc__db_status_obstructed_add)
- entry->schedule = svn_wc_schedule_normal;
- else
-#endif
- entry->schedule = svn_wc_schedule_add;
+ entry->schedule = svn_wc_schedule_add;
}
}
@@ -803,15 +753,6 @@ read_one_entry(const svn_wc_entry_t **ne
then we cannot begin a scan for data. The original node may
have important data. Set up stuff to kill that idea off,
and finish up this entry. */
-#ifndef SVN_WC__SINGLE_DB
- if (status == svn_wc__db_status_obstructed_add)
- {
- entry->cmt_rev = SVN_INVALID_REVNUM;
- work_status = svn_wc__db_status_normal;
- scanned_original_relpath = NULL;
- }
- else
-#endif
{
SVN_ERR(svn_wc__db_scan_addition(&work_status,
&op_root_abspath,
@@ -1009,14 +950,6 @@ read_one_entry(const svn_wc_entry_t **ne
entry->schedule = svn_wc_schedule_normal;
entry->deleted = TRUE;
}
-#ifndef SVN_WC__SINGLE_DB
- else if (status == svn_wc__db_status_obstructed)
- {
- /* ### set some values that should (hopefully) let this directory
- ### be usable. */
- entry->revision = SVN_INVALID_REVNUM;
- }
-#endif
else if (status == svn_wc__db_status_absent)
{
entry->absent = TRUE;
@@ -1067,24 +1000,11 @@ read_one_entry(const svn_wc_entry_t **ne
### the last three should probably have an "implied" REPOS_RELPATH
*/
-#ifdef SVN_WC__SINGLE_DB
SVN_ERR_ASSERT(repos_relpath != NULL
|| entry->schedule == svn_wc_schedule_delete
|| status == svn_wc__db_status_not_present
|| status == svn_wc__db_status_absent
- || status == svn_wc__db_status_excluded
- );
-#else
- SVN_ERR_ASSERT(repos_relpath != NULL
- || entry->schedule == svn_wc_schedule_delete
- || status == svn_wc__db_status_obstructed
- || status == svn_wc__db_status_obstructed_add
- || status == svn_wc__db_status_obstructed_delete
- || status == svn_wc__db_status_not_present
- || status == svn_wc__db_status_absent
- || status == svn_wc__db_status_excluded
- );
-#endif
+ || status == svn_wc__db_status_excluded);
if (repos_relpath)
entry->url = svn_path_url_add_component2(entry->repos,
repos_relpath,
@@ -1681,14 +1601,6 @@ insert_base_node(svn_sqlite__db_t *sdb,
SVN_ERR(svn_sqlite__bind_int64(stmt, 7, base_node->revision));
-#ifndef SVN_WC__SINGLE_DB
- /* ### in per-subdir operation, if we're about to write a directory and
- ### it is *not* "this dir", then we're writing a row in the parent
- ### directory about the child. note that in the kind. */
- if (base_node->kind == svn_node_dir && *base_node->local_relpath != '\0')
- SVN_ERR(svn_sqlite__bind_text(stmt, 8, "subdir"));
- else
-#endif
/* ### kind might be "symlink" or "unknown" */
if (base_node->kind == svn_node_none)
SVN_ERR(svn_sqlite__bind_text(stmt, 5, "unknown"));
@@ -1744,14 +1656,6 @@ insert_base_node(svn_sqlite__db_t *sdb,
else if (base_node->presence == svn_wc__db_status_excluded)
SVN_ERR(svn_sqlite__bind_text(stmt, 4, "excluded"));
-#ifndef SVN_WC__SINGLE_DB
- /* ### in per-subdir operation, if we're about to write a directory and
- ### it is *not* "this dir", then we're writing a row in the parent
- ### directory about the child. note that in the kind. */
- if (base_node->kind == svn_node_dir && *base_node->local_relpath != '\0')
- SVN_ERR(svn_sqlite__bind_text(stmt, 5, "subdir"));
- else
-#endif
/* ### kind might be "symlink" or "unknown" */
if (base_node->kind == svn_node_none)
SVN_ERR(svn_sqlite__bind_text(stmt, 5, "unknown"));
@@ -1814,15 +1718,6 @@ insert_working_node(svn_sqlite__db_t *sd
else if (working_node->presence == svn_wc__db_status_excluded)
SVN_ERR(svn_sqlite__bind_text(stmt, 4, "excluded"));
-#ifndef SVN_WC__SINGLE_DB
- /* ### in per-subdir operation, if we're about to write a directory and
- ### it is *not* "this dir", then we're writing a row in the parent
- ### directory about the child. note that in the kind. */
- if (working_node->kind == svn_node_dir
- && *working_node->local_relpath != '\0')
- SVN_ERR(svn_sqlite__bind_text(stmt, 5, "subdir"));
- else
-#endif
if (working_node->kind == svn_node_none)
SVN_ERR(svn_sqlite__bind_text(stmt, 5, "unknown"));
else
@@ -1897,15 +1792,6 @@ insert_working_node(svn_sqlite__db_t *sd
else if (working_node->presence == svn_wc__db_status_excluded)
SVN_ERR(svn_sqlite__bind_text(stmt, 5, "excluded"));
-#ifndef SVN_WC__SINGLE_DB
- /* ### in per-subdir operation, if we're about to write a directory and
- ### it is *not* "this dir", then we're writing a row in the parent
- ### directory about the child. note that in the kind. */
- if (working_node->kind == svn_node_dir
- && *working_node->local_relpath != '\0')
- SVN_ERR(svn_sqlite__bind_text(stmt, 6, "subdir"));
- else
-#endif
if (working_node->kind == svn_node_none)
SVN_ERR(svn_sqlite__bind_text(stmt, 6, "unknown"));
else
@@ -2208,7 +2094,6 @@ write_entry(svn_wc__db_t *db,
{
base_node->kind = entry->kind;
-#ifdef SVN_WC__SINGLE_DB
/* All subdirs are initially incomplete, they stop being
incomplete when the entries file in the subdir is
upgraded and remain incomplete if that doesn't happen. */
@@ -2218,7 +2103,6 @@ write_entry(svn_wc__db_t *db,
base_node->presence = svn_wc__db_status_incomplete;
}
else
-#endif
{
if (entry->incomplete)
@@ -2344,7 +2228,6 @@ write_entry(svn_wc__db_t *db,
svn_checksum_md5,
entry->checksum, scratch_pool));
-#ifdef SVN_WC__SINGLE_DB
/* All subdirs start of incomplete, and stop being incomplete
when the entries file in the subdir is upgraded. */
if (entry->kind == svn_node_dir
@@ -2353,9 +2236,7 @@ write_entry(svn_wc__db_t *db,
working_node->presence = svn_wc__db_status_incomplete;
working_node->kind = svn_node_dir;
}
- else
-#endif
- if (entry->schedule == svn_wc_schedule_delete)
+ else if (entry->schedule == svn_wc_schedule_delete)
{
if (entry->incomplete)
{
@@ -2822,54 +2703,3 @@ svn_wc_walk_entries3(const char *path,
svn_dirent_local_style(local_abspath, pool)),
walk_baton, pool);
}
-
-#ifndef SVN_WC__SINGLE_DB
-svn_error_t *
-svn_wc__temp_mark_missing_not_present(const char *local_abspath,
- svn_wc_context_t *wc_ctx,
- apr_pool_t *scratch_pool)
-{
- svn_wc__db_status_t status;
- svn_wc__db_kind_t kind;
- const char *repos_relpath, *repos_root_url, *repos_uuid;
- svn_revnum_t revision;
-
- SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
- SVN_ERR(svn_wc__db_read_info(&status, &kind, &revision, &repos_relpath,
- &repos_root_url, &repos_uuid, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL,
- wc_ctx->db, local_abspath,
- scratch_pool, scratch_pool));
- if (kind == svn_wc__db_kind_dir
- && status == svn_wc__db_status_obstructed_delete)
- {
- if (!repos_relpath)
- SVN_ERR(svn_wc__db_scan_base_repos(&repos_relpath, &repos_root_url,
- &repos_uuid,
- wc_ctx->db, local_abspath,
- scratch_pool, scratch_pool));
-
- SVN_ERR(svn_wc__db_temp_op_remove_entry(wc_ctx->db, local_abspath,
- scratch_pool));
-
- if (!SVN_IS_VALID_REVNUM(revision))
- revision = 0; /* Just make one up */
-
- SVN_ERR(svn_wc__db_base_add_absent_node(wc_ctx->db, local_abspath,
- repos_relpath, repos_root_url,
- repos_uuid, revision,
- svn_wc__db_kind_dir,
- svn_wc__db_status_not_present,
- NULL, NULL, scratch_pool));
-
- return SVN_NO_ERROR;
- }
-
- return svn_error_createf(SVN_ERR_WC_PATH_FOUND, NULL,
- _("Unexpectedly found '%s': "
- "path is marked 'missing'"),
- svn_dirent_local_style(local_abspath, scratch_pool));
-}
-#endif
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/lock.c?rev=995885&r1=995884&r2=995885&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/lock.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/lock.c Fri Sep 10 17:33:24 2010
@@ -143,7 +143,6 @@ svn_wc__internal_check_wc(int *wc_format
}
}
-#ifdef SVN_WC__SINGLE_DB
if (*wc_format >= SVN_WC__WC_NG_VERSION)
{
svn_wc__db_status_t db_status;
@@ -151,10 +150,9 @@ svn_wc__internal_check_wc(int *wc_format
if (check_path)
{
- /* If a node is not a directory, it is not a working copy directory.
- This allows creating new working copies as a path below an existing
- working copy.
- */
+ /* If a node is not a directory, it is not a working copy
+ directory. This allows creating new working copies as
+ a path below an existing working copy. */
svn_node_kind_t wc_kind;
SVN_ERR(svn_io_check_path(local_abspath, &wc_kind, scratch_pool));
@@ -202,7 +200,6 @@ svn_wc__internal_check_wc(int *wc_format
break;
}
}
-#endif
return SVN_NO_ERROR;
}
@@ -636,17 +633,13 @@ close_single(svn_wc_adm_access_t *adm_ac
otherwise to FALSE (due to obstruction, missing, absence, exclusion,
or a "not-present" child).
- *OBSTRUCTED is set to TRUE when the node is not available because
- it is obstructed/missing, otherwise to FALSE.
-
- KIND and OBSTRUCTED can be NULL.
+ KIND can be NULL.
### note: this function should go away when we move to a single
### adminstrative area. */
static svn_error_t *
adm_available(svn_boolean_t *available,
svn_wc__db_kind_t *kind,
- svn_boolean_t *obstructed,
svn_wc__db_t *db,
const char *local_abspath,
apr_pool_t *scratch_pool)
@@ -662,24 +655,9 @@ adm_available(svn_boolean_t *available,
NULL, NULL, NULL,
db, local_abspath, scratch_pool, scratch_pool));
- if (obstructed)
-#ifndef SVN_WC__SINGLE_DB
- *obstructed = (status == svn_wc__db_status_obstructed ||
- status == svn_wc__db_status_obstructed_add ||
- status == svn_wc__db_status_obstructed_delete);
-#else
- *obstructed = FALSE;
-#endif
-
*available = !(status == svn_wc__db_status_absent
|| status == svn_wc__db_status_excluded
- || status == svn_wc__db_status_not_present
-#ifndef SVN_WC__SINGLE_DB
- || status == svn_wc__db_status_obstructed
- || status == svn_wc__db_status_obstructed_add
- || status == svn_wc__db_status_obstructed_delete
-#endif
- );
+ || status == svn_wc__db_status_not_present);
return SVN_NO_ERROR;
}
@@ -728,7 +706,7 @@ do_open(svn_wc_adm_access_t **adm_access
{
const char *node_abspath;
svn_wc__db_kind_t kind;
- svn_boolean_t available, obstructed;
+ svn_boolean_t available;
const char *name = APR_ARRAY_IDX(children, i, const char *);
svn_pool_clear(iterpool);
@@ -741,7 +719,6 @@ do_open(svn_wc_adm_access_t **adm_access
SVN_ERR(adm_available(&available,
&kind,
- &obstructed,
db,
node_abspath,
scratch_pool));
@@ -761,12 +738,6 @@ do_open(svn_wc_adm_access_t **adm_access
/* node_access has been registered in DB, so we don't need
to do anything with it. */
}
- else if (obstructed)
- {
- svn_wc__db_temp_set_access(lock->db, node_abspath,
- (svn_wc_adm_access_t *)&missing,
- iterpool);
- }
}
}
svn_pool_destroy(iterpool);
@@ -1354,11 +1325,10 @@ open_anchor(svn_wc_adm_access_t **anchor
if (! t_access)
{
- svn_boolean_t available, obstructed;
+ svn_boolean_t available;
svn_wc__db_kind_t kind;
- err = adm_available(&available, &kind, &obstructed,
- db, local_abspath, pool);
+ err = adm_available(&available, &kind, db, local_abspath, pool);
if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
svn_error_clear(err);
@@ -1367,13 +1337,6 @@ open_anchor(svn_wc_adm_access_t **anchor
svn_error_clear(svn_wc_adm_close2(p_access, pool));
return svn_error_return(err);
}
- if (obstructed && kind == svn_wc__db_kind_dir)
- {
- /* Child PATH is missing. */
- svn_wc__db_temp_set_access(db, local_abspath,
- (svn_wc_adm_access_t *)&missing,
- pool);
- }
}
*anchor_access = p_access ? p_access : t_access;
@@ -1581,94 +1544,6 @@ svn_wc__adm_get_db(const svn_wc_adm_acce
return adm_access->db;
}
-#ifndef SVN_WC__SINGLE_DB
-static svn_error_t *
-acquire_locks_recursively(svn_wc_context_t *wc_ctx,
- const char* local_abspath,
- svn_boolean_t lock_root,
- apr_pool_t *scratch_pool)
-{
- svn_wc__db_t *db = wc_ctx->db;
- const apr_array_header_t *children;
- apr_pool_t *iterpool;
- svn_error_t *err;
- int i;
- int format;
-
- iterpool = svn_pool_create(scratch_pool);
-
- SVN_ERR(svn_wc__db_read_children(&children, wc_ctx->db, local_abspath,
- scratch_pool, iterpool));
-
- /* The current lock paradigm is that each directory holds a lock for itself,
- and there are no inherited locks. In the eventual wc-ng paradigm, a
- lock on a directory, would imply a infinite-depth lock on the children.
- But since we aren't quite there yet, we do the infinite locking
- manually (and be sure to release them in svn_wc__release_write_lock(). */
-
- for (i = 0; i < children->nelts; i ++)
- {
- svn_wc__db_kind_t kind;
- const char *child_relpath = APR_ARRAY_IDX(children, i, const char *);
- const char *child_abspath;
-
- svn_pool_clear(iterpool);
- child_abspath = svn_dirent_join(local_abspath, child_relpath, iterpool);
-
- SVN_ERR(svn_wc__db_read_kind(&kind, wc_ctx->db, child_abspath, FALSE,
- iterpool));
- if (kind == svn_wc__db_kind_dir)
- {
- err = acquire_locks_recursively(wc_ctx, child_abspath, FALSE,
- iterpool);
- if (err && err->apr_err == SVN_ERR_WC_LOCKED)
- {
- while(i >= 0)
- {
- svn_error_t *err2;
- svn_pool_clear(iterpool);
- child_relpath = APR_ARRAY_IDX(children, i, const char *);
- child_abspath = svn_dirent_join(local_abspath, child_relpath,
- iterpool);
-
- /* Don't release locks on non-directories as that will
- try to release the lock on the parent directory! */
- err2 = svn_wc__db_read_kind(&kind, wc_ctx->db, child_abspath,
- FALSE, iterpool);
-
- if (!err2 && kind == svn_wc__db_kind_dir)
- err2 = svn_wc__release_write_lock(wc_ctx, child_abspath,
- iterpool);
-
- err = svn_error_compose_create(err, err2);
- --i;
- }
- return svn_error_return(err);
- }
- }
- }
-
- if (lock_root)
- SVN_ERR(svn_wc__db_wclock_obtain(db, local_abspath, 0, FALSE, iterpool));
- else
- {
- /* We don't want to try and lock an unversioned directory that
- obstructs a versioned directory. */
- err = svn_wc__internal_check_wc(&format, wc_ctx->db, local_abspath, FALSE,
- iterpool);
-
- if (!err && format)
- SVN_ERR(svn_wc__db_wclock_obtain(wc_ctx->db, local_abspath, 0, FALSE,
- iterpool));
-
- svn_error_clear(err);
- }
- svn_pool_destroy(iterpool);
-
- return SVN_NO_ERROR;
-}
-#endif
-
svn_error_t *
svn_wc__acquire_write_lock(const char **lock_root_abspath,
svn_wc_context_t *wc_ctx,
@@ -1746,13 +1621,8 @@ svn_wc__acquire_write_lock(const char **
if (lock_root_abspath)
*lock_root_abspath = apr_pstrdup(result_pool, local_abspath);
-#ifndef SVN_WC__SINGLE_DB
- SVN_ERR(acquire_locks_recursively(wc_ctx, local_abspath, TRUE,
- scratch_pool));
-#else
SVN_ERR(svn_wc__db_wclock_obtain(wc_ctx->db, local_abspath, -1, FALSE,
scratch_pool));
-#endif
return SVN_NO_ERROR;
}
@@ -1765,27 +1635,6 @@ svn_wc__release_write_lock(svn_wc_contex
{
apr_uint64_t id;
svn_skel_t *work_item;
-#ifndef SVN_WC__SINGLE_DB
- apr_pool_t *iterpool;
- const apr_array_header_t *children;
- svn_boolean_t locked_here;
- int i;
-#endif
-
-#ifndef SVN_WC__SINGLE_DB
- SVN_ERR(svn_wc__db_wclock_owns_lock(&locked_here, wc_ctx->db, local_abspath,
- TRUE, scratch_pool));
-
- if (!locked_here)
- {
- /* Make wclock_release() check if the node should have been locked,
- like when the node is no wcroot (so can't have a multi-db lock) */
- SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, local_abspath,
- scratch_pool));
-
- return SVN_NO_ERROR;
- }
-#endif
SVN_ERR(svn_wc__db_wq_fetch(&id, &work_item, wc_ctx->db, local_abspath,
scratch_pool, scratch_pool));
@@ -1795,43 +1644,7 @@ svn_wc__release_write_lock(svn_wc_contex
return SVN_NO_ERROR;
}
-#ifndef SVN_WC__SINGLE_DB
- /* We need to recursively remove locks (see comment in
- svn_wc__acquire_write_lock(). */
-
- iterpool = svn_pool_create(scratch_pool);
-
- SVN_ERR(svn_wc__db_read_children(&children, wc_ctx->db, local_abspath,
- scratch_pool, iterpool));
- for (i = 0; i < children->nelts; i ++)
- {
- const char *child_relpath = APR_ARRAY_IDX(children, i, const char *);
- const char *child_abspath;
- svn_wc__db_kind_t kind;
-
- svn_pool_clear(iterpool);
- child_abspath = svn_dirent_join(local_abspath, child_relpath, iterpool);
-
- SVN_ERR(svn_wc__db_read_kind(&kind, wc_ctx->db, child_abspath, FALSE,
- iterpool));
- if (kind == svn_wc__db_kind_dir)
- {
- svn_error_t *err = svn_wc__release_write_lock(wc_ctx, child_abspath, iterpool);
-
- if (err && err->apr_err == SVN_ERR_WC_NOT_LOCKED)
- svn_error_clear(err);
- else
- SVN_ERR(err);
- }
- }
-
- SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, local_abspath, iterpool));
-
- svn_pool_destroy(iterpool);
-
-#else
SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, local_abspath, scratch_pool));
-#endif
return SVN_NO_ERROR;
}
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/node.c?rev=995885&r1=995884&r2=995885&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/node.c Fri Sep 10 17:33:24 2010
@@ -134,12 +134,7 @@ svn_wc__node_get_repos_info(const char *
return SVN_NO_ERROR;
}
- if (scan_added
- && (status == svn_wc__db_status_added
-#ifndef SVN_WC__SINGLE_DB
- || status == svn_wc__db_status_obstructed_add
-#endif
- ))
+ if (scan_added && (status == svn_wc__db_status_added))
{
/* We have an addition. scan_addition() will find the intended
repository location by scanning up the tree. */
@@ -159,12 +154,7 @@ svn_wc__node_get_repos_info(const char *
|| status == svn_wc__db_status_absent
|| status == svn_wc__db_status_excluded
|| status == svn_wc__db_status_not_present
- || (scan_deleted && (status == svn_wc__db_status_deleted))
-#ifndef SVN_WC__SINGLE_DB
- || status == svn_wc__db_status_obstructed
- || (scan_deleted && (status == svn_wc__db_status_obstructed_delete))
-#endif
- ))
+ || (scan_deleted && (status == svn_wc__db_status_deleted))))
{
SVN_ERR(svn_wc__db_scan_base_repos(NULL, repos_root_url, repos_uuid,
wc_ctx->db, local_abspath,
@@ -369,12 +359,7 @@ svn_wc__internal_node_get_url(const char
else if (status == svn_wc__db_status_absent
|| status == svn_wc__db_status_excluded
|| status == svn_wc__db_status_not_present
- || (!have_base
- && (status == svn_wc__db_status_deleted
-#ifndef SVN_WC__SINGLE_DB
- || status == svn_wc__db_status_obstructed_delete
-#endif
- )))
+ || (!have_base && (status == svn_wc__db_status_deleted)))
{
const char *parent_abspath;
@@ -453,12 +438,7 @@ svn_wc__node_get_repos_relpath(const cha
result_pool, scratch_pool));
}
else if (status == svn_wc__db_status_excluded
- || (!have_base
- && (status == svn_wc__db_status_deleted
-#ifndef SVN_WC__SINGLE_DB
- || status == svn_wc__db_status_obstructed_delete
-#endif
- )))
+ || (!have_base && (status == svn_wc__db_status_deleted)))
{
const char *parent_abspath, *name, *parent_relpath;
@@ -578,11 +558,7 @@ svn_wc__internal_get_copyfrom_info(const
*is_copy_target = TRUE;
}
}
- else if ((status == svn_wc__db_status_added
-#ifndef SVN_WC__SINGLE_DB
- || status == svn_wc__db_status_obstructed_add
-#endif
- )
+ else if ((status == svn_wc__db_status_added)
&& (copyfrom_rev || copyfrom_url || copyfrom_root_url
|| copyfrom_repos_relpath))
{
@@ -828,40 +804,11 @@ svn_wc__node_is_status_deleted(svn_boole
wc_ctx->db, local_abspath,
scratch_pool, scratch_pool));
- *is_deleted = (status == svn_wc__db_status_deleted)
-#ifndef SVN_WC__SINGLE_DB
- || (status == svn_wc__db_status_obstructed_delete)
-#endif
- ;
+ *is_deleted = (status == svn_wc__db_status_deleted);
return SVN_NO_ERROR;
}
-#ifndef SVN_WC__SINGLE_DB
-svn_error_t *
-svn_wc__node_is_status_obstructed(svn_boolean_t *is_obstructed,
- svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- apr_pool_t *scratch_pool)
-{
- svn_wc__db_status_t status;
-
- SVN_ERR(svn_wc__db_read_info(&status,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL,
- wc_ctx->db, local_abspath,
- scratch_pool, scratch_pool));
-
- *is_obstructed = (status == svn_wc__db_status_obstructed) ||
- (status == svn_wc__db_status_obstructed_add) ||
- (status == svn_wc__db_status_obstructed_delete);
-
- return SVN_NO_ERROR;
-}
-#endif
-
svn_error_t *
svn_wc__node_is_status_absent(svn_boolean_t *is_absent,
svn_wc_context_t *wc_ctx,
@@ -917,11 +864,7 @@ svn_wc__node_is_added(svn_boolean_t *is_
NULL, NULL,
wc_ctx->db, local_abspath,
scratch_pool, scratch_pool));
- *is_added = (status == svn_wc__db_status_added
-#ifndef SVN_WC__SINGLE_DB
- || status == svn_wc__db_status_obstructed_add
-#endif
- );
+ *is_added = (status == svn_wc__db_status_added);
return SVN_NO_ERROR;
}
@@ -956,11 +899,7 @@ svn_wc__internal_is_replaced(svn_boolean
db, local_abspath,
scratch_pool, scratch_pool));
- *replaced = ((status == svn_wc__db_status_added
-#ifndef SVN_WC__SINGLE_DB
- || status == svn_wc__db_status_obstructed_add
-#endif
- )
+ *replaced = ((status == svn_wc__db_status_added)
&& have_base
&& base_status != svn_wc__db_status_not_present);
@@ -1154,12 +1093,7 @@ svn_wc__node_get_commit_base_rev(svn_rev
wc_ctx->db, parent_abspath,
scratch_pool, scratch_pool));
-#ifndef SVN_WC__SINGLE_DB
- SVN_ERR_ASSERT(parent_status == svn_wc__db_status_added
- || parent_status == svn_wc__db_status_obstructed_add);
-#else
SVN_ERR_ASSERT(parent_status == svn_wc__db_status_added);
-#endif
SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL,
@@ -1308,15 +1242,9 @@ svn_wc__internal_node_get_schedule(svn_w
case svn_wc__db_status_normal:
case svn_wc__db_status_incomplete:
-#ifndef SVN_WC__SINGLE_DB
- case svn_wc__db_status_obstructed:
-#endif
break;
case svn_wc__db_status_deleted:
-#ifndef SVN_WC__SINGLE_DB
- case svn_wc__db_status_obstructed_delete:
-#endif
{
const char *work_del_abspath;
@@ -1345,9 +1273,6 @@ svn_wc__internal_node_get_schedule(svn_w
break;
}
case svn_wc__db_status_added:
-#ifndef SVN_WC__SINGLE_DB
- case svn_wc__db_status_obstructed_add:
-#endif
{
const char *op_root_abspath;
const char *parent_abspath;
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/props.c?rev=995885&r1=995884&r2=995885&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/props.c Fri Sep 10 17:33:24 2010
@@ -1758,28 +1758,6 @@ svn_wc__get_pristine_props(apr_hash_t **
return SVN_NO_ERROR;
}
-#ifndef SVN_WC__SINGLE_DB
- /* The node is obstructed:
-
- - subdir is missing, obstructed by a file, or missing admin area
- - a file is obstructed by a versioned subdir (### not reported)
-
- Thus, properties are not available for this node. Returning NULL
- would indicate "not defined" for its state. For obstructions, we
- cannot *determine* whether properties should be here or not.
-
- ### it would be nice to report an obstruction, rather than simply
- ### PROPERTY_NOT_FOUND. but this is transitional until single-db. */
- if (status == svn_wc__db_status_obstructed_delete
- || status == svn_wc__db_status_obstructed
- || status == svn_wc__db_status_obstructed_add)
- return svn_error_createf(SVN_ERR_PROPERTY_NOT_FOUND, NULL,
- U_("Directory '%s' is missing on disk, so the "
- "properties are not available."),
- svn_dirent_local_style(local_abspath,
- scratch_pool));
-#endif
-
/* status: normal, moved_here, copied, deleted */
/* After the above checks, these pristines should always be present. */
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/revision_status.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/revision_status.c?rev=995885&r1=995884&r2=995885&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/revision_status.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/revision_status.c Fri Sep 10 17:33:24 2010
@@ -83,12 +83,7 @@ analyze_status(const char *local_abspath
return SVN_NO_ERROR;
}
else if (status == svn_wc__db_status_added
- || status == svn_wc__db_status_deleted
-#ifndef SVN_WC__SINGLE_DB
- || status == svn_wc__db_status_obstructed_add
- || status == svn_wc__db_status_obstructed_delete
-#endif
- )
+ || status == svn_wc__db_status_deleted)
{
wb->result->modified = TRUE;
}
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/status.c?rev=995885&r1=995884&r2=995885&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/status.c Fri Sep 10 17:33:24 2010
@@ -362,26 +362,6 @@ assemble_status(svn_wc_status3_t **statu
db, local_abspath,
scratch_pool));
}
-#ifndef SVN_WC__SINGLE_DB
- else if (db_status == svn_wc__db_status_obstructed_delete)
- {
- /* Deleted directories are never reported as missing. */
- if (!dirent)
- node_status = svn_wc_status_deleted;
- else
- node_status = svn_wc_status_obstructed;
- }
- else if (db_status == svn_wc__db_status_obstructed
- || db_status == svn_wc__db_status_obstructed_add)
- {
- /* A present or added directory should be on disk, so it is
- reported missing or obstructed. */
- if (!dirent)
- node_status = svn_wc_status_missing;
- else
- node_status = svn_wc_status_obstructed;
- }
-#else
else if (!dirent || dirent->kind != svn_node_dir)
{
/* A present or added directory should be on disk, so it is
@@ -391,7 +371,6 @@ assemble_status(svn_wc_status3_t **statu
else
node_status = svn_wc_status_obstructed;
}
-#endif
}
else
{
@@ -972,11 +951,7 @@ handle_dir_entry(const struct walk_statu
### TODO: Should we recurse on obstructions anyway?
### (Requires changes to the test suite)
*/
- if (db_kind == svn_wc__db_kind_dir
-#ifndef SVN_WC__SINGLE_DB
- && dirent && dirent->kind == svn_node_dir
-#endif
- )
+ if (db_kind == svn_wc__db_kind_dir)
{
/* Descend only if the subdirectory is a working copy directory (which
we've discovered because we got a THIS_DIR entry. And only descend
@@ -984,13 +959,7 @@ handle_dir_entry(const struct walk_statu
if ((depth == svn_depth_unknown
|| depth == svn_depth_immediates
- || depth == svn_depth_infinity)
-#ifndef SVN_WC__SINGLE_DB
- && status != svn_wc__db_status_obstructed
- && status != svn_wc__db_status_obstructed_add
- && status != svn_wc__db_status_obstructed_delete
-#endif
- )
+ || depth == svn_depth_infinity))
{
SVN_ERR(get_dir_status(wb, local_abspath, NULL, FALSE,
dir_repos_root_url, dir_repos_relpath,
@@ -1139,7 +1108,6 @@ get_dir_status(const struct walk_status_
}
err = svn_io_get_dirents3(&dirents, local_abspath, FALSE, subpool, subpool);
-#ifdef SVN_WC__SINGLE_DB
if (err
&& (APR_STATUS_IS_ENOENT(err->apr_err)
|| SVN__APR_STATUS_IS_ENOTDIR(err->apr_err)))
@@ -1148,7 +1116,6 @@ get_dir_status(const struct walk_status_
dirents = apr_hash_make(subpool);
}
else
-#endif
SVN_ERR(err);
SVN_ERR(svn_wc__db_read_info(&dir_status, NULL, NULL, &dir_repos_relpath,
@@ -1609,10 +1576,6 @@ make_dir_baton(void **dir_baton,
our purposes includes being an external or ignored item). */
if (status_in_parent
&& (status_in_parent->node_status != svn_wc_status_unversioned)
-#ifndef SVN_WC__SINGLE_DB
- && (status_in_parent->node_status != svn_wc_status_missing)
- && (status_in_parent->node_status != svn_wc_status_obstructed)
-#endif
&& (status_in_parent->node_status != svn_wc_status_external)
&& (status_in_parent->node_status != svn_wc_status_ignored)
&& (status_in_parent->kind == svn_node_dir)
@@ -1796,10 +1759,6 @@ handle_statii(struct edit_baton *eb,
/* Now, handle the status. We don't recurse for svn_depth_immediates
because we already have the subdirectories' statii. */
if (status->versioned && status->kind == svn_node_dir
-#ifndef SVN_WC__SINGLE_DB
- && status->node_status != svn_wc_status_obstructed
- && status->node_status != svn_wc_status_missing
-#endif
&& (depth == svn_depth_unknown
|| depth == svn_depth_infinity))
{
@@ -2537,13 +2496,7 @@ internal_status(svn_wc_status3_t **statu
if ((err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
|| node_status == svn_wc__db_status_not_present
|| node_status == svn_wc__db_status_absent
- || node_status == svn_wc__db_status_excluded
-#ifndef SVN_WC__SINGLE_DB
- || node_status == svn_wc__db_status_obstructed
- || node_status == svn_wc__db_status_obstructed_add
- || node_status == svn_wc__db_status_obstructed_delete
-#endif
- )
+ || node_status == svn_wc__db_status_excluded)
{
svn_error_clear(err);
node_kind = svn_wc__db_kind_unknown;
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/wc-metadata.sql
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/wc-metadata.sql?rev=995885&r1=995884&r2=995885&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/wc-metadata.sql Fri Sep 10 17:33:24 2010
@@ -611,135 +611,6 @@ PRAGMA user_version =
-- define: SVN_WC__VERSION
;
-/* ------------------------------------------------------------------------- */
-
-/* The NODE_DATA table describes the way WORKING nodes are layered on top of
- BASE nodes and on top of other WORKING nodes, due to nested tree structure
- changes. The layers are modelled using the "op_depth" column.
-
- Each row in BASE_NODE has an associated row NODE_DATA. Additionally, each
- row in WORKING_NODE has one or more associated rows in NODE_DATA.
-
- This table contains only those data elements which apply to BASE as well as
- all WORKING layers; fields applicable only to the currently visible WORKING
- node or BASE node are located in the WORKING_NODE and BASE_NODE tables.
-
- ### This table is to be integrated into the SCHEMA statement as soon
- the experimental status of NODE_DATA is lifted.
-
- For illustration, with a scenario like this:
-
- # (0)
- svn rm foo
- svn cp ^/moo foo # (1)
- svn rm foo/bar
- touch foo/bar
- svn add foo/bar # (2)
-
- , these are the NODE_DATA for the path foo/bar (before single-db, the
- numbering of op_depth is still a bit different):
-
- (0) BASE_NODE -----> NODE_DATA (op_depth == 0)
- (1) NODE_DATA (op_depth == 1) ( <----_ )
- (2) NODE_DATA (op_depth == 2) <----- WORKING_NODE
-
- 0 is the original data for foo/bar before 'svn rm foo' (if it existed).
- 1 is the data for foo/bar copied in from ^/moo/bar. (There would also be a
- WORKING_NODE for the path foo, with original_* pointing at ^/moo.)
- 2 is the to-be-committed data for foo/bar, created by 'svn add foo/bar'.
-
- An 'svn revert foo/bar' would remove the NODE_DATA of (2) (and possibly
- rewire the WORKING_NODE to represent a child of the operation (1)).
- So foo/bar would be a copy of ^/moo/bar again.
- */
--- STMT_CREATE_NODE_DATA
-CREATE TABLE NODE_DATA (
- wc_id INTEGER NOT NULL REFERENCES WCROOT (id),
- local_relpath TEXT NOT NULL,
- op_depth INTEGER NOT NULL,
-
- /* parent's local_relpath for aggregating children of a given parent.
- this will be "" if the parent is the wcroot. Since a wcroot will
- never have a WORKING node the parent_relpath will never be null. */
- /* ### would be nice to make this column NOT NULL. */
- parent_relpath TEXT,
-
- /* In case 'op_depth' is equal to 0, this is part of the BASE tree; in
- that case, all presence values except 'base-deleted' are allowed.
-
-
- In case 'op_depth' is greater than 0, this is part of a layer of
- working nodes; in that case, the following presence values apply:
-
- Is this node "present" or has it been excluded for some reason?
- Only allowed values: normal, not-present, incomplete, base-deleted.
- (the others do not make sense for the WORKING tree)
-
- normal: this node has been added/copied/moved-here. There may be an
- underlying BASE node at this location, implying this is a replace.
- Scan upwards from here looking for copyfrom or moved_here values
- to detect the type of operation constructing this node.
-
- not-present: the node (or parent) was originally copied or moved-here.
- A subtree of that source has since been deleted. There may be
- underlying BASE node to replace. For a move-here or copy-here, the
- records are simply removed rather than switched to not-present.
- Note this reflects a deletion only. It is not possible move-away
- nodes from the WORKING tree. The purported destination would receive
- a copy from the original source of a copy-here/move-here, or if the
- nodes were plain adds, those nodes would be shifted to that target
- for addition.
-
- incomplete: nodes are being added into the WORKING tree, and the full
- information about this node is not (yet) present.
-
- base-deleted: the underlying BASE node has been marked for deletion due
- to a delete or a move-away (see the moved_to column to determine
- which), and has not been replaced. */
- presence TEXT NOT NULL,
-
- /* the kind of the new node. may be "unknown" if the node is not present. */
- kind TEXT NOT NULL,
-
- /* If this node was moved here or copied here, then the following fields may
- have information about their source node. See BASE_NODE.changed_* for
- more information.
-
- For an added or not-present node, these are null. */
- changed_revision INTEGER,
- changed_date INTEGER, /* an APR date/time (usec since 1970) */
- changed_author TEXT,
-
- /* NULL depth means "default" (typically svn_depth_infinity) */
- /* ### depth on WORKING? seems this is a BASE-only concept. how do
- ### you do "files" on an added-directory? can't really ignore
- ### the subdirs! */
- /* ### maybe a WC-to-WC copy can retain a depth? */
- depth TEXT,
-
- /* The SHA-1 checksum of the pristine text, if this node is a file and was
- moved here or copied here, else NULL. */
- checksum TEXT,
-
- /* for kind==symlink, this specifies the target. */
- symlink_target TEXT,
-
- /* Where this node was copied/moved from. All copyfrom_* fields are set
- only on the root of the operation, and are NULL for all children. */
- original_repos_id INTEGER REFERENCES REPOSITORY (id),
- original_repos_path TEXT,
- original_revision INTEGER,
-
- /* serialized skel of this node's properties. NULL if we
- have no information about the properties (a non-present node). */
- properties BLOB,
-
- PRIMARY KEY (wc_id, local_relpath, op_depth)
-
- );
-
-CREATE INDEX I_NODE_PARENT ON NODE_DATA (wc_id, parent_relpath);
-CREATE INDEX I_NODE_PATH ON NODE_DATA (wc_id, local_relpath);
/* ------------------------------------------------------------------------- */
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/wc-queries.sql?rev=995885&r1=995884&r2=995885&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/wc-queries.sql Fri Sep 10 17:33:24 2010
@@ -86,15 +86,6 @@ insert or replace into nodes (
values (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14,
?15, ?16, ?17, ?18, ?19);
--- STMT_INSERT_NODE_DATA
-insert or replace into node_data (
- wc_id, local_relpath, op_depth, parent_relpath, presence, kind,
- changed_revision, changed_date, changed_author, depth, checksum,
- symlink_target, original_repos_id, original_repos_path,
- original_revision, properties)
-values (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12,
- ?13, ?14, ?15, ?16);
-
-- STMT_INSERT_BASE_NODE_INCOMPLETE
insert or ignore into base_node (
wc_id, local_relpath, parent_relpath, presence, kind, revnum)
@@ -111,11 +102,6 @@ INSERT OR IGNORE INTO WORKING_NODE (
wc_id, local_relpath, parent_relpath, presence, kind)
VALUES (?1, ?2, ?3, 'incomplete', 'unknown');
--- STMT_INSERT_NODE_DATA_INCOMPLETE
-INSERT OR IGNORE INTO NODE_DATA (
- wc_id, local_relpath, op_depth, parent_relpath, presence, kind)
-VALUES (?1, ?2, ?3, ?4, 'incomplete', 'unknown');
-
-- STMT_COUNT_BASE_NODE_CHILDREN
SELECT COUNT(*) FROM BASE_NODE
WHERE wc_id = ?1 AND parent_relpath = ?2;
@@ -156,20 +142,22 @@ where wc_id = ?1 and local_relpath = ?2;
update base_node set properties = ?3
where wc_id = ?1 and local_relpath = ?2;
--- STMT_UPDATE_NODE_DATA_BASE_PROPS
-update node_data set properties = ?3
+-- STMT_UPDATE_NODE_BASE_PROPS
+update nodes set properties = ?3
where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-- STMT_UPDATE_WORKING_PROPS
update working_node set properties = ?3
where wc_id = ?1 and local_relpath = ?2;
--- STMT_UPDATE_NODE_DATA_WORKING_PROPS
-update node_data set properties = ?3
+-- STMT_UPDATE_NODE_WORKING_PROPS
+update nodes set properties = ?3
where wc_id = ?1 and local_relpath = ?2
and op_depth in
- (select max(op_depth) from node_data
- where wc_id = ?1 and local_relpath = ?2);
+ (select op_depth from nodes
+ where wc_id = ?1 and local_relpath = ?2
+ order by op_depth desc
+ limit 1);
-- STMT_UPDATE_ACTUAL_PROPS
update actual_node set properties = ?3
@@ -230,11 +218,11 @@ where copyfrom_repos_id is not null and
(local_relpath = ?2 or
local_relpath like ?3 escape '#');
--- STMT_UPDATE_NODE_DATA_RECURSIVE_ORIGINAL_REPO
-update node_data set original_repos_id = ?5
-where wc_id = ?1 and original_repos_id = ?4 and
- (local_relpath = ?2 or
- local_relpath like ?3 escape '#');
+-- STMT_RECURSIVE_UPDATE_NODE_REPO
+update NODES set repos_id = ?5, dav_cache = null
+where wc_id = ?1 and repos_id = ?4 and
+ (local_relpath = ?2
+ or local_relpath like ?3 escape '#');
-- STMT_UPDATE_LOCK_REPOS_ID
update lock set repos_id = ?4
@@ -299,25 +287,21 @@ VALUES (?1, ?2, ?3, ?4);
delete from base_node
where wc_id = ?1 and local_relpath = ?2;
-/* ### Basically, this query can't exist:
- we can't be deleting BASE nodes while they still have
- associated WORKING nodes;
- at minimum, the op_depth restriction should be removed */
--- STMT_DELETE_NODE_DATA_BASE
-delete from node_data
+-- STMT_DELETE_BASE_NODE_1
+delete from nodes
where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-- STMT_DELETE_WORKING_NODE
delete from working_node
where wc_id = ?1 and local_relpath = ?2;
--- STMT_DELETE_NODE_DATA_WORKING
-delete from node_data
+-- STMT_DELETE_WORKING_NODES
+delete from nodes
where wc_id = ?1 and local_relpath = ?2 and op_depth > 0;
--- STMT_DELETE_NODE_DATA_LAYERS
-delete from node_data
-where wc_id = ?1 and local_relpath = ?2 and op_depth >= ?3;
+-- STMT_DELETE_NODES
+delete from nodes
+where wc_id = ?1 and local_relpath = ?2;
-- STMT_DELETE_ACTUAL_NODE
delete from actual_node
@@ -328,45 +312,47 @@ UPDATE BASE_NODE SET depth = ?3
WHERE wc_id = ?1 AND local_relpath = ?2;
-- STMT_UPDATE_NODE_BASE_DEPTH
-UPDATE NODE_DATA SET depth = ?3
-WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
+update NODES set depth = ?3
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-- STMT_UPDATE_WORKING_DEPTH
UPDATE WORKING_NODE SET depth = ?3
WHERE wc_id = ?1 AND local_relpath = ?2;
-- STMT_UPDATE_NODE_WORKING_DEPTH
-UPDATE NODE_DATA SET depth = ?3
-WHERE wc_id = ?1 AND local_relpath = ?2 AND
- op_depth IN (SELECT MAX(op_depth) FROM NODE_DATA
- WHERE wc_id = ?1 AND local_relpath = ?2);
+update NODES set depth = ?3
+where wc_id = ?1 and local_relpath = ?2 and
+ op_depth in (select op_depth from NODES
+ where wc_id = ?1 and local_relpath = ?2
+ order by op_depth desc
+ limit 1);
-- STMT_UPDATE_BASE_EXCLUDED
UPDATE BASE_NODE SET presence = 'excluded', depth = NULL
WHERE wc_id = ?1 AND local_relpath = ?2;
-- STMT_UPDATE_NODE_BASE_EXCLUDED
-UPDATE NODE_DATA SET presence = 'excluded', depth = NULL
-WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
+update NODES set presence = 'excluded', depth = NULL
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-- STMT_UPDATE_WORKING_EXCLUDED
UPDATE WORKING_NODE SET presence = 'excluded', depth = NULL
WHERE wc_id = ?1 AND local_relpath = ?2;
-- STMT_UPDATE_NODE_WORKING_EXCLUDED
-UPDATE NODE_DATA SET presence = 'excluded', depth = NULL
-WHERE wc_id = ?1 AND local_relpath = ?2 AND
- op_depth IN (SELECT op_depth FROM NODE_DATA
- WHERE wc_id = ?1 AND local_relpath = ?2
- ORDER BY op_depth DECSC
- LIMIT 1);
+update nodes SET presence = 'excluded', depth = NULL
+where wc_id = ?1 and local_relpath = ?2 and
+ op_depth IN (select op_depth from NODES
+ where wc_id = ?1 and local_relpath = ?2
+ order by op_depth DECSC
+ limit 1);
-- STMT_UPDATE_BASE_PRESENCE
update base_node set presence= ?3
where wc_id = ?1 and local_relpath = ?2;
-- STMT_UPDATE_NODE_BASE_PRESENCE
-update node_data set presence = ?3
+update nodes set presence = ?3
where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-- STMT_UPDATE_BASE_PRESENCE_KIND
@@ -382,9 +368,9 @@ update working_node set presence = ?3
where wc_id = ?1 and local_relpath =?2;
-- STMT_UPDATE_NODE_WORKING_PRESENCE
-update node_data set presence = ?3
+update nodes set presence = ?3
where wc_id = ?1 and local_relpath = ?2
- and op_depth in (select op_depth from node_data
+ and op_depth in (select op_depth from nodes
where wc_id = ?1 and local_relpath = ?2
order by op_depth desc
limit 1);
@@ -493,23 +479,19 @@ WHERE wc_id = ?1 AND local_dir_relpath L
/* translated_size and last_mod_time are not mentioned here because they will
be tweaked after the working-file is installed.
### what to do about file_external? */
-/* ### NODE_DATA the fields 'presence', 'kind', 'properties', 'changed_rev',
- 'changed_date', 'changed_author', 'depth', 'symlink_target' - but not:
- 'repos_id', 'repos_relpath', 'dav_cache' - will move to the NODE_DATA
- table, meaning we can't use this query anymore; we need 2, wrapped in a
- transaction. */
INSERT OR REPLACE INTO BASE_NODE (
wc_id, local_relpath, parent_relpath, presence, kind, revnum, changed_rev,
changed_author, properties, repos_id, repos_relpath, checksum, changed_date,
depth, symlink_target, dav_cache)
VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16);
--- STMT_APPLY_CHANGES_TO_BASE_NODE_DATA
-INSERT OR REPLACE INTO NODE_DATA (
- wc_id, local_relpath, op_depth, parent_relpath, presence, kind,
- changed_revision, changed_author, properties, checksum,
- changed_date, depth, symlink_target)
-VALUES (?1, ?2, 0, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12);
+-- STMT_APPLY_CHANGES_TO_BASE_NODE
+insert or replace into NODES (
+ wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
+ revision, presence, depth, kind, changed_revision, changed_date,
+ changed_author, checksum, properties, dav_cache, symlink_target )
+values (?1, ?2, 0,
+ ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16);
-- STMT_INSERT_WORKING_NODE_FROM_BASE_NODE
INSERT INTO WORKING_NODE (
@@ -521,24 +503,16 @@ SELECT wc_id, local_relpath, parent_relp
symlink_target, last_mod_time FROM BASE_NODE
WHERE wc_id = ?1 AND local_relpath = ?2;
--- STMT_INSERT_WORKING_NODE_DATA_FROM_BASE_NODE_1
-/* ### NODE_DATA This statement and the statement below (_2) need to
- be executed in a single transaction */
-INSERT INTO NODE_DATA (
+-- STMT_INSERT_WORKING_NODE_FROM_BASE
+INSERT INTO NODES (
wc_id, local_relpath, op_depth, parent_relpath, presence, kind, checksum,
- changed_revision, changed_date, changed_author, depth, symlink_target )
-SELECT wc_id, local_relpath, ?4 as op_depth, parent_relpath, ?3 AS presence,
- kind, checksum, changed_revision, changed_date,
- changed_author, depth, symlink_target
-FROM NODE_DATA
-WHERE wc_id = ?1 AND local_relpath = ?2 and op_depth = 0;
-
--- STMT_INSERT_WORKING_NODE_DATA_FROM_BASE_NODE_2
-INSERT INTO WORKING_NODE (
- wc_id, local_relpath, parent_relpath, translated_size, last_mod_time )
-SELECT wc_id, local_relpath, parent_relpath, translated_size, last_mod_time
-FROM BASE_NODE
-WHERE wc_id = ?1 AND local_relpath = ?2;
+ changed_revision, changed_date, changed_author, depth, symlink_target,
+ translated_size, last_mod_time, properties)
+SELECT wc_id, local_relpath, ?3 as op_depth, parent_relpath, ?4 as presence,
+ kind, checksum, changed_revision, changed_date, changed_author, depth,
+ symlink_target, translated_size, last_mod_time, properties
+FROM NODES
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;
-- STMT_INSERT_WORKING_NODE_NORMAL_FROM_BASE_NODE
INSERT INTO WORKING_NODE (
@@ -552,30 +526,18 @@ SELECT wc_id, local_relpath, parent_relp
repos_relpath, revnum FROM BASE_NODE
WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_INSERT_WORKING_NODE_DATA_NORMAL_FROM_BASE_NODE_1
-INSERT INTO NODE_DATA (
- wc_id, local_relpath, op_depth, parent_relpath, presence, kind, checksum,
- changed_revision, changed_date, changed_author, depth, symlink_target,
- properties, original_repos_id, original_repos_path, original_revision )
-SELECT n.wc_id, n.local_relpath, ?3 as op_depth, n.parent_relpath, 'normal',
- n.kind,
- n.checksum, n.changed_revision, n.changed_date, n.changed_author, n.depth,
- n.symlink_target, n.properties, b.repos_id as original_repos_id,
- b.repos_relpath as original_repos_relpath, b.revnum as original_revision
-FROM BASE_NODE as b INNER JOIN NODE_DATA as n
- ON b.wc_id = n.wc_id
- AND b.local_relpath = n.local_relpath
- AND n.op_depth = 0
-WHERE n.wc_id = ?1 AND n.local_relpath = ?2;
-
-
--- STMT_INSERT_WORKING_NODE_DATA_NORMAL_FROM_BASE_NODE_2
-INSERT INTO WORKING_NODE (
- wc_id, local_relpath, parent_relpath, translated_size, last_mod_time )
-SELECT wc_id, local_relpath, parent_relpath, translated_size, last_mod_time
-FROM BASE_NODE
-WHERE wc_id = ?1 AND local_relpath = ?2;
+-- STMT_INSERT_WORKING_NODE_NORMAL_FROM_BASE
+insert into NODES (
+ wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
+ revision, presence, depth, kind, changed_revision, changed_date,
+ changed_author, checksum, properties, translated_size, last_mod_time,
+ symlink_target )
+select wc_id, local_relpath, ?3 as op_depth, parent_relpath, repos_id,
+ repos_path, revision, 'normal', depth, kind, changed_revision,
+ changed_date, changed_author, checksum, properties, translated_size,
+ last_mod_time, symlink_target
+from NODES
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-- STMT_INSERT_WORKING_NODE_NOT_PRESENT_FROM_BASE_NODE
@@ -588,26 +550,15 @@ SELECT wc_id, local_relpath, parent_relp
repos_relpath, revnum FROM BASE_NODE
WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_INSERT_WORKING_NODE_DATA_NOT_PRESENT_FROM_BASE_NODE_1
-INSERT INTO NODE_DATA (
- wc_id, local_relpath, op_depth, parent_relpath, presence, kind,
- changed_revision, changed_date, changed_author, original_repos_id,
- original_repos_path, original_revision )
-SELECT wc_id, local_relpath, ?3 as op_depth, parent_relpath, 'not-present',
- kind, changed_rev, changed_date, changed_author, repos_id,
- repos_relpath, revnum
-FROM BASE_NODE as b INNER JOIN NODE_DATA as n
- ON b.local_relpath = n.local_relpath
- AND b.wc_id = n.wc_id
- AND n.op_depth = 0
-WHERE n.wc_id = ?1 AND n.local_relpath = ?2;
-
-
--- STMT_INSERT_WORKING_NODE_DATA_NOT_PRESENT_FROM_BASE_NODE_2
-INSERT INTO WORKING_NODE (
- wc_id, local_relpath, parent_relpath)
-VALUES (?1, ?2, ?3);
+-- STMT_INSERT_WORKING_NODE_NOT_PRESENT_FROM_BASE
+insert into NODES (
+ wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
+ revision, presence, kind, changed_revision, changed_date, changed_author )
+select wc_id, local_relpath, ?3 as op_depth, parent_relpath, repos_id,
+ repos_path, revision, 'not-present', kind, changed_revision,
+ changed_date, changed_author
+from NODES
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-- ### the statement below should be setting copyfrom_revision!
@@ -642,30 +593,18 @@ SELECT wc_id, ?3 AS local_relpath, ?4 AS
?7 AS copyfrom_repos_path, ?8 AS copyfrom_revnum FROM BASE_NODE
WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_INSERT_WORKING_NODE_DATA_COPY_FROM_BASE_1
-INSERT OR REPLACE INTO NODE_DATA (
- wc_id, local_relpath, op_depth, parent_relpath, presence, kind, checksum,
- changed_revision, changed_date, changed_author, depth, symlink_target,
- properties, original_repos_id, original_repos_path, original_revision )
-SELECT n.wc_id, ?3 AS local_relpath, ?4 AS op_depth, ?5 AS parent_relpath,
- ?6 AS presence, n.kind, n.checksum, n.changed_revision, n.changed_date,
- n.changed_author, n.depth, n.symlink_target, n.properties,
- ?7 AS original_repos_id, ?8 AS original_repos_path,
- ?9 AS original_revision
-FROM BASE_NODE AS b INNER JOIN NODE_DATA AS n
- ON b.wc_id = n.wc_id
- AND b.local_relpath = n.local_relpath
- AND n.op_depth = 0
-WHERE n.wc_id = ?1 AND n.local_relpath = ?2;
-
--- STMT_INSERT_WORKING_NODE_DATA_COPY_FROM_BASE_2
-INSERT OR REPLACE INTO WORKING_NODE (
- wc_id, local_relpath, parent_relpath, translated_size, last_mod_time )
-SELECT wc_id, local_relpath, parent_relpath, translated_size, last_mod_time
-FROM BASE_NODE
-WHERE wc_id = ?1 AND local_relpath = ?2;
-
+-- STMT_INSERT_WORKING_NODE_COPY_FROM_BASE_1
+insert or replace into NODES (
+ wc_id, local_relpath, op_depth, parent_relpath, repos_id,
+ repos_path, revision, presence, depth, kind, changed_revision,
+ changed_date, changed_author, checksum, properties, translated_size,
+ last_mod_time, symlink_target )
+select wc_id, ?3 as local_relpath, ?4 as op_depth, ?5 as parent_relpath,
+ ?6 as repos_id, ?7 as repos_path, ?8 as revision, ?9 as presence, depth,
+ kind, changed_revision, changed_date, changed_author, checksum, properties,
+ translated_size, last_mod_time, symlink_target
+from NODES
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-- STMT_INSERT_WORKING_NODE_COPY_FROM_WORKING
INSERT OR REPLACE INTO WORKING_NODE (
@@ -679,33 +618,20 @@ SELECT wc_id, ?3 AS local_relpath, ?4 AS
?7 AS copyfrom_repos_path, ?8 AS copyfrom_revnum FROM WORKING_NODE
WHERE wc_id = ?1 AND local_relpath = ?2;
-
--- STMT_INSERT_WORKING_NODE_DATA_COPY_FROM_WORKING_1
-INSERT OR REPLACE INTO NODE_DATA (
- wc_id, local_relpath, op_depth, parent_relpath, presence, kind, checksum,
- changed_revision, changed_date, changed_author, depth, symlink_target,
- properties, original_repos_id, original_repos_path, original_revision )
-SELECT n.wc_id, ?3 AS local_relpath, ?4 AS op_depth, ?5 AS parent_relpath,
- ?6 AS presence, n.kind, n.checksum, n.changed_revision, n.changed_date,
- n.changed_author, n.depth, n.symlink_target, n.properties,
- ?7 AS original_repos_id, ?8 AS original_repos_path,
- ?9 as original_revision
-FROM WORKING_NODE AS w INNER JOIN NODE_DATA AS n
- ON w.wc_id = n.wc_id
- AND w.local_relpath = n.local_relpath
-WHERE w.wc_id = ?1 AND w.local_relpath = ?2
-ORDER BY n.op_depth
-LIMIT 1;
-
--- STMT_INSERT_WORKING_NODE_DATA_COPY_FROM_WORKING_2
-/* ### there's probably no need to set translated_size and last_mod_time,
- they are probably set again later (after re-expanding the base) */
-INSERT OR REPLACE INTO WORKING_NODE (
- wc_id, local_relpath, parent_relpath, translated_size, last_mod_time )
-SELECT wc_id, ?3 as local_relpath, ?4 as parent_relpath,
- translated_size, last_mod_time
-FROM WORKING_NODE
-WHERE wc_id = ?1 AND local_relpath = ?2;
+-- STMT_INSERT_WORKING_NODE_COPY_FROM_WORKING_1
+insert or replace into NODES (
+ wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
+ revision, presence, depth, kind, changed_revision, changed_date,
+ changed_author, checksum, properties, translated_size, last_mod_time,
+ symlink_target )
+select wc_id, ?3 as local_relpath, ?4 as op_depth, ?5 as parent_relpath,
+ ?6 as repos_id, ?7 as repos_path, ?8 as revision, ?9 as presence, depth,
+ kind, changed_revision, changed_date, changed_author, checksum, properties,
+ translated_size, last_mod_time, symlink_target
+from NODES
+where wc_id = ?1 and local_relpath = ?2
+order by op_depth desc
+limit 1;
-- STMT_INSERT_ACTUAL_NODE_FROM_ACTUAL_NODE
INSERT OR REPLACE INTO ACTUAL_NODE (