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/15 19:29:41 UTC
svn commit: r997409 [2/3] - in /subversion/branches/atomic-revprop: ./
subversion/bindings/javahl/native/ subversion/include/
subversion/libsvn_client/ subversion/libsvn_diff/ subversion/libsvn_fs_fs/
subversion/libsvn_ra_svn/ subversion/libsvn_repos/ ...
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/update_editor.c?rev=997409&r1=997408&r2=997409&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/update_editor.c Wed Sep 15 17:29:39 2010
@@ -461,22 +461,14 @@ node_get_relpath_ignore_errors(svn_wc__d
if (relpath)
return relpath;
- if (status == svn_wc__db_status_added
-#ifndef SVN_WC__SINGLE_DB
- || status == svn_wc__db_status_obstructed_add
-#endif
- )
+ if (status == svn_wc__db_status_added)
{
svn_error_clear(svn_wc__db_scan_addition(NULL, NULL, &relpath, NULL,
NULL, NULL, NULL, NULL, NULL,
db, local_abspath,
result_pool, scratch_pool));
}
- 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)
{
svn_error_clear(svn_wc__db_scan_base_repos(&relpath, NULL, NULL,
db, local_abspath,
@@ -801,52 +793,17 @@ complete_directory(struct edit_baton *eb
svn_wc__db_status_t status;
svn_wc__db_kind_t kind;
svn_revnum_t revnum;
- svn_error_t *err;
svn_pool_clear(iterpool);
node_abspath = svn_dirent_join(local_abspath, name, iterpool);
-#ifndef SVN_WC__SINGLE_DB
- /* ### there is an edge case that we can run into right now: this
- ### dir can have a "subdir" node in the BASE_NODE, but the
- ### actual subdir does NOT have a record.
- ###
- ### in particular, copy_tests 21 and schedule_tests 10 can create
- ### this situation. in short: the subdir is rm'd on the disk, and
- ### a deletion of that directory is committed. a local-add then
- ### reintroduces the directory and metadata (within WORKING).
- ### before or after an update, the parent dir has the "subdir"
- ### BASE_NODE and it is missing in the child. asking for the BASE
- ### won't return status_obstructed since there is a true subdir
- ### there now.
- ###
- ### at some point in the control flow, we should have removed
- ### the "subdir" record. maybe there is a good place to remove
- ### that record (or wait for single-dir). for now, we can correct
- ### it when we detect it. */
-#endif
- err = svn_wc__db_base_get_info(&status, &kind, &revnum,
- NULL, NULL, NULL,
- NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- eb->db, node_abspath,
- iterpool, iterpool);
-#ifdef SVN_WC__SINGLE_DB
- SVN_ERR(err);
-#else
- if (err)
- {
- if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
- return svn_error_return(err);
-
- svn_error_clear(err);
-
- SVN_ERR(svn_wc__db_temp_remove_subdir_record(eb->db, node_abspath,
- iterpool));
- continue;
- }
-#endif
+ SVN_ERR(svn_wc__db_base_get_info(&status, &kind, &revnum,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ eb->db, node_abspath,
+ iterpool, iterpool));
/* ### obsolete comment?
Any entry still marked as deleted (and not schedule add) can now
@@ -886,28 +843,6 @@ complete_directory(struct edit_baton *eb
{
SVN_ERR(svn_wc__db_base_remove(eb->db, node_abspath, iterpool));
}
-#ifndef SVN_WC__SINGLE_DB
- /* In Single-DB mode, administrative data is never reported as missing
- by the adm crawler, and we should always remove nodes using normal
- update handling.
- In !Single-DB mode the nodes should have been re-added by now,
- so we can assume that the repository doesn't know about them. */
- else if (kind == svn_wc__db_kind_dir
- && (status == svn_wc__db_status_obstructed
- || status == svn_wc__db_status_obstructed_delete
- || status == svn_wc__db_status_obstructed_add))
- {
- SVN_ERR(svn_wc__db_temp_op_remove_entry(eb->db, node_abspath,
- iterpool));
-
- do_notification(eb, node_abspath,
- (kind == svn_wc__db_kind_dir)
- ? svn_node_dir
- : svn_node_file,
- svn_wc_notify_update_delete,
- iterpool);
- }
-#endif
}
svn_pool_destroy(iterpool);
@@ -1175,40 +1110,12 @@ prep_directory(struct dir_baton *db,
apr_pool_t *pool)
{
const char *dir_abspath;
-#ifndef SINGLE_DB
- const char *repos_root;
- svn_boolean_t locked_here;
-#endif
dir_abspath = db->local_abspath;
/* Make sure the directory exists. */
SVN_ERR(svn_wc__ensure_directory(dir_abspath, pool));
-#ifndef SINGLE_DB
- /* Use the repository root of the anchor, but only if it actually is an
- ancestor of the URL of this directory. */
- if (svn_uri_is_ancestor(db->edit_baton->repos_root, ancestor_url))
- repos_root = db->edit_baton->repos_root;
- else
- repos_root = NULL;
-
- /* Make sure it's the right working copy, either by creating it so,
- or by checking that it is so already. */
- SVN_ERR(svn_wc__internal_ensure_adm(db->edit_baton->db, dir_abspath,
- ancestor_url, repos_root,
- db->edit_baton->repos_uuid,
- ancestor_revision,
- db->ambient_depth, pool));
-
- SVN_ERR(svn_wc_locked2(&locked_here, NULL, db->edit_baton->wc_ctx,
- dir_abspath, pool));
- if (!locked_here)
- /* Recursive lock release on parent will release this lock. */
- SVN_ERR(svn_wc__acquire_write_lock(NULL, db->edit_baton->wc_ctx,
- dir_abspath, FALSE, pool, pool));
-#endif
-
return SVN_NO_ERROR;
}
@@ -1584,16 +1491,9 @@ create_tree_conflict(svn_wc_conflict_des
result_pool, scratch_pool));
/* This better really be an added status. */
-#ifndef SVN_WC__SINGLE_DB
- SVN_ERR_ASSERT(added_status == svn_wc__db_status_added
- || added_status == svn_wc__db_status_obstructed_add
- || added_status == svn_wc__db_status_copied
- || added_status == svn_wc__db_status_moved_here);
-#else
SVN_ERR_ASSERT(added_status == svn_wc__db_status_added
|| added_status == svn_wc__db_status_copied
|| added_status == svn_wc__db_status_moved_here);
-#endif
}
else if (reason == svn_wc_conflict_reason_unversioned)
{
@@ -1772,9 +1672,6 @@ check_tree_conflict(svn_wc_conflict_desc
switch (status)
{
case svn_wc__db_status_added:
-#ifndef SVN_WC__SINGLE_DB
- case svn_wc__db_status_obstructed_add:
-#endif
case svn_wc__db_status_moved_here:
case svn_wc__db_status_copied:
/* Is it a replace? */
@@ -1815,9 +1712,6 @@ check_tree_conflict(svn_wc_conflict_desc
case svn_wc__db_status_deleted:
-#ifndef SVN_WC__SINGLE_DB
- case svn_wc__db_status_obstructed_delete:
-#endif
/* The node is locally deleted. */
reason = svn_wc_conflict_reason_deleted;
break;
@@ -1829,12 +1723,6 @@ check_tree_conflict(svn_wc_conflict_desc
* So the node exists and is essentially 'normal'. We still need to
* check prop and text mods, and those checks will retrieve the
* missing information (hopefully). */
-#ifndef SVN_WC__SINGLE_DB
- case svn_wc__db_status_obstructed:
- /* Tree-conflicts during update are only concerned with local
- * modifications. We can safely update BASE, disregarding the
- * obstruction. So let's treat this as normal. */
-#endif
case svn_wc__db_status_normal:
if (action == svn_wc_conflict_action_edit)
/* An edit onto a local edit or onto *no* local changes is no
@@ -1858,13 +1746,10 @@ check_tree_conflict(svn_wc_conflict_desc
* but the update editor will not visit the subdirectories
* of a directory that it wants to delete. Therefore, we
* need to start a separate crawl here. */
-#ifndef SVN_WC__SINGLE_DB
- if (status != svn_wc__db_status_obstructed)
-#endif
- SVN_ERR(tree_has_local_mods(&modified, &all_mods_are_deletes,
- eb->db, local_abspath,
- eb->cancel_func, eb->cancel_baton,
- pool));
+ SVN_ERR(tree_has_local_mods(&modified, &all_mods_are_deletes,
+ eb->db, local_abspath,
+ eb->cancel_func, eb->cancel_baton,
+ pool));
break;
default:
@@ -2079,6 +1964,7 @@ do_entry_deletion(struct edit_baton *eb,
svn_boolean_t in_deleted_and_tree_conflicted_subtree,
apr_pool_t *pool)
{
+ svn_wc__db_status_t status;
svn_wc__db_kind_t kind;
svn_boolean_t conflicted;
svn_wc_conflict_description2_t *tree_conflict = NULL;
@@ -2086,9 +1972,9 @@ do_entry_deletion(struct edit_baton *eb,
svn_boolean_t hidden;
svn_skel_t *work_item;
- SVN_ERR(svn_wc__db_read_info(NULL, &kind, NULL, NULL, NULL, NULL, NULL, NULL,
+ SVN_ERR(svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL,
&conflicted, NULL,
eb->db, local_abspath, pool, pool));
@@ -2109,8 +1995,9 @@ do_entry_deletion(struct edit_baton *eb,
/* Receive the remote removal of excluded/absent/not present node.
Do not notify. */
- SVN_ERR(svn_wc__db_node_hidden(&hidden, eb->db, local_abspath, pool));
- if (hidden)
+ if (status == svn_wc__db_status_not_present
+ || status == svn_wc__db_status_excluded
+ || status == svn_wc__db_status_absent)
{
SVN_ERR(svn_wc__db_base_remove(eb->db, local_abspath, pool));
@@ -2562,25 +2449,6 @@ add_directory(const char *path,
/* We have a node in WORKING and we've decided not to flag a
* conflict, so merge it with the incoming add. */
db->add_existed = TRUE;
-
-#ifndef SVN_WC__SINGLE_DB
- /* Pre-single-db, a dir that was OS-deleted from the working copy
- * along with its .svn folder is seen 'obstructed' in this code
- * path. The particular situation however better matches the word
- * 'missing'. We do add_existed to avoid spurious errors where other
- * code relies on add_existed to be TRUE when there is a node
- * record (schedule_tests delete_redelete_fudgery used to XFail).
- * Still, let's notify 'A' as the old client did. Ultimately, this
- * should probably say 'Restored' instead of 'A', like with file. */
- if (status == svn_wc__db_status_obstructed
- || status == svn_wc__db_status_obstructed_add
- || status == svn_wc__db_status_obstructed_delete)
- {
- db->already_notified = TRUE;
- do_notification(eb, db->local_abspath, svn_node_dir,
- svn_wc_notify_add, pool);
- }
-#endif
}
}
else if (kind != svn_node_none)
@@ -2640,7 +2508,6 @@ add_directory(const char *path,
}
-#ifdef SINGLE_DB
SVN_ERR(svn_wc__db_temp_op_set_new_dir_to_incomplete(eb->db,
db->local_abspath,
db->new_relpath,
@@ -2649,46 +2516,6 @@ add_directory(const char *path,
*eb->target_revision,
db->ambient_depth,
pool));
-#else
- {
- /* Immediately create an entry for the new directory in the parent.
- Note that the parent must already be either added or opened, and
- thus it's in an 'incomplete' state just like the new dir.
- The entry may already exist if the new directory is already
- scheduled for addition without history, in that case set
- its schedule to normal. */
- SVN_ERR(svn_wc__db_temp_set_parent_stub_to_normal(eb->db,
- db->local_abspath,
- db->add_existed,
- pool));
-
- if (db->add_existed)
- {
- /* Immediately tweak the schedule for "this dir" so it too
- is no longer scheduled for addition. Change rev from 0
- to the target revision allowing prep_directory() to do
- its thing without error.
-
- ### In the future this should probably become a proper
- ### tree conflict and just handled by putting a base
- ### directory below the existing working node.
- */
- SVN_ERR(svn_wc__db_temp_op_set_new_dir_to_incomplete(
- eb->db,
- db->local_abspath,
- db->new_relpath,
- eb->repos_root,
- eb->repos_uuid,
- *eb->target_revision,
- db->ambient_depth,
- pool));
-
- SVN_ERR(svn_wc__db_temp_set_parent_stub_to_normal(eb->db,
- db->local_abspath,
- TRUE, pool));
- }
- }
-#endif
SVN_ERR(prep_directory(db,
svn_path_url_add_component2(eb->repos_root,
@@ -3104,11 +2931,9 @@ close_directory(void *dir_baton,
if (new_changed_author != NULL)
changed_author = new_changed_author;
-#ifdef SVN_WC__SINGLE_DB
/* If no depth is set yet, set to infinity. */
if (depth == svn_depth_unknown)
depth = svn_depth_infinity;
-#endif
/* Do we have new properties to install? Or shall we simply retain
the prior set of properties? If we're installing new properties,
@@ -3926,20 +3751,6 @@ add_file(const char *path,
local_is_file = (wc_kind == svn_wc__db_kind_file
|| wc_kind == svn_wc__db_kind_symlink);
-#ifndef SVN_WC__SINGLE_DB
- /* Is there *something* that is not a file? */
- if (status != svn_wc__db_status_deleted
- && wc_kind == svn_wc__db_kind_dir)
- {
- return svn_error_createf(
- SVN_ERR_WC_OBSTRUCTED_UPDATE, NULL,
- _("Failed to add file '%s': a non-file object "
- "of the same name already exists"),
- svn_dirent_local_style(fb->local_abspath,
- pool));
- }
-#endif
-
if (local_is_file)
{
svn_boolean_t wc_root;
@@ -4597,10 +4408,17 @@ merge_file(svn_skel_t **work_items,
### base, but the rest of libsvn_wc appears to compensate
### for this fact (even tho it is schedule_normal!!).
### in any case, let's do the working copy file install
- ### from the revert base for file externals. */
+ ### from the revert base for file externals.
+
+ ### Sheesh^2: If the file external is based on a copy from
+ ### a different 'related' location we receive copyfrom info
+ ### on the add. And in that specific case (externals_tests
+ ### 25, "update that modifies a file external") we have a
+ ### status normal instead of added. */
if (file_external)
{
- SVN_ERR_ASSERT(status == svn_wc__db_status_added);
+ SVN_ERR_ASSERT(status == svn_wc__db_status_added
+ || status == svn_wc__db_status_normal);
/* The revert-base will be installed later in this function.
To tell the caller to install the new working text from
@@ -5383,14 +5201,11 @@ close_file(void *file_baton,
* If ALLOW_REMOVAL is TRUE the tweaks might cause the node for
* LOCAL_ABSPATH to be removed from the WC; if ALLOW_REMOVAL is FALSE this
* will not happen.
- *
- * ### TODO(SINGLE_DB): Remove the 'parent_stub' argument.
*/
static svn_error_t *
tweak_node(svn_wc__db_t *db,
const char *local_abspath,
svn_wc__db_kind_t kind,
- svn_boolean_t parent_stub,
const char *new_repos_relpath,
const char *new_repos_root_url,
const char *new_repos_uuid,
@@ -5405,10 +5220,6 @@ tweak_node(svn_wc__db_t *db,
svn_boolean_t set_repos_relpath = FALSE;
svn_error_t *err;
-#ifdef SVN_WC__SINGLE_DB
- SVN_ERR_ASSERT(! parent_stub);
-#endif
-
err = svn_wc__db_base_get_info(&status, &db_kind, &revision,
&repos_relpath, &repos_root_url,
&repos_uuid, NULL, NULL, NULL, NULL, NULL,
@@ -5467,19 +5278,13 @@ tweak_node(svn_wc__db_t *db,
new_rev = SVN_INVALID_REVNUM;
if (SVN_IS_VALID_REVNUM(new_rev) || set_repos_relpath)
- {
- svn_boolean_t update_stub =
- (db_kind == svn_wc__db_kind_dir && parent_stub);
-
- SVN_ERR(svn_wc__db_temp_op_set_rev_and_repos_relpath(db, local_abspath,
- new_rev,
- set_repos_relpath,
- new_repos_relpath,
- repos_root_url,
- repos_uuid,
- update_stub,
- scratch_pool));
- }
+ SVN_ERR(svn_wc__db_temp_op_set_rev_and_repos_relpath(db, local_abspath,
+ new_rev,
+ set_repos_relpath,
+ new_repos_relpath,
+ repos_root_url,
+ repos_uuid,
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -5510,7 +5315,7 @@ tweak_entries(svn_wc__db_t *db,
iterpool = svn_pool_create(pool);
/* Tweak "this_dir" */
- SVN_ERR(tweak_node(db, dir_abspath, svn_wc__db_kind_dir, FALSE,
+ SVN_ERR(tweak_node(db, dir_abspath, svn_wc__db_kind_dir,
new_repos_relpath, new_repos_root_url, new_repos_uuid,
new_rev, FALSE /* allow_removal */, iterpool));
@@ -5562,18 +5367,10 @@ tweak_entries(svn_wc__db_t *db,
|| status == svn_wc__db_status_absent
|| status == svn_wc__db_status_excluded)
{
-#ifndef SVN_WC__SINGLE_DB
- if (kind == svn_wc__db_kind_dir)
- SVN_ERR(tweak_node(db, child_abspath, svn_wc__db_kind_dir, TRUE,
- child_repos_relpath, new_repos_root_url,
- new_repos_uuid, new_rev,
- TRUE /* allow_removal */, iterpool));
- else
-#endif
- SVN_ERR(tweak_node(db, child_abspath, kind, FALSE,
- child_repos_relpath, new_repos_root_url,
- new_repos_uuid, new_rev,
- TRUE /* allow_removal */, iterpool));
+ SVN_ERR(tweak_node(db, child_abspath, kind,
+ child_repos_relpath, new_repos_root_url,
+ new_repos_uuid, new_rev,
+ TRUE /* allow_removal */, iterpool));
}
/* If a directory and recursive... */
@@ -5586,47 +5383,11 @@ tweak_entries(svn_wc__db_t *db,
if (depth == svn_depth_immediates)
depth_below_here = svn_depth_empty;
-#ifndef SVN_WC__SINGLE_DB
- /* If the directory is 'missing', remove it. This is safe as
- long as this function is only called as a helper to
- svn_wc__do_update_cleanup, since the update will already have
- restored any missing items that it didn't want to delete. */
- if (status == svn_wc__db_status_obstructed_add
- || status == svn_wc__db_status_obstructed)
- {
- SVN_ERR(svn_wc__db_temp_op_remove_entry(db, child_abspath,
- iterpool));
-
- if (notify_func)
- {
- svn_wc_notify_t *notify;
-
- notify = svn_wc_create_notify(child_abspath,
- svn_wc_notify_delete,
- iterpool);
-
- if (kind == svn_wc__db_kind_dir)
- notify->kind = svn_node_dir;
- else if (kind == svn_wc__db_kind_file)
- notify->kind = svn_node_file;
- else
- notify->kind = svn_node_unknown;
-
- notify_func(notify_baton, notify, iterpool);
- }
- }
-
- /* Not missing or hidden, so recurse. */
- else
-#endif
-
- {
- SVN_ERR(tweak_entries(db, child_abspath, child_repos_relpath,
- new_repos_root_url, new_repos_uuid,
- new_rev, notify_func, notify_baton,
- depth_below_here,
- exclude_paths, iterpool));
- }
+ SVN_ERR(tweak_entries(db, child_abspath, child_repos_relpath,
+ new_repos_root_url, new_repos_uuid,
+ new_rev, notify_func, notify_baton,
+ depth_below_here,
+ exclude_paths, iterpool));
}
}
@@ -5707,19 +5468,6 @@ do_update_cleanup(svn_wc__db_t *db,
case svn_wc__db_status_not_present:
return SVN_NO_ERROR;
-#ifndef SVN_WC__SINGLE_DB
- case svn_wc__db_status_obstructed:
- case svn_wc__db_status_obstructed_add:
- case svn_wc__db_status_obstructed_delete:
- /* There is only a parent stub. That's fine... just tweak it
- and avoid directory recursion. */
- SVN_ERR(tweak_node(db, local_abspath, svn_wc__db_kind_dir, TRUE,
- new_repos_relpath, new_repos_root_url,
- new_repos_uuid, new_revision,
- FALSE /* allow_removal */, pool));
- return SVN_NO_ERROR;
-#endif
-
/* Explicitly ignore other statii */
default:
break;
@@ -5728,7 +5476,7 @@ do_update_cleanup(svn_wc__db_t *db,
if (kind == svn_wc__db_kind_file || kind == svn_wc__db_kind_symlink)
{
/* Parent not updated so don't remove PATH entry. */
- SVN_ERR(tweak_node(db, local_abspath, kind, FALSE,
+ SVN_ERR(tweak_node(db, local_abspath, kind,
new_repos_relpath, new_repos_root_url, new_repos_uuid,
new_revision, FALSE /* allow_removal */, pool));
}
@@ -5754,45 +5502,6 @@ close_edit(void *edit_baton,
{
struct edit_baton *eb = edit_baton;
-#ifndef SVN_WC__SINGLE_DB
- /* If the explicit target still misses its administrative data, then it
- apparently wasn't re-added by the update process, so we'll
- pretend that the editor deleted the entry. The helper function
- do_entry_deletion() will take care of the necessary steps. */
- if (!eb->target_deleted
- && (*eb->target_basename))
- {
- svn_wc__db_status_t status;
- svn_wc__db_kind_t kind;
- svn_error_t *err;
-
- err = svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- eb->db, eb->target_abspath,
- pool, pool);
-
- if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
- svn_error_clear(err);
- else
- SVN_ERR(err);
-
- if (!err && kind == svn_wc__db_kind_dir
- && (status == svn_wc__db_status_obstructed
- || status == svn_wc__db_status_obstructed_add
- || status == svn_wc__db_status_obstructed_delete))
- {
- /* Still passing NULL for THEIR_URL. A case where THEIR_URL
- * is needed in this call is rare or even non-existant.
- * ### TODO: Construct a proper THEIR_URL anyway. See also
- * NULL handling code in do_entry_deletion(). */
- SVN_ERR(do_entry_deletion(eb, eb->target_abspath, NULL, FALSE,
- pool));
- }
- }
-#endif
-
/* The editor didn't even open the root; we have to take care of
some cleanup stuffs. */
if (! eb->root_opened)
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/upgrade.c?rev=997409&r1=997408&r2=997409&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/upgrade.c Wed Sep 15 17:29:39 2010
@@ -42,6 +42,11 @@
#include "private/svn_sqlite.h"
#include "private/svn_token.h"
+/* WC-1.0 administrative area extensions */
+#define SVN_WC__BASE_EXT ".svn-base" /* for text and prop bases */
+#define SVN_WC__WORK_EXT ".svn-work" /* for working propfiles */
+#define SVN_WC__REVERT_EXT ".svn-revert" /* for reverting a replaced
+ file */
/* Old locations for storing "wcprops" (aka "dav cache"). */
#define WCPROPS_SUBDIR_FOR_FILES "wcprops"
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/util.c?rev=997409&r1=997408&r2=997409&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/util.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/util.c Wed Sep 15 17:29:39 2010
@@ -532,8 +532,7 @@ svn_wc__status2_from_3(svn_wc_status2_t
{
svn_error_t *err;
err= svn_wc__get_entry(&entry, wc_ctx->db, local_abspath, FALSE,
- svn_node_unknown, FALSE, result_pool,
- scratch_pool);
+ svn_node_unknown, result_pool, scratch_pool);
if (err && err->apr_err == SVN_ERR_NODE_UNEXPECTED_KIND)
svn_error_clear(err);
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=997409&r1=997408&r2=997409&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/wc-metadata.sql Wed Sep 15 17:29:39 2010
@@ -99,33 +99,43 @@ Overview of BASE_NODE columns:
- The Node-Rev, Content and Last-Change column groups take one of the
states shown in the table below, according to the 'presence':
+ Has Has Has
'presence' Meaning Node-Rev? Content? Last-Change?
---------- ----------- ----------- -------- ------------
- normal => Present Existing Yes Yes
- incomplete => Incomplete Existing[*] No[*] No
- absent => Unauthz Existing No No
- excluded => Unwanted Existing No No
- not-present => Nonexistent Nonexistent No No
-
- - [*] If presence==incomplete, this node refers to an existing node-rev
- but its Content is not stored. This is intended to be a temporary
- state, during an update. Node-Rev is sometimes specified as just a
- revnum. Sometimes the Content is specified as kind==dir with a depth,
- but in this case there is no guarantee about rows representing the
- children.
+ normal => Present Yes Yes Yes
+ incomplete => Incomplete Yes Partial No ### ?
+ absent => Unauthz Yes No No
+ excluded => Unwanted Yes No No
+ not-present => Nonexistent No No No
+
+ - If presence==incomplete, this node refers to an existing node-rev but
+ its Content is not fully and correctly stored. In particular, if it
+ is a directory, some rows that should represent its children may not
+ exist or may be in the wrong state. This is intended to be a
+ temporary state, e.g. during an update.
+
+ - If presence==absent or ==excluded, this row refers to a node that
+ exists in the repo, but the node is not stored in the WC.
+
+ - If presence==not-present, this row indicates that its parent in the WC
+ is a directory that, in its pristine state, would have a child of this
+ name. However, this child was updated or switched to a node-revision
+ that does not exist. Information about which node-revision it was
+ updated or switched to is lost; only the fact that it is currently not
+ present is remembered.
+
+ - The order of precedence of the negative presence values is:
+ 'excluded' if administratively excluded from the WC, else
+ 'absent' if server doesn't authorize reading the path, else
+ 'not-present' if it does not exist in repo.
Node-Rev columns: (repos_id, repos_relpath, revnum)
- - Always points to the corresponding repository node-rev.
+ - The Node-Rev group points to the corresponding repository node-rev.
- - Points to an existing node-rev, unless presence==not-present in which
- case it points to a nonexistent node-rev.
-
- - ### A comment on 'repos_id' and 'repos_relpath' says they may be null;
- is this true and wanted?
-
- - ### A comment on 'revnum' says, "this could be NULL for non-present
- nodes -- no info"; is this true and wanted?
+ - If not used (as specified by the 'presence' table above), the values
+ are undefined.
+ ### Perhaps we should set them to null to make it clearer.
Content columns: (kind, properties, depth, target, checksum)
---- ---------- ----- ------ --------
@@ -141,7 +151,7 @@ Overview of BASE_NODE columns:
- If kind==dir, the children are represented by the existence of other
BASE_NODE rows. For each immediate child of 'repos_relpath'@'revnum'
- that is included by 'depth', a BASE_NODE row exists with its
+ in the repo, subject to 'depth', a BASE_NODE row exists with its
'local_relpath' being this node's 'local_relpath' plus the child's
basename. (Rows may also exist for additional children which are
outside the scope of 'depth' or do not exist as children of this
@@ -156,8 +166,6 @@ Overview of BASE_NODE columns:
Last-Change columns: (changed_rev, changed_date, changed_author)
- - Last-Change info is present iff presence==normal, otherwise null.
-
- Specifies the revision in which the content was last changed before
Node-Rev, following copies and not counting the copy operation itself
as a change.
@@ -168,6 +176,9 @@ Overview of BASE_NODE columns:
- Includes a copy of the corresponding date and author rev-props.
+ - If not used (as specified by the 'presence' table above), all null.
+ ### Not checked; in practice these columns may have undefined values.
+
Working file status: (translated_size, last_mod_time)
- Present iff kind==file and node has no WORKING_NODE row, otherwise
@@ -187,11 +198,18 @@ Overview of BASE_NODE columns:
(dav_cache)
+ - Content is opaque to libsvn_wc. ### ?
+
+ - Lifetime is managed by the WC: values cleared to null at certain times.
+ ### To be documented.
+
(incomplete_children)
- Obsolete, unused.
(file_external)
+
+ - ### To be obsoleted?
*/
CREATE TABLE BASE_NODE (
@@ -618,6 +636,21 @@ PRAGMA user_version =
BASE nodes and on top of other WORKING nodes, due to nested tree structure
changes. The layers are modelled using the "op_depth" column.
+ An 'operation depth' refers to the number of directory levels down from
+ the WC root at which a tree-change operation (delete, add?, copy, move)
+ was performed. A row's 'op_depth' does NOT refer to the depth of its own
+ 'local_relpath', but rather to the depth of the nearest tree change that
+ affects that node.
+
+ The row with op_depth=0 for any given local relpath represents the "base"
+ node that is created and updated by checkout, update, switch and commit
+ post-processing. The row with the highest op_depth for a particular
+ local_relpath represents the working version. Any rows with intermediate
+ op_depth values are not normally visible to the user but may become
+ visible after reverting local changes.
+
+ ### The following text needs revision
+
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.
@@ -691,14 +724,14 @@ CREATE TABLE NODES (
/* WC state fields */
- /* 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.
+ /* Is this node "present" or has it been excluded for some reason?
+ 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)
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=997409&r1=997408&r2=997409&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/wc-queries.sql Wed Sep 15 17:29:39 2010
@@ -33,6 +33,13 @@ select repos_id, repos_relpath, presence
from base_node
where wc_id = ?1 and local_relpath = ?2;
+-- STMT_SELECT_BASE_NODE_1
+select repos_id, repos_path, presence, kind, revision, checksum,
+ translated_size, changed_revision, changed_date, changed_author, depth,
+ symlink_target, last_mod_time, properties
+from nodes
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
-- STMT_SELECT_BASE_NODE_WITH_LOCK
select base_node.repos_id, base_node.repos_relpath, presence, kind,
revnum, checksum, translated_size, changed_rev, changed_date,
@@ -43,6 +50,16 @@ left outer join lock on base_node.repos_
and base_node.repos_relpath = lock.repos_relpath
where wc_id = ?1 and local_relpath = ?2;
+-- STMT_SELECT_BASE_NODE_WITH_LOCK_1
+select nodes.repos_id, nodes.repos_path, presence, kind, revision,
+ checksum, translated_size, changed_revision, changed_date, changed_author,
+ depth, symlink_target, last_mod_time, properties, lock_token, lock_owner,
+ lock_comment, lock_date
+from nodes
+left outer join lock on nodes.repos_id = lock.repos_id
+ and nodes.repos_path = lock.repos_relpath
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
-- STMT_SELECT_WORKING_NODE
select presence, kind, checksum, translated_size,
changed_rev, changed_date, changed_author, depth, symlink_target,
@@ -181,6 +198,10 @@ values (?1);
update base_node set dav_cache = ?3
where wc_id = ?1 and local_relpath = ?2;
+-- STMT_UPDATE_BASE_NODE_DAV_CACHE
+update nodes set dav_cache = ?3
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
-- STMT_SELECT_BASE_DAV_CACHE
select dav_cache from base_node
where wc_id = ?1 and local_relpath = ?2;
@@ -206,6 +227,12 @@ where dav_cache is not null and wc_id =
(local_relpath = ?2 or
local_relpath like ?3 escape '#');
+-- STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE
+update nodes set dav_cache = null
+where dav_cache is not null and wc_id = ?1 and op_depth = 0 and
+ (local_relpath = ?2 or
+ local_relpath like ?3 escape '#');
+
-- STMT_UPDATE_BASE_RECURSIVE_REPO
update base_node set repos_id = ?4
where repos_id is not null and wc_id = ?1 and
@@ -234,10 +261,22 @@ where repos_id = ?1 and
UPDATE BASE_NODE SET translated_size = ?3, last_mod_time = ?4
WHERE wc_id = ?1 AND local_relpath = ?2;
+-- STMT_UPDATE_BASE_NODE_FILEINFO
+update nodes set translated_size = ?3, last_mod_time = ?4
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
-- STMT_UPDATE_WORKING_FILEINFO
UPDATE WORKING_NODE SET translated_size = ?3, last_mod_time = ?4
WHERE wc_id = ?1 AND local_relpath = ?2;
+-- STMT_UPDATE_WORKING_NODE_FILEINFO
+update nodes set translated_size = ?3, last_mod_time = ?4
+where wc_id = ?1 and local_relpath = ?2
+ and op_depth = (select op_depth from nodes
+ where wc_id = ?1 and local_relpath = ?2
+ order by op_depth desc
+ limit 1);
+
-- STMT_UPDATE_ACTUAL_TREE_CONFLICTS
update actual_node set tree_conflict_data = ?3
where wc_id = ?1 and local_relpath = ?2;
@@ -360,7 +399,7 @@ update base_node set presence = ?3, kind
where wc_id = ?1 and local_relpath = ?2;
-- STMT_UPDATE_NODE_BASE_PRESENCE_KIND
-update node_data set presence = ?3, kind = ?4
+update nodes set presence = ?3, kind = ?4
where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
-- STMT_UPDATE_WORKING_PRESENCE
@@ -379,10 +418,18 @@ where wc_id = ?1 and local_relpath = ?2
update base_node set presence = ?3, revnum = ?4
where wc_id = ?1 and local_relpath = ?2;
+-- STMT_UPDATE_BASE_NODE_PRESENCE_AND_REVNUM
+update nodes set presence = ?3, revision = ?4
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
-- STMT_UPDATE_BASE_PRESENCE_REVNUM_AND_REPOS_RELPATH
update base_node set presence = ?3, revnum = ?4, repos_relpath = ?5
where wc_id = ?1 and local_relpath = ?2;
+-- STMT_UPDATE_BASE_NODE_PRESENCE_REVNUM_AND_REPOS_PATH
+update nodes set presence = ?3, revision = ?4, repos_path = ?5
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
-- STMT_LOOK_FOR_WORK
SELECT id FROM WORK_QUEUE LIMIT 1;
@@ -652,10 +699,18 @@ SELECT 0 FROM WORKING_NODE WHERE wc_id =
UPDATE BASE_NODE SET revnum=?3
WHERE wc_id = ?1 AND local_relpath = ?2;
+-- STMT_UPDATE_BASE_REVISION_1
+update nodes set revision = ?3
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
-- STMT_UPDATE_BASE_REPOS
UPDATE BASE_NODE SET repos_id = ?3, repos_relpath = ?4
WHERE wc_id = ?1 AND local_relpath = ?2;
+-- STMT_UPDATE_BASE_REPOS_1
+update nodes set repos_id = ?3, repos_path = ?4
+where wc_id = ?1 and local_relpath = ?2 and op_depth = 0;
+
/* ------------------------------------------------------------------------- */
/* these are used in entries.c */
@@ -669,18 +724,15 @@ insert or replace into base_node (
values (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14,
?15, ?16);
--- STMT_INSERT_BASE_NODE_DATA_FOR_ENTRY_1
-insert or replace into base_node (
- wc_id, local_relpath, parent_relpath, repos_id, repos_relpath, revnum,
- translated_size, last_mod_time )
-values (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8);
-
--- STMT_INSERT_BASE_NODE_DATA_FOR_ENTRY_2
+-- STMT_INSERT_BASE_NODE_FOR_ENTRY_1
/* The BASE tree has a fixed op_depth '0' */
-insert or replace into node_data (
- wc_id, local_relpath, op_depth, parent_relpath, presence, kind, checksum,
- changed_revision, changed_date, changed_author, depth, properties )
-values (?1, ?2, 0, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11);
+insert or replace into nodes (
+ wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
+ revision, presence, kind, checksum,
+ changed_revision, changed_date, changed_author, depth, properties,
+ translated_size, last_mod_time )
+values (?1, ?2, 0, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13,
+ ?14, ?15, ?16 );
-- STMT_INSERT_WORKING_NODE
insert or replace into working_node (
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/wc.h?rev=997409&r1=997408&r2=997409&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/wc.h Wed Sep 15 17:29:39 2010
@@ -44,19 +44,13 @@ extern "C" {
#define SVN_WC__PROP_REJ_EXT ".prej"
-#define SVN_WC__BASE_EXT ".svn-base" /* for text and prop bases */
-#define SVN_WC__WORK_EXT ".svn-work" /* for working propfiles */
-#define SVN_WC__REVERT_EXT ".svn-revert" /* for reverting a replaced
- file */
-
-
/* We can handle this format or anything lower, and we (should) error
* on anything higher.
*
* There is no format version 0; we started with 1.
*
- * The change from 1 to 2 was the introduction of SVN_WC__WORK_EXT.
+ * The change from 1 to 2 was the introduction of the ".svn-work" extension.
* For example, ".svn/props/foo" became ".svn/props/foo.svn-work".
*
* The change from 2 to 3 was the introduction of the entry attribute
@@ -134,14 +128,6 @@ extern "C" {
#define SVN_WC__VERSION 19
-/* ### SVN_WC__SINGLE_DB and SINGLE_DB were both used in development
- ### and will both disappear before the final 1.7 release. */
-#if SVN_WC__VERSION >= 19
-#define SVN_WC__SINGLE_DB
-#define SINGLE_DB
-#endif
-
-
/* Formats <= this have no concept of "revert text-base/props". */
#define SVN_WC__NO_REVERT_FILES 4
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=997409&r1=997408&r2=997409&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c Wed Sep 15 17:29:39 2010
@@ -374,6 +374,94 @@ fetch_repos_info(const char **repos_root
return svn_error_return(svn_sqlite__reset(stmt));
}
+#ifdef SVN_WC__NODES
+
+/* Can't verify if we only have the NODES table */
+#ifndef SVN_WC__NODES_ONLY
+
+/* */
+static svn_error_t *
+assert_text_columns_equal(svn_sqlite__stmt_t *stmt1,
+ svn_sqlite__stmt_t *stmt2,
+ int column,
+ apr_pool_t *scratch_pool)
+{
+ const char *val1 = svn_sqlite__column_text(stmt1, column, scratch_pool);
+ const char *val2 = svn_sqlite__column_text(stmt2, column, scratch_pool);
+
+ if (val1 != NULL && val2 != NULL) {
+ if (strcmp(val1, val2) != 0)
+ return svn_error_createf(SVN_ERR_WC_CORRUPT, NULL,
+ "Value in statement 1 (%s) differs from value in statement 2 (%s)",
+ val1, val2);
+ } else if (val1 == NULL && val2 == NULL) {
+ /* Do nothing: equal */
+ } else
+ return svn_error_createf(SVN_ERR_WC_CORRUPT, NULL,
+ "Value in statement 1 (%s) differs from value in statement 2 (%s)",
+ val1, val2);
+
+ return SVN_NO_ERROR;
+}
+
+#endif
+
+static svn_error_t *
+assert_base_rows_match(svn_boolean_t have_row1,
+ svn_boolean_t have_row2,
+ svn_sqlite__stmt_t *stmt1,
+ svn_sqlite__stmt_t *stmt2,
+ const char *relpath,
+ apr_pool_t *scratch_pool)
+{
+
+ if (have_row1 != have_row2)
+ SVN_ERR(svn_error_createf(
+ SVN_ERR_WC_CORRUPT, NULL,
+ "Different results from BASE (%d) and NODES queries (%d), "
+ "for local_relpath %s",
+ have_row1, have_row2, relpath));
+
+ if (have_row1) {
+ SVN_ERR_ASSERT(svn_sqlite__column_int64(stmt1, 0)
+ == svn_sqlite__column_int64(stmt2, 0));
+
+ SVN_ERR(assert_text_columns_equal(stmt1, stmt2, 1, scratch_pool));
+
+ SVN_ERR(assert_text_columns_equal(stmt1, stmt2, 2, scratch_pool));
+
+ SVN_ERR(assert_text_columns_equal(stmt1, stmt2, 3, scratch_pool));
+
+ SVN_ERR_ASSERT(svn_sqlite__column_revnum(stmt1, 4)
+ == svn_sqlite__column_revnum(stmt2, 4));
+
+ SVN_ERR(assert_text_columns_equal(stmt1, stmt2, 5, scratch_pool));
+
+ SVN_ERR(assert_text_columns_equal(stmt1, stmt2, 6, scratch_pool));
+
+ SVN_ERR_ASSERT(svn_sqlite__column_revnum(stmt1, 7)
+ == svn_sqlite__column_revnum(stmt2, 7));
+
+
+ SVN_ERR_ASSERT(svn_sqlite__column_int64(stmt1, 8)
+ == svn_sqlite__column_int64(stmt2, 8));
+
+ SVN_ERR(assert_text_columns_equal(stmt1, stmt2, 9, scratch_pool));
+
+ SVN_ERR(assert_text_columns_equal(stmt1, stmt2, 10, scratch_pool));
+
+ SVN_ERR(assert_text_columns_equal(stmt1, stmt2, 11, scratch_pool));
+
+ SVN_ERR_ASSERT(svn_sqlite__column_int64(stmt1, 12)
+ == svn_sqlite__column_int64(stmt2, 12));
+
+ /* 14: verify props? */
+ }
+
+ return SVN_NO_ERROR;
+}
+
+#endif
/* Scan from LOCAL_RELPATH upwards through parent nodes until we find a parent
that has values in the 'repos_id' and 'repos_relpath' columns. Return
@@ -394,20 +482,52 @@ scan_upwards_for_repos(apr_int64_t *repo
const char *current_relpath = local_relpath;
svn_sqlite__stmt_t *stmt;
+#ifdef SVN_WC__NODES
+ svn_sqlite__stmt_t *data_stmt;
+#endif
+
SVN_ERR_ASSERT(wcroot->sdb != NULL && wcroot->wc_id != UNKNOWN_WC_ID);
SVN_ERR_ASSERT(repos_id != NULL || repos_relpath != NULL);
+#ifndef SVN_WC__NODES_ONLY
/* ### is it faster to fetch fewer columns? */
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
STMT_SELECT_BASE_NODE));
+#endif
+
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__get_statement(&data_stmt, wcroot->sdb,
+ STMT_SELECT_BASE_NODE_1));
+#endif
while (TRUE)
{
svn_boolean_t have_row;
+#ifdef SVN_WC__NODES
+ svn_boolean_t have_data_row;
+#endif
+#ifndef SVN_WC__NODES_ONLY
/* Get the current node's repository information. */
SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, current_relpath));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
+#endif
+
+#ifdef SVN_WC__NODES
+
+ /* Get the current node's repository information. */
+ SVN_ERR(svn_sqlite__bindf(data_stmt, "is",
+ wcroot->wc_id, current_relpath));
+ SVN_ERR(svn_sqlite__step(&have_data_row, data_stmt));
+
+#ifndef SVN_WC__NODES_ONLY
+ /* When switching to NODES_ONLY, stop verifying our results. */
+ SVN_ERR(assert_base_rows_match(have_row, have_data_row,
+ stmt, data_stmt,
+ current_relpath,
+ scratch_pool));
+#endif
+#endif
if (!have_row)
{
@@ -430,6 +550,9 @@ scan_upwards_for_repos(apr_int64_t *repo
svn_dirent_local_style(local_abspath, scratch_pool));
}
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__reset(data_stmt));
+#endif
return svn_error_compose_create(err, svn_sqlite__reset(stmt));
}
@@ -449,10 +572,17 @@ scan_upwards_for_repos(apr_int64_t *repo
NULL),
relpath_suffix,
result_pool);
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__reset(data_stmt));
+#endif
return svn_sqlite__reset(stmt);
}
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__reset(data_stmt));
+#endif
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__reset(stmt));
-
+#endif
if (*current_relpath == '\0')
{
/* We scanned all the way up, and did not find the information.
@@ -509,27 +639,6 @@ get_statement_for_path(svn_sqlite__stmt_
}
-/* */
-static svn_error_t *
-navigate_to_parent(svn_wc__db_pdh_t **parent_pdh,
- svn_wc__db_t *db,
- svn_wc__db_pdh_t *child_pdh,
- svn_sqlite__mode_t smode,
- svn_boolean_t verify_parent_stub,
- apr_pool_t *scratch_pool)
-{
- SVN_ERR(svn_wc__db_pdh_navigate_to_parent(parent_pdh,
- db,
- child_pdh,
- smode,
- scratch_pool));
-
- SVN_ERR_ASSERT(!verify_parent_stub);
-
- return SVN_NO_ERROR;
-}
-
-
/* For a given REPOS_ROOT_URL/REPOS_UUID pair, return the existing REPOS_ID
value. If one does not exist, then create a new one. */
static svn_error_t *
@@ -603,7 +712,7 @@ insert_base_node(void *baton, svn_sqlite
#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_INSERT_BASE_NODE));
- SVN_ERR(svn_sqlite__bindf(stmt, "isisstti",
+ SVN_ERR(svn_sqlite__bindf(stmt, "isissttr",
pibb->wc_id, pibb->local_relpath,
pibb->repos_id,
pibb->repos_relpath,
@@ -647,17 +756,18 @@ insert_base_node(void *baton, svn_sqlite
#endif
#ifdef SVN_WC__NODES
- /* the 'r' binding below doesn't work yet...
- no idea why; needs more investigation... */
SVN_ERR(svn_sqlite__get_statement(&stmt_node, sdb, STMT_INSERT_NODE));
{ svn_revnum_t rev = pibb->changed_rev;
- SVN_ERR(svn_sqlite__bindf(stmt_node, "isisnnn" /* No repos rev, id, path */
+ SVN_ERR(svn_sqlite__bindf(stmt_node, "isisisr"
"tstr" /* 8 - 11 */
"isnnnnns", /* 12 - 19 */
pibb->wc_id, /* 1 */
pibb->local_relpath, /* 2 */
(apr_int64_t)0, /* op_depth is 0 for base */
parent_relpath, /* 4 */
+ pibb->repos_id,
+ pibb->repos_relpath,
+ pibb->revision,
presence_map, pibb->status, /* 8 */
(pibb->kind == svn_wc__db_kind_dir) ? /* 9 */
svn_depth_to_word(pibb->depth) : NULL,
@@ -669,12 +779,18 @@ insert_base_node(void *baton, svn_sqlite
pibb->target : NULL)); /* 19 */
}
- if (pibb->kind == svn_wc__db_kind_file)
+ if (pibb->kind == svn_wc__db_kind_file) {
SVN_ERR(svn_sqlite__bind_checksum(stmt_node, 14, pibb->checksum,
scratch_pool));
+ if (pibb->translated_size != SVN_INVALID_FILESIZE)
+ SVN_ERR(svn_sqlite__bind_int64(stmt_node, 16, pibb->translated_size));
+ }
SVN_ERR(svn_sqlite__bind_properties(stmt_node, 15, pibb->props,
scratch_pool));
+ if (pibb->dav_cache)
+ SVN_ERR(svn_sqlite__bind_properties(stmt_node, 18, pibb->dav_cache,
+ scratch_pool));
SVN_ERR(svn_sqlite__insert(NULL, stmt_node));
#endif
@@ -697,7 +813,7 @@ insert_base_node(void *baton, svn_sqlite
const char *name = APR_ARRAY_IDX(pibb->children, i, const char *);
#ifndef SVN_WC__NODES_ONLY
- SVN_ERR(svn_sqlite__bindf(stmt, "issi",
+ SVN_ERR(svn_sqlite__bindf(stmt, "issr",
pibb->wc_id,
svn_relpath_join(pibb->local_relpath,
name,
@@ -707,13 +823,14 @@ insert_base_node(void *baton, svn_sqlite
SVN_ERR(svn_sqlite__insert(NULL, stmt));
#endif
#ifdef SVN_WC__NODES
- SVN_ERR(svn_sqlite__bindf(stmt_node, "isisnnnsns",
+ SVN_ERR(svn_sqlite__bindf(stmt_node, "isisnnrsns",
pibb->wc_id,
svn_relpath_join(pibb->local_relpath,
name,
scratch_pool),
(apr_int64_t)0 /* BASE */,
pibb->local_relpath, /* parent_relpath */
+ pibb->revision,
"incomplete",
"unknown"));
SVN_ERR(svn_sqlite__insert(NULL, stmt_node));
@@ -1945,8 +2062,14 @@ svn_wc__db_base_get_info(svn_wc__db_stat
{
svn_wc__db_pdh_t *pdh;
const char *local_relpath;
+#ifndef SVN_WC__NODES_ONLY
svn_sqlite__stmt_t *stmt;
svn_boolean_t have_row;
+#endif
+#ifdef SVN_WC__NODES
+ svn_sqlite__stmt_t *stmt_nodes;
+ svn_boolean_t have_node_row;
+#endif
svn_error_t *err = SVN_NO_ERROR;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
@@ -1956,11 +2079,25 @@ svn_wc__db_base_get_info(svn_wc__db_stat
scratch_pool, scratch_pool));
VERIFY_USABLE_PDH(pdh);
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
lock ? STMT_SELECT_BASE_NODE_WITH_LOCK
: STMT_SELECT_BASE_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
+#endif
+
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__get_statement(&stmt_nodes, pdh->wcroot->sdb,
+ lock ? STMT_SELECT_BASE_NODE_WITH_LOCK_1
+ : STMT_SELECT_BASE_NODE_1));
+ SVN_ERR(svn_sqlite__bindf(stmt_nodes, "is",
+ pdh->wcroot->wc_id, local_relpath));
+ SVN_ERR(svn_sqlite__step(&have_node_row, stmt_nodes));
+
+ SVN_ERR(assert_base_rows_match(have_row, have_node_row, stmt, stmt_nodes,
+ local_relpath, scratch_pool));
+#endif
if (have_row)
{
@@ -2091,6 +2228,10 @@ svn_wc__db_base_get_info(svn_wc__db_stat
scratch_pool));
}
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__reset(stmt_nodes));
+#endif
+
/* Note: given the composition, no need to wrap for tracing. */
return svn_error_compose_create(err, svn_sqlite__reset(stmt));
}
@@ -2268,6 +2409,7 @@ svn_wc__db_base_set_dav_cache(svn_wc__db
svn_sqlite__stmt_t *stmt;
int affected_rows;
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(get_statement_for_path(&stmt, db, local_abspath,
STMT_UPDATE_BASE_DAV_CACHE, scratch_pool));
SVN_ERR(svn_sqlite__bind_properties(stmt, 3, props, scratch_pool));
@@ -2279,6 +2421,21 @@ svn_wc__db_base_set_dav_cache(svn_wc__db
_("The node '%s' was not found."),
svn_dirent_local_style(local_abspath,
scratch_pool));
+#endif
+#ifdef SVN_WC__NODES
+ SVN_ERR(get_statement_for_path(&stmt, db, local_abspath,
+ STMT_UPDATE_BASE_NODE_DAV_CACHE,
+ scratch_pool));
+ SVN_ERR(svn_sqlite__bind_properties(stmt, 3, props, scratch_pool));
+
+ SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
+
+ if (affected_rows != 1)
+ return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+ _("The node '%s' was not found."),
+ svn_dirent_local_style(local_abspath,
+ scratch_pool));
+#endif
return SVN_NO_ERROR;
}
@@ -2333,11 +2490,23 @@ svn_wc__db_base_clear_dav_cache_recursiv
escape_sqlite_like(local_relpath, scratch_pool),
"/%", NULL);
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
STMT_CLEAR_BASE_RECURSIVE_DAV_CACHE));
SVN_ERR(svn_sqlite__bindf(stmt, "iss", pdh->wcroot->wc_id, local_relpath,
like_arg));
- return svn_error_return(svn_sqlite__step_done(stmt));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE));
+ SVN_ERR(svn_sqlite__bindf(stmt, "iss", pdh->wcroot->wc_id, local_relpath,
+ like_arg));
+
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+
+ return SVN_NO_ERROR;
}
svn_error_t *
@@ -3186,7 +3355,6 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
scratch_pool));
}
- /* Get the children for a directory if this is not the parent stub */
if (kind == svn_wc__db_kind_dir)
SVN_ERR(gather_children(&children, FALSE, db, src_abspath,
scratch_pool, scratch_pool));
@@ -5572,7 +5740,8 @@ commit_node(void *baton, svn_sqlite__db_
SVN_ERR(svn_sqlite__get_statement(&stmt, cb->pdh->wcroot->sdb,
STMT_APPLY_CHANGES_TO_BASE_NODE));
- SVN_ERR(svn_sqlite__bindf(stmt, "issisrtstrinsbns",
+ /* symlink_target not yet used */
+ SVN_ERR(svn_sqlite__bindf(stmt, "issisrtstrisnbn",
cb->pdh->wcroot->wc_id, cb->local_relpath,
parent_relpath,
cb->repos_id,
@@ -5584,10 +5753,9 @@ commit_node(void *baton, svn_sqlite__db_
cb->changed_rev,
cb->changed_date,
cb->changed_author,
- prop_blob.data, prop_blob.len,
- cb->new_dav_cache));
+ prop_blob.data, prop_blob.len));
- SVN_ERR(svn_sqlite__bind_checksum(stmt, 14, cb->new_checksum,
+ SVN_ERR(svn_sqlite__bind_checksum(stmt, 13, cb->new_checksum,
scratch_pool));
SVN_ERR(svn_sqlite__bind_properties(stmt, 15, cb->new_dav_cache,
scratch_pool));
@@ -5921,7 +6089,7 @@ record_fileinfo(void *baton, svn_sqlite_
"information."),
svn_dirent_local_style(rb->local_abspath,
scratch_pool));
-
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
working_exists
? STMT_UPDATE_WORKING_FILEINFO
@@ -5932,6 +6100,23 @@ record_fileinfo(void *baton, svn_sqlite_
SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
SVN_ERR_ASSERT(affected_rows == 1);
+#endif
+
+#ifdef SVN_WC__NODES
+ /* ### Instead of doing it this way, we just ought to update the highest
+ op_depth level. That way, there's no need to find out which
+ tree to update first */
+ SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
+ working_exists
+ ? STMT_UPDATE_WORKING_NODE_FILEINFO
+ : STMT_UPDATE_BASE_NODE_FILEINFO));
+ SVN_ERR(svn_sqlite__bindf(stmt, "isii",
+ rb->wc_id, rb->local_relpath,
+ rb->translated_size, rb->last_mod_time));
+ SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
+
+ SVN_ERR_ASSERT(affected_rows == 1);
+#endif
return SVN_NO_ERROR;
}
@@ -6107,6 +6292,7 @@ svn_wc__db_scan_addition(svn_wc__db_stat
const char *child_abspath = NULL;
const char *build_relpath = "";
svn_wc__db_pdh_t *pdh;
+ svn_wc__db_wcroot_t *wcroot;
svn_boolean_t found_info = FALSE;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
@@ -6137,6 +6323,8 @@ svn_wc__db_scan_addition(svn_wc__db_stat
scratch_pool, scratch_pool));
VERIFY_USABLE_PDH(pdh);
+ wcroot = pdh->wcroot;
+
while (TRUE)
{
svn_sqlite__stmt_t *stmt;
@@ -6144,10 +6332,9 @@ svn_wc__db_scan_addition(svn_wc__db_stat
svn_wc__db_status_t presence;
/* ### is it faster to fetch fewer columns? */
- SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
STMT_SELECT_WORKING_NODE));
- SVN_ERR(svn_sqlite__bindf(stmt, "is",
- pdh->wcroot->wc_id, current_relpath));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, current_relpath));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
if (!have_row)
@@ -6214,7 +6401,7 @@ svn_wc__db_scan_addition(svn_wc__db_stat
result_pool);
if (original_root_url || original_uuid)
SVN_ERR(fetch_repos_info(original_root_url, original_uuid,
- pdh->wcroot->sdb,
+ wcroot->sdb,
svn_sqlite__column_int64(stmt, 9),
result_pool));
if (original_revision)
@@ -6248,14 +6435,13 @@ svn_wc__db_scan_addition(svn_wc__db_stat
/* Move to the parent node. Remember the abspath to this node, since
it could be the root of an add/delete. */
child_abspath = current_abspath;
- if (strcmp(current_abspath, pdh->local_abspath) == 0)
- {
- /* The current node is a directory, so move to the parent dir. */
- SVN_ERR(navigate_to_parent(&pdh, db, pdh, svn_sqlite__mode_readonly,
- FALSE, scratch_pool));
- }
- current_abspath = pdh->local_abspath;
- current_relpath = svn_wc__db_pdh_compute_relpath(pdh, NULL);
+
+ /* The wcroot can't have a restructuring operation; make sure we don't
+ loop on invalid data */
+ SVN_ERR_ASSERT(current_relpath[0] != '\0');
+
+ current_relpath = svn_relpath_dirname(current_relpath, scratch_pool);
+ current_abspath = svn_dirent_dirname(current_abspath, scratch_pool);
}
/* If we're here, then we have an added/copied/moved (start) node, and
@@ -6298,6 +6484,7 @@ svn_wc__db_scan_deletion(const char **ba
svn_boolean_t child_has_base = FALSE;
svn_boolean_t found_moved_to = FALSE;
svn_wc__db_pdh_t *pdh;
+ svn_wc__db_wcroot_t *wcroot;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
@@ -6320,6 +6507,8 @@ svn_wc__db_scan_deletion(const char **ba
scratch_pool, scratch_pool));
VERIFY_USABLE_PDH(pdh);
+ wcroot = pdh->wcroot;
+
while (TRUE)
{
svn_sqlite__stmt_t *stmt;
@@ -6327,10 +6516,9 @@ svn_wc__db_scan_deletion(const char **ba
svn_boolean_t have_base;
svn_wc__db_status_t work_presence;
- SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
STMT_SELECT_DELETION_INFO));
- SVN_ERR(svn_sqlite__bindf(stmt, "is",
- pdh->wcroot->wc_id, current_relpath));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, current_relpath));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
if (!have_row)
@@ -6458,7 +6646,7 @@ svn_wc__db_scan_deletion(const char **ba
if (moved_to_abspath != NULL)
*moved_to_abspath = svn_dirent_join(
- pdh->wcroot->abspath,
+ wcroot->abspath,
svn_sqlite__column_text(stmt, 2, NULL),
result_pool);
}
@@ -6480,14 +6668,13 @@ svn_wc__db_scan_deletion(const char **ba
child_abspath = current_abspath;
child_presence = work_presence;
child_has_base = have_base;
- if (strcmp(current_abspath, pdh->local_abspath) == 0)
- {
- /* The current node is a directory, so move to the parent dir. */
- SVN_ERR(navigate_to_parent(&pdh, db, pdh, svn_sqlite__mode_readonly,
- FALSE, scratch_pool));
- }
- current_abspath = pdh->local_abspath;
- current_relpath = svn_wc__db_pdh_compute_relpath(pdh, NULL);
+
+ /* The wcroot can't be deleted, but make sure we don't loop on invalid
+ data */
+ SVN_ERR_ASSERT(current_relpath[0] != '\0');
+
+ current_relpath = svn_relpath_dirname(current_relpath, scratch_pool);
+ current_abspath = svn_dirent_dirname(current_abspath, scratch_pool);
}
return SVN_NO_ERROR;
@@ -6523,11 +6710,23 @@ svn_wc__db_upgrade_apply_dav_cache(svn_s
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
apr_int64_t wc_id;
apr_hash_index_t *hi;
+#ifndef SVN_WC__NODES_ONLY
svn_sqlite__stmt_t *stmt;
+#endif
+#ifdef SVN_WC__NODES
+ svn_sqlite__stmt_t *stmt_node;
+#endif
SVN_ERR(svn_wc__db_util_fetch_wc_id(&wc_id, sdb, iterpool));
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_UPDATE_BASE_DAV_CACHE));
+#endif
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__get_statement(&stmt_node, sdb,
+ STMT_UPDATE_BASE_NODE_DAV_CACHE));
+#endif
+
/* Iterate over all the wcprops, writing each one to the wc_db. */
for (hi = apr_hash_first(scratch_pool, cache_values);
@@ -6542,9 +6741,17 @@ svn_wc__db_upgrade_apply_dav_cache(svn_s
local_relpath = svn_relpath_join(dir_relpath, name, iterpool);
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, local_relpath));
SVN_ERR(svn_sqlite__bind_properties(stmt, 3, props, iterpool));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__bindf(stmt_node, "is", wc_id, local_relpath));
+ SVN_ERR(svn_sqlite__bind_properties(stmt_node, 3, props, iterpool));
+ SVN_ERR(svn_sqlite__step_done(stmt_node));
+#endif
+
}
svn_pool_destroy(iterpool);
@@ -6629,6 +6836,7 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
{
apr_hash_t *props = revert_props ? revert_props : base_props;
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_UPDATE_BASE_PROPS));
SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, local_relpath));
SVN_ERR(svn_sqlite__bind_properties(stmt, 3, props, scratch_pool));
@@ -6636,6 +6844,17 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
/* ### should we provide a nicer error message? */
SVN_ERR_ASSERT(affected_rows == 1);
+#endif
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
+ STMT_UPDATE_NODE_BASE_PROPS));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, local_relpath));
+ SVN_ERR(svn_sqlite__bind_properties(stmt, 3, props, scratch_pool));
+ SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
+
+ /* ### should we provide a nicer error message? */
+ SVN_ERR_ASSERT(affected_rows == 1);
+#endif
}
if (have_work)
@@ -6652,6 +6871,7 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
&& (work_presence == svn_wc__db_status_normal
|| work_presence == svn_wc__db_status_incomplete))
{
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
STMT_UPDATE_WORKING_PROPS));
SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, local_relpath));
@@ -6661,6 +6881,18 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
/* ### should we provide a nicer error message? */
SVN_ERR_ASSERT(affected_rows == 1);
+#endif
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
+ STMT_UPDATE_WORKING_PROPS));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, local_relpath));
+ SVN_ERR(svn_sqlite__bind_properties(stmt, 3, base_props,
+ scratch_pool));
+ SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
+
+ /* ### should we provide a nicer error message? */
+ SVN_ERR_ASSERT(affected_rows == 1);
+#endif
}
/* else other states should have no properties. */
/* ### should we insert empty props for <= SVN_WC__NO_REVERT_FILES? */
@@ -7998,6 +8230,7 @@ start_directory_update_txn(void *baton,
if (strcmp(du->new_repos_relpath, repos_relpath) == 0)
{
+#ifndef SVN_WC__NODES_ONLY
/* Just update revision and status */
SVN_ERR(svn_sqlite__get_statement(
&stmt, db,
@@ -8008,9 +8241,25 @@ start_directory_update_txn(void *baton,
du->local_relpath,
presence_map, svn_wc__db_status_incomplete,
(apr_int64_t)du->new_rev));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+#ifdef SVN_WC__NODES
+ /* Just update revision and status */
+ SVN_ERR(svn_sqlite__get_statement(
+ &stmt, db,
+ STMT_UPDATE_BASE_NODE_PRESENCE_AND_REVNUM));
+
+ SVN_ERR(svn_sqlite__bindf(stmt, "isti",
+ du->wc_id,
+ du->local_relpath,
+ presence_map, svn_wc__db_status_incomplete,
+ (apr_int64_t)du->new_rev));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
}
else
{
+#ifndef SVN_WC__NODES_ONLY
/* ### TODO: Maybe check if we can make repos_relpath NULL. */
SVN_ERR(svn_sqlite__get_statement(
&stmt, db,
@@ -8022,9 +8271,24 @@ start_directory_update_txn(void *baton,
presence_map, svn_wc__db_status_incomplete,
(apr_int64_t)du->new_rev,
du->new_repos_relpath));
- }
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+#ifdef SVN_WC__NODES
+ /* ### TODO: Maybe check if we can make repos_relpath NULL. */
+ SVN_ERR(svn_sqlite__get_statement(
+ &stmt, db,
+ STMT_UPDATE_BASE_NODE_PRESENCE_REVNUM_AND_REPOS_PATH));
- return svn_error_return(svn_sqlite__step_done(stmt));
+ SVN_ERR(svn_sqlite__bindf(stmt, "istis",
+ du->wc_id,
+ du->local_relpath,
+ presence_map, svn_wc__db_status_incomplete,
+ (apr_int64_t)du->new_rev,
+ du->new_repos_relpath));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+ }
+ return SVN_NO_ERROR;
}
svn_error_t *
@@ -8611,12 +8875,14 @@ svn_wc__db_temp_op_set_file_external(svn
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
STMT_INSERT_NODE));
- SVN_ERR(svn_sqlite__bindf(stmt, "isisnnntnt",
+ SVN_ERR(svn_sqlite__bindf(stmt, "isisisntnt",
pdh->wcroot->wc_id,
local_relpath,
(apr_int64_t)0, /* op_depth == BASE */
svn_relpath_dirname(local_relpath,
scratch_pool),
+ repos_id,
+ repos_relpath,
presence_map, svn_wc__db_status_not_present,
kind_map, svn_wc__db_kind_file));
@@ -8790,6 +9056,7 @@ set_rev_relpath_txn(void *baton,
if (SVN_IS_VALID_REVNUM(rrb->rev))
{
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
STMT_UPDATE_BASE_REVISION));
@@ -8798,6 +9065,17 @@ set_rev_relpath_txn(void *baton,
(apr_int64_t)rrb->rev));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
+ STMT_UPDATE_BASE_REVISION_1));
+
+ SVN_ERR(svn_sqlite__bindf(stmt, "isi", rrb->pdh->wcroot->wc_id,
+ rrb->local_relpath,
+ (apr_int64_t)rrb->rev));
+
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
}
if (rrb->set_repos_relpath)
@@ -8806,6 +9084,7 @@ set_rev_relpath_txn(void *baton,
SVN_ERR(create_repos_id(&repos_id, rrb->repos_root_url, rrb->repos_uuid,
rrb->pdh->wcroot->sdb, scratch_pool));
+#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
STMT_UPDATE_BASE_REPOS));
@@ -8815,6 +9094,18 @@ set_rev_relpath_txn(void *baton,
rrb->repos_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
+ STMT_UPDATE_BASE_REPOS_1));
+
+ SVN_ERR(svn_sqlite__bindf(stmt, "isis", rrb->pdh->wcroot->wc_id,
+ rrb->local_relpath,
+ repos_id,
+ rrb->repos_relpath));
+
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
}
return SVN_NO_ERROR;
@@ -8828,7 +9119,6 @@ svn_wc__db_temp_op_set_rev_and_repos_rel
const char *repos_relpath,
const char *repos_root_url,
const char *repos_uuid,
- svn_boolean_t update_stub,
apr_pool_t *scratch_pool)
{
struct set_rev_relpath_baton baton;
@@ -8851,8 +9141,6 @@ svn_wc__db_temp_op_set_rev_and_repos_rel
SVN_ERR(flush_entries(db, baton.pdh, local_abspath, scratch_pool));
- SVN_ERR_ASSERT(!update_stub);
-
SVN_ERR(svn_sqlite__with_transaction(baton.pdh->wcroot->sdb,
set_rev_relpath_txn,
&baton, scratch_pool));
@@ -8938,11 +9226,14 @@ set_new_dir_to_incomplete_txn(void *bato
STMT_INSERT_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "isis" /* 1 - 4 */
- "nnn" "sns", /* 5 - 7(n), 8, 9(n), 10 */
+ "isr" "sns", /* 5 - 7, 8, 9(n), 10 */
dtb->pdh->wcroot->wc_id, /* 1 */
dtb->local_relpath, /* 2 */
(apr_int64_t)0, /* op_depth == 0; BASE */
parent_relpath, /* 4 */
+ repos_id,
+ dtb->repos_relpath,
+ dtb->revision,
"incomplete", /* 8, presence */
"dir")); /* 10, kind */
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.h?rev=997409&r1=997408&r2=997409&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.h Wed Sep 15 17:29:39 2010
@@ -2206,24 +2206,6 @@ svn_wc__db_temp_is_dir_deleted(svn_boole
const char *local_abspath,
apr_pool_t *scratch_pool);
-#ifndef SVN_WC__SINGLE_DB
-/* For a deleted node, determine its keep_local flag. (This flag will
- go away once we have a consolidated administrative area) */
-svn_error_t *
-svn_wc__db_temp_determine_keep_local(svn_boolean_t *keep_local,
- svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *scratch_pool);
-
-/* For a deleted directory, set its keep_local flag. (This flag will
- go away once we have a consolidated administrative area) */
-svn_error_t *
-svn_wc__db_temp_set_keep_local(svn_wc__db_t *db,
- const char *local_abspath,
- svn_boolean_t keep_local,
- apr_pool_t *scratch_pool);
-#endif
-
/* Removes all references of LOCAL_ABSPATH from its working copy
using DB. */
svn_error_t *
@@ -2367,14 +2349,6 @@ svn_wc__db_temp_get_file_external(const
apr_pool_t *scratch_pool);
-#ifndef SVN_WC__SINGLE_DB
-/* Remove a stray "subdir" record in the BASE_NODE table. */
-svn_error_t *
-svn_wc__db_temp_remove_subdir_record(svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *scratch_pool);
-#endif
-
/* Set file external information on LOCAL_ABSPATH to REPOS_RELPATH
at PEG_REV with revision REV*/
svn_error_t *
@@ -2403,28 +2377,10 @@ svn_wc__db_temp_op_set_property_conflict
const char *prej_basename,
apr_pool_t *scratch_pool);
-#ifndef SVN_WC__SINGLE_DB
-/* Ensure that the parent stub of LOCAL_ABSPATH contains a BASE_NODE record with
- a normal status and optionally remove the WORKING_NODE record for the node;
- this assumes that the parent directory is in the incomplete state, or the
- node already exists (either as working or as base node).
-
- ### This function is a HACK with assumptions that aren't completely checked.
- ### Don't add new callers unless you exactly know what
- ### you are doing! This call is never needed once we get to a central db. */
-svn_error_t *
-svn_wc__db_temp_set_parent_stub_to_normal(svn_wc__db_t *db,
- const char *local_abspath,
- svn_boolean_t delete_working,
- apr_pool_t *scratch_pool);
-#endif
-
/* Sets a base nodes revision and/or repository relative path. If
LOCAL_ABSPATH's rev (REV) is valid, set is revision and if SET_REPOS_RELPATH
is TRUE set its repository relative path to REPOS_RELPATH (and make sure its
REPOS_ROOT_URL and REPOS_ROOT_UUID are still valid).
-
- ### TODO(SINGLE_DB): Remove the 'update_stub' argument.
*/
svn_error_t *
svn_wc__db_temp_op_set_rev_and_repos_relpath(svn_wc__db_t *db,
@@ -2434,7 +2390,6 @@ svn_wc__db_temp_op_set_rev_and_repos_rel
const char *repos_relpath,
const char *repos_root_url,
const char *repos_uuid,
- svn_boolean_t update_stub,
apr_pool_t *scratch_pool);
/* Tweak a locally added existing directory LOCAL_ABSPATH to have a base
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db_private.h?rev=997409&r1=997408&r2=997409&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db_private.h Wed Sep 15 17:29:39 2010
@@ -84,11 +84,9 @@ typedef struct svn_wc__db_wcroot_t {
format has not (yet) been determined, this will be UNKNOWN_FORMAT. */
int format;
-#ifdef SVN_WC__SINGLE_DB
/* Array of svn_wc__db_wclock_t fields (not pointers!).
Typically just one or two locks maximum. */
apr_array_header_t *owned_locks;
-#endif
} svn_wc__db_wcroot_t;
@@ -98,15 +96,6 @@ typedef struct svn_wc__db_wcroot_t {
* a given working copy directory.
*/
typedef struct svn_wc__db_pdh_t {
-#ifndef SVN_WC__SINGLE_DB
- /* This (versioned) working copy directory is obstructing what *should*
- be a file in the parent directory (according to its metadata).
-
- Note: this PDH should probably be ignored (or not created).
-
- ### obstruction is only possible with per-dir wc.db databases. */
- svn_boolean_t obstructed_file;
-#endif
/* The absolute path to this working copy directory. */
const char *local_abspath;
@@ -117,11 +106,6 @@ typedef struct svn_wc__db_pdh_t {
/* The parent directory's per-dir information. */
struct svn_wc__db_pdh_t *parent;
-#ifndef SVN_WC__SINGLE_DB
- /* Whether this process owns a write-lock on this directory. */
- svn_boolean_t locked;
-#endif
-
/* Hold onto the old-style access baton that corresponds to this PDH. */
svn_wc_adm_access_t *adm_access;
} svn_wc__db_pdh_t;
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/workqueue.h
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/workqueue.h?rev=997409&r1=997408&r2=997409&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/workqueue.h (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/workqueue.h Wed Sep 15 17:29:39 2010
@@ -213,17 +213,6 @@ svn_wc__wq_build_base_remove(svn_skel_t
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-#ifndef SVN_WC__SINGLE_DB
-/* Handle the old "KILLME" concept -- perform the actual deletion of a
- subdir (or just its admin area) during post-commit processing of a
- deleted subdir. */
-svn_error_t *
-svn_wc__wq_add_killme(svn_wc__db_t *db,
- const char *adm_abspath,
- svn_boolean_t adm_only,
- apr_pool_t *scratch_pool);
-#endif
-
/* ### Temporary helper to store text conflict marker locations as a wq
### operation. Eventually the data must be stored in the pristine store+db
Modified: subversion/branches/atomic-revprop/subversion/mod_dav_svn/authz.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/mod_dav_svn/authz.c?rev=997409&r1=997408&r2=997409&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/mod_dav_svn/authz.c (original)
+++ subversion/branches/atomic-revprop/subversion/mod_dav_svn/authz.c Wed Sep 15 17:29:39 2010
@@ -32,17 +32,12 @@
#include "dav_svn.h"
-/* Convert incoming REV and PATH from request R into a version-resource URI
- for REPOS and perform a GET subrequest on it. This will invoke any authz
- modules loaded into apache. Return TRUE if the subrequest succeeds, FALSE
- otherwise. If REV is SVN_INVALID_REVNUM, then we look at HEAD.
-*/
-static svn_boolean_t
-allow_read(request_rec *r,
- const dav_svn_repos *repos,
- const char *path,
- svn_revnum_t rev,
- apr_pool_t *pool)
+svn_boolean_t
+dav_svn__allow_read(request_rec *r,
+ const dav_svn_repos *repos,
+ const char *path,
+ svn_revnum_t rev,
+ apr_pool_t *pool)
{
const char *uri;
request_rec *subreq;
@@ -176,7 +171,7 @@ authz_read(svn_boolean_t *allowed,
}
/* We have a (rev, path) pair to check authorization on. */
- *allowed = allow_read(arb->r, arb->repos, revpath, rev, pool);
+ *allowed = dav_svn__allow_read(arb->r, arb->repos, revpath, rev, pool);
return SVN_NO_ERROR;
}
@@ -195,10 +190,10 @@ dav_svn__authz_read_func(dav_svn__authz_
svn_boolean_t
-dav_svn__allow_read(const dav_resource *resource,
- svn_revnum_t rev,
- apr_pool_t *pool)
+dav_svn__allow_read_resource(const dav_resource *resource,
+ svn_revnum_t rev,
+ apr_pool_t *pool)
{
- return allow_read(resource->info->r, resource->info->repos,
- resource->info->repos_path, rev, pool);
+ return dav_svn__allow_read(resource->info->r, resource->info->repos,
+ resource->info->repos_path, rev, pool);
}