You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2010/06/16 14:07:05 UTC
svn commit: r955212 - in /subversion/trunk/subversion: libsvn_wc/
tests/libsvn_wc/
Author: philip
Date: Wed Jun 16 12:07:04 2010
New Revision: 955212
URL: http://svn.apache.org/viewvc?rev=955212&view=rev
Log:
Change svn_wc__db_read_info to return information about the
presence of BASE and WORKING nodes.
* subversion/libsvn_wc/wc_db.h
(svn_wc__db_read_info): Remove text_mod, replace base_shadowed with
have_base and have_work.
(enum svn_wc__db_status_t): Tweak comment.
* subversion/libsvn_wc/wc_db.c
(svn_wc__db_read_info): Remove text_mod, replace base_shadowed with
have_base and have_work.
(temp_cross_db_copy): Adjust comments naming parameters.
(svn_wc__db_op_copy): Use have_work instead of status.
(svn_wc__db_temp_op_delete): Use have_work in place of base_shadowed.
(svn_wc__db_global_relocate): Use have_base in place of base_shadowed,
remove redundant SQL query.
* subversion/tests/libsvn_wc/db-test.c
(test_working_info): Test new parameters.
* subversion/libsvn_wc/crop.c
(svn_wc_crop_tree2): Use have_base in place of base_shadowed.
* subversion/libsvn_wc/adm_ops.c
(svn_wc_delete4): Use have_base in place of base_shadowed.
* subversion/libsvn_wc/status.c
(assemble_status, send_status_structure): Use have_base in place of
base_shadowed.
* subversion/libsvn_wc/update_editor.c
(check_tree_conflict): Use have_base in place of base_shadowed.
(open_directory, svn_wc_add_repos_file4): Use have_work in place of
base_shadowed.
* subversion/libsvn_wc/diff.c
(file_diff): Use have_base in place of base_shadowed.
* subversion/libsvn_wc/entries.c
(read_one_entry): Use have_base in place of base_shadowed.
* subversion/libsvn_wc/adm_crawler.c
(find_base_rev): Use have_base in place of base_shadowed.
* subversion/libsvn_wc/node.c
(svn_wc__internal_node_get_url, svn_wc__internal_is_replaced,
svn_wc__node_get_base_rev, svn_wc__node_get_working_rev_info,
svn_wc__node_get_commit_base_rev): Use have_base in place of base_shadowed.
Modified:
subversion/trunk/subversion/libsvn_wc/adm_crawler.c
subversion/trunk/subversion/libsvn_wc/adm_ops.c
subversion/trunk/subversion/libsvn_wc/crop.c
subversion/trunk/subversion/libsvn_wc/diff.c
subversion/trunk/subversion/libsvn_wc/entries.c
subversion/trunk/subversion/libsvn_wc/node.c
subversion/trunk/subversion/libsvn_wc/status.c
subversion/trunk/subversion/libsvn_wc/update_editor.c
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/libsvn_wc/wc_db.h
subversion/trunk/subversion/tests/libsvn_wc/db-test.c
Modified: subversion/trunk/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_crawler.c?rev=955212&r1=955211&r2=955212&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_crawler.c Wed Jun 16 12:07:04 2010
@@ -646,18 +646,18 @@ find_base_rev(svn_revnum_t *base_rev,
{
const char *op_root_abspath;
svn_wc__db_status_t status;
- svn_boolean_t base_shadowed;
+ svn_boolean_t have_base;
SVN_ERR(svn_wc__db_read_info(&status, NULL, base_rev, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- &base_shadowed, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
+ &have_base, NULL, NULL, NULL,
db, local_abspath, pool, pool));
if (SVN_IS_VALID_REVNUM(*base_rev))
return SVN_NO_ERROR;
- if (base_shadowed)
+ if (have_base)
return svn_error_return(
svn_wc__db_base_get_info(NULL, NULL, base_rev, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=955212&r1=955211&r2=955212&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Wed Jun 16 12:07:04 2010
@@ -1166,12 +1166,12 @@ svn_wc_delete4(svn_wc_context_t *wc_ctx,
svn_error_t *err;
svn_wc__db_status_t status;
svn_wc__db_kind_t kind;
- svn_boolean_t base_shadowed;
+ svn_boolean_t have_base;
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,
- &base_shadowed, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ &have_base, NULL, NULL, NULL,
db, local_abspath, pool, pool);
if (delete_unversioned_target &&
@@ -1212,7 +1212,7 @@ svn_wc_delete4(svn_wc_context_t *wc_ctx,
was_copied = (status == svn_wc__db_status_copied ||
status == svn_wc__db_status_moved_here);
- if (!base_shadowed)
+ if (!have_base)
was_add = strcmp(op_root_abspath, local_abspath) == 0;
else
was_replace = TRUE;
Modified: subversion/trunk/subversion/libsvn_wc/crop.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/crop.c?rev=955212&r1=955211&r2=955212&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/crop.c (original)
+++ subversion/trunk/subversion/libsvn_wc/crop.c Wed Jun 16 12:07:04 2010
@@ -215,7 +215,7 @@ svn_wc_exclude(svn_wc_context_t *wc_ctx,
svn_wc__db_kind_t kind;
svn_revnum_t revision;
const char *repos_relpath, *repos_root, *repos_uuid;
- svn_boolean_t base_shadowed;
+ svn_boolean_t have_base;
SVN_ERR(svn_wc__check_wc_root(&is_root, NULL, &is_switched,
wc_ctx->db, local_abspath, scratch_pool));
@@ -241,7 +241,7 @@ svn_wc_exclude(svn_wc_context_t *wc_ctx,
&repos_root, &repos_uuid, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL,
- NULL, &base_shadowed, NULL, NULL,
+ &have_base, NULL, NULL, NULL,
wc_ctx->db, local_abspath,
scratch_pool, scratch_pool));
@@ -276,7 +276,7 @@ svn_wc_exclude(svn_wc_context_t *wc_ctx,
break; /* Ok to exclude */
}
- if (base_shadowed)
+ if (have_base)
SVN_ERR(svn_wc__db_base_get_info(NULL, &kind, &revision, &repos_relpath,
&repos_root, &repos_uuid, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
Modified: subversion/trunk/subversion/libsvn_wc/diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/diff.c?rev=955212&r1=955211&r2=955212&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/diff.c (original)
+++ subversion/trunk/subversion/libsvn_wc/diff.c Wed Jun 16 12:07:04 2010
@@ -589,7 +589,7 @@ file_diff(struct dir_baton *db,
svn_wc__db_status_t status;
svn_revnum_t revision;
svn_revnum_t revert_base_revnum;
- svn_boolean_t base_shadowed;
+ svn_boolean_t have_base;
svn_wc__db_status_t base_status;
const char *local_abspath;
@@ -607,10 +607,10 @@ file_diff(struct dir_baton *db,
SVN_ERR(svn_wc__db_read_info(&status, NULL, &revision, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- &base_shadowed, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ &have_base, NULL, NULL, NULL,
eb->db, local_abspath, pool, pool));
- if (base_shadowed)
+ if (have_base)
SVN_ERR(svn_wc__db_base_get_info(&base_status, NULL, &revert_base_revnum,
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
@@ -618,7 +618,7 @@ file_diff(struct dir_baton *db,
replaced = ((status == svn_wc__db_status_added
|| status == svn_wc__db_status_obstructed_add)
- && base_shadowed
+ && have_base
&& base_status != svn_wc__db_status_not_present);
/* Now refine ADDED to one of: ADDED, COPIED, MOVED_HERE. Note that only
Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=955212&r1=955211&r2=955212&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Wed Jun 16 12:07:04 2010
@@ -523,7 +523,7 @@ read_one_entry(const svn_wc_entry_t **ne
const char *original_repos_relpath;
const char *original_root_url;
svn_boolean_t conflicted;
- svn_boolean_t base_shadowed;
+ svn_boolean_t have_base;
entry->name = name;
@@ -550,8 +550,8 @@ read_one_entry(const svn_wc_entry_t **ne
NULL,
&entry->copyfrom_rev,
NULL,
+ &have_base,
NULL,
- &base_shadowed,
&conflicted,
&lock,
db,
@@ -706,7 +706,7 @@ read_one_entry(const svn_wc_entry_t **ne
entry->revision = parent_entry->revision;
}
- if (base_shadowed)
+ if (have_base)
{
svn_wc__db_status_t base_status;
Modified: subversion/trunk/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=955212&r1=955211&r2=955212&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Wed Jun 16 12:07:04 2010
@@ -329,20 +329,20 @@ svn_wc__internal_node_get_url(const char
svn_wc__db_status_t status;
const char *repos_relpath;
const char *repos_root_url;
- svn_boolean_t base_shadowed;
+ svn_boolean_t have_base;
SVN_ERR(svn_wc__db_read_info(&status, NULL, NULL, &repos_relpath,
&repos_root_url,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- &base_shadowed, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ &have_base, NULL, NULL, NULL,
db, local_abspath,
scratch_pool, scratch_pool));
if (repos_relpath == NULL)
{
if (status == svn_wc__db_status_normal
|| status == svn_wc__db_status_incomplete
- || (base_shadowed
+ || (have_base
&& (status == svn_wc__db_status_deleted
|| status == svn_wc__db_status_obstructed_delete)))
{
@@ -362,7 +362,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
- || (!base_shadowed
+ || (!have_base
&& (status == svn_wc__db_status_deleted
|| status == svn_wc__db_status_obstructed_delete)))
{
@@ -786,7 +786,7 @@ svn_wc__internal_is_replaced(svn_boolean
apr_pool_t *scratch_pool)
{
svn_wc__db_status_t status;
- svn_boolean_t base_shadowed;
+ svn_boolean_t have_base;
svn_wc__db_status_t base_status;
SVN_ERR(svn_wc__db_read_info(
@@ -794,11 +794,11 @@ svn_wc__internal_is_replaced(svn_boolean
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
- NULL, NULL, &base_shadowed,
+ NULL, &have_base, NULL,
NULL, NULL,
db, local_abspath,
scratch_pool, scratch_pool));
- if (base_shadowed)
+ if (have_base)
SVN_ERR(svn_wc__db_base_get_info(&base_status, NULL, NULL,
NULL, NULL, NULL,
NULL, NULL, NULL,
@@ -809,7 +809,7 @@ svn_wc__internal_is_replaced(svn_boolean
*replaced = ((status == svn_wc__db_status_added
|| status == svn_wc__db_status_obstructed_add)
- && base_shadowed
+ && have_base
&& base_status != svn_wc__db_status_not_present);
return SVN_NO_ERROR;
@@ -835,13 +835,13 @@ svn_wc__node_get_base_rev(svn_revnum_t *
apr_pool_t *scratch_pool)
{
svn_wc__db_status_t status;
- svn_boolean_t base_shadowed;
+ svn_boolean_t have_base;
SVN_ERR(svn_wc__db_read_info(&status,
NULL, base_revision,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, &base_shadowed,
+ NULL, NULL, NULL, &have_base, NULL,
NULL, NULL,
wc_ctx->db, local_abspath,
scratch_pool, scratch_pool));
@@ -849,7 +849,7 @@ svn_wc__node_get_base_rev(svn_revnum_t *
if (SVN_IS_VALID_REVNUM(*base_revision))
return SVN_NO_ERROR;
- if (base_shadowed)
+ if (have_base)
{
/* The node was replaced with something else. Look at the base. */
SVN_ERR(svn_wc__db_base_get_info(NULL, NULL, base_revision,
@@ -875,12 +875,12 @@ svn_wc__node_get_working_rev_info(svn_re
apr_pool_t *result_pool)
{
svn_wc__db_status_t status;
- svn_boolean_t base_shadowed;
+ svn_boolean_t have_base;
SVN_ERR(svn_wc__db_read_info(&status, NULL, revision, NULL, NULL, NULL,
changed_rev, changed_date, changed_author,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, &base_shadowed, NULL,
+ NULL, NULL, NULL, &have_base, NULL, NULL,
NULL, wc_ctx->db, local_abspath, result_pool,
scratch_pool));
@@ -902,7 +902,7 @@ svn_wc__node_get_working_rev_info(svn_re
NULL, changed_rev, changed_date,
changed_author, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, &base_shadowed,
+ NULL, NULL, NULL, NULL,
NULL, NULL, wc_ctx->db, work_del_abspath,
result_pool, scratch_pool));
}
@@ -917,7 +917,7 @@ svn_wc__node_get_working_rev_info(svn_re
scratch_pool));
}
}
- else if (base_shadowed)
+ else if (have_base)
{
svn_wc__db_status_t base_status;
svn_revnum_t base_rev;
@@ -946,13 +946,13 @@ svn_wc__node_get_commit_base_rev(svn_rev
apr_pool_t *scratch_pool)
{
svn_wc__db_status_t status;
- svn_boolean_t base_shadowed;
+ svn_boolean_t have_base;
SVN_ERR(svn_wc__db_read_info(&status, NULL,
commit_base_revision,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, &base_shadowed, NULL, NULL,
+ NULL, &have_base, NULL, NULL, NULL,
wc_ctx->db, local_abspath, scratch_pool,
scratch_pool));
@@ -971,7 +971,7 @@ svn_wc__node_get_commit_base_rev(svn_rev
wc_ctx->db, local_abspath,
scratch_pool, scratch_pool));
- if (! SVN_IS_VALID_REVNUM(*commit_base_revision) && base_shadowed)
+ if (! SVN_IS_VALID_REVNUM(*commit_base_revision) && have_base)
/* It is a replace that does not feature a copy/move-here.
Return the revert-base revision. */
return svn_error_return(
Modified: subversion/trunk/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/status.c?rev=955212&r1=955211&r2=955212&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/status.c (original)
+++ subversion/trunk/subversion/libsvn_wc/status.c Wed Jun 16 12:07:04 2010
@@ -291,7 +291,7 @@ assemble_status(svn_wc_status3_t **statu
const char *changed_author;
apr_time_t changed_date;
const char *changelist;
- svn_boolean_t base_shadowed;
+ svn_boolean_t have_base;
svn_boolean_t conflicted;
svn_boolean_t copied = FALSE;
svn_depth_t depth;
@@ -315,7 +315,7 @@ assemble_status(svn_wc_status3_t **statu
&changed_rev, &changed_date,
&changed_author, NULL, &depth, NULL, NULL,
NULL, &changelist, NULL, NULL, NULL, NULL,
- NULL, &prop_modified_p, &base_shadowed,
+ &prop_modified_p, &have_base, NULL,
&conflicted, &lock, db, local_abspath,
result_pool, scratch_pool));
@@ -358,7 +358,7 @@ assemble_status(svn_wc_status3_t **statu
NULL, NULL,
db, local_abspath,
result_pool, scratch_pool));
- else if (base_shadowed)
+ else if (have_base)
SVN_ERR(svn_wc__db_scan_base_repos(&repos_relpath,
&repos_root_url, NULL,
db, local_abspath,
@@ -790,17 +790,17 @@ send_status_structure(const struct walk_
{
const char *repos_relpath;
svn_wc__db_status_t status;
- svn_boolean_t base_shadowed;
+ svn_boolean_t have_base;
SVN_ERR(svn_wc__db_read_info(&status, NULL, NULL, &repos_relpath, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, &base_shadowed, NULL, NULL,
+ NULL, &have_base, NULL, NULL, NULL,
wb->db, local_abspath,
scratch_pool, scratch_pool));
/* A switched path can be deleted: check the right relpath */
- if (status == svn_wc__db_status_deleted && base_shadowed)
+ if (status == svn_wc__db_status_deleted && have_base)
SVN_ERR(svn_wc__db_scan_base_repos(&repos_relpath, NULL,
NULL, wb->db, local_abspath,
scratch_pool, scratch_pool));
Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=955212&r1=955211&r2=955212&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Wed Jun 16 12:07:04 2010
@@ -1570,7 +1570,7 @@ check_tree_conflict(svn_wc_conflict_desc
{
svn_wc__db_status_t status;
svn_wc__db_kind_t db_node_kind;
- svn_boolean_t base_shadowed;
+ svn_boolean_t have_base;
svn_wc_conflict_reason_t reason = SVN_WC_CONFLICT_REASON_NONE;
svn_boolean_t locally_replaced = FALSE;
svn_boolean_t modified = FALSE;
@@ -1582,9 +1582,9 @@ check_tree_conflict(svn_wc_conflict_desc
&db_node_kind,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL,
- &base_shadowed,
NULL, NULL,
+ &have_base,
+ NULL, NULL, NULL,
eb->db,
local_abspath,
pool,
@@ -1599,7 +1599,7 @@ check_tree_conflict(svn_wc_conflict_desc
case svn_wc__db_status_moved_here:
case svn_wc__db_status_copied:
/* Is it a replace? */
- if (base_shadowed)
+ if (have_base)
{
svn_wc__db_status_t base_status;
SVN_ERR(svn_wc__db_base_get_info(&base_status, NULL, NULL,
@@ -2664,7 +2664,7 @@ open_directory(const char *path,
{
struct dir_baton *db, *pb = parent_baton;
struct edit_baton *eb = pb->edit_baton;
- svn_boolean_t base_shadowed;
+ svn_boolean_t have_work;
svn_boolean_t already_conflicted;
svn_wc_conflict_description2_t *tree_conflict = NULL;
svn_wc__db_status_t status, base_status;
@@ -2694,11 +2694,11 @@ open_directory(const char *path,
SVN_ERR(svn_wc__db_read_info(&status, NULL, &db->old_revision, NULL, NULL,
NULL, NULL, NULL, NULL, NULL,
&db->ambient_depth, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- &base_shadowed, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
+ NULL, &have_work, NULL, NULL,
eb->db, db->local_abspath, pool, pool));
- if (!base_shadowed)
+ if (!have_work)
base_status = status;
else
SVN_ERR(svn_wc__db_base_get_info(&base_status, NULL, &db->old_revision,
@@ -5808,14 +5808,14 @@ svn_wc_add_repos_file4(svn_wc_context_t
else if (status == svn_wc__db_status_normal ||
status == svn_wc__db_status_incomplete)
{
- svn_boolean_t base_shadowed;
+ svn_boolean_t have_work;
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, &base_shadowed,
+ NULL, NULL, &have_work,
NULL, NULL,
db, local_abspath,
pool, pool));
@@ -5823,7 +5823,7 @@ svn_wc_add_repos_file4(svn_wc_context_t
/* If there is a WORKING node present AND it is not an "add",
then we need to move the base/props. If an add is present,
that would imply we've done this move before. */
- if (base_shadowed
+ if (have_work
&& status != svn_wc__db_status_added
&& status != svn_wc__db_status_obstructed_add)
{
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=955212&r1=955211&r2=955212&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Wed Jun 16 12:07:04 2010
@@ -2434,9 +2434,9 @@ temp_cross_db_copy(svn_wc__db_t *db,
NULL /* original_root_url */,
NULL /* original_uuid */,
NULL /* original_revision */,
- NULL /* text_mod */,
NULL /* props_mod */,
- NULL /* base_shadowed */,
+ NULL /* have_base */,
+ NULL /* have_work */,
NULL /* conflicted */,
NULL /* lock */,
db, src_abspath, scratch_pool, scratch_pool));
@@ -2516,6 +2516,7 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
const char *repos_relpath, *repos_root_url, *repos_uuid, *copyfrom_relpath;
svn_revnum_t revision, copyfrom_rev;
svn_wc__db_status_t status, dst_status;
+ svn_boolean_t have_work;
apr_int64_t copyfrom_id;
svn_wc__db_kind_t kind;
const apr_array_header_t *children;
@@ -2554,9 +2555,9 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
NULL /* original_root_url */,
NULL /* original_uuid */,
NULL /* original_revision */,
- NULL /* text_mod */,
NULL /* props_mod */,
- NULL /* base_shadowed */,
+ NULL /* have_base */,
+ &have_work,
NULL /* conflicted */,
NULL /* lock */,
db, src_abspath, scratch_pool, scratch_pool));
@@ -2666,10 +2667,7 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
const char *dst_parent_relpath = svn_relpath_dirname(dst_relpath,
scratch_pool);
- /* ### Need a better way to determine whether a WORKING_NODE exists */
- if (status == svn_wc__db_status_added
- || status == svn_wc__db_status_copied
- || status == svn_wc__db_status_moved_here)
+ if (have_work)
SVN_ERR(svn_sqlite__get_statement(&stmt, src_pdh->wcroot->sdb,
STMT_INSERT_WORKING_NODE_COPY_FROM_WORKING));
else
@@ -4037,7 +4035,7 @@ svn_wc__db_temp_op_delete(svn_wc__db_t *
svn_error_t *err;
svn_boolean_t base_none, working_none, new_working_none;
svn_wc__db_status_t base_status, working_status, new_working_status;
- svn_boolean_t base_shadowed;
+ svn_boolean_t have_work;
err = svn_wc__db_base_get_info(&base_status,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -4064,7 +4062,7 @@ svn_wc__db_temp_op_delete(svn_wc__db_t *
SVN_ERR(svn_wc__db_read_info(&working_status, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, &base_shadowed, NULL, NULL,
+ NULL, NULL, NULL, &have_work, NULL, NULL,
db, local_abspath,
scratch_pool, scratch_pool));
if (working_status == svn_wc__db_status_deleted
@@ -4075,10 +4073,7 @@ svn_wc__db_temp_op_delete(svn_wc__db_t *
return SVN_NO_ERROR;
}
- /* We must have a WORKING node if there is no BASE node (gotta have
- something!). If there IS a BASE node, then we have a WORKING node
- if BASE_SHADOWED is TRUE. */
- working_none = !(base_none || base_shadowed);
+ working_none = !have_work;
new_working_none = working_none;
new_working_status = working_status;
@@ -4211,9 +4206,9 @@ svn_wc__db_read_info(svn_wc__db_status_t
const char **original_root_url,
const char **original_uuid,
svn_revnum_t *original_revision,
- svn_boolean_t *text_mod,
svn_boolean_t *props_mod,
- svn_boolean_t *base_shadowed,
+ svn_boolean_t *have_base,
+ svn_boolean_t *have_work,
svn_boolean_t *conflicted,
svn_wc__db_lock_t **lock,
svn_wc__db_t *db,
@@ -4226,8 +4221,8 @@ svn_wc__db_read_info(svn_wc__db_status_t
svn_sqlite__stmt_t *stmt_base;
svn_sqlite__stmt_t *stmt_work;
svn_sqlite__stmt_t *stmt_act;
- svn_boolean_t have_base;
- svn_boolean_t have_work;
+ svn_boolean_t local_have_base;
+ svn_boolean_t local_have_work;
svn_boolean_t have_act;
svn_error_t *err = NULL;
@@ -4238,18 +4233,23 @@ svn_wc__db_read_info(svn_wc__db_status_t
scratch_pool, scratch_pool));
VERIFY_USABLE_PDH(pdh);
+ if (!have_base)
+ have_base = &local_have_base;
+ if (!have_work)
+ have_work = &local_have_work;
+
SVN_ERR(svn_sqlite__get_statement(&stmt_base, pdh->wcroot->sdb,
lock ? STMT_SELECT_BASE_NODE_WITH_LOCK
: STMT_SELECT_BASE_NODE));
SVN_ERR(svn_sqlite__bindf(stmt_base, "is",
pdh->wcroot->wc_id, local_relpath));
- SVN_ERR(svn_sqlite__step(&have_base, stmt_base));
+ SVN_ERR(svn_sqlite__step(have_base, stmt_base));
SVN_ERR(svn_sqlite__get_statement(&stmt_work, pdh->wcroot->sdb,
STMT_SELECT_WORKING_NODE));
SVN_ERR(svn_sqlite__bindf(stmt_work, "is",
pdh->wcroot->wc_id, local_relpath));
- SVN_ERR(svn_sqlite__step(&have_work, stmt_work));
+ SVN_ERR(svn_sqlite__step(have_work, stmt_work));
SVN_ERR(svn_sqlite__get_statement(&stmt_act, pdh->wcroot->sdb,
STMT_SELECT_ACTUAL_NODE));
@@ -4257,18 +4257,18 @@ svn_wc__db_read_info(svn_wc__db_status_t
pdh->wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step(&have_act, stmt_act));
- if (have_base || have_work)
+ if (*have_base || *have_work)
{
svn_wc__db_kind_t node_kind;
- if (have_work)
+ if (*have_work)
node_kind = svn_sqlite__column_token(stmt_work, 1, kind_map);
else
node_kind = svn_sqlite__column_token(stmt_base, 3, kind_map);
if (status)
{
- if (have_base)
+ if (*have_base)
{
*status = svn_sqlite__column_token(stmt_base, 2, presence_map);
@@ -4280,7 +4280,7 @@ svn_wc__db_read_info(svn_wc__db_status_t
SVN_ERR_ASSERT((*status != svn_wc__db_status_absent
&& *status != svn_wc__db_status_excluded
/* && *status != svn_wc__db_status_incomplete */)
- || !have_work);
+ || !*have_work);
if (node_kind == svn_wc__db_kind_subdir
&& *status == svn_wc__db_status_normal)
@@ -4294,7 +4294,7 @@ svn_wc__db_read_info(svn_wc__db_status_t
}
}
- if (have_work)
+ if (*have_work)
{
svn_wc__db_status_t work_status;
@@ -4365,14 +4365,14 @@ svn_wc__db_read_info(svn_wc__db_status_t
}
if (revision)
{
- if (have_work)
+ if (*have_work)
*revision = SVN_INVALID_REVNUM;
else
*revision = svn_sqlite__column_revnum(stmt_base, 4);
}
if (repos_relpath)
{
- if (have_work)
+ if (*have_work)
{
/* Our path is implied by our parent somewhere up the tree.
With the NULL value and status, the caller will know to
@@ -4389,7 +4389,7 @@ svn_wc__db_read_info(svn_wc__db_status_t
WORKING_NODE (and have been added), then the repository
we're being added to will be dependent upon a parent. The
caller can scan upwards to locate the repository. */
- if (have_work || svn_sqlite__column_is_null(stmt_base, 0))
+ if (*have_work || svn_sqlite__column_is_null(stmt_base, 0))
{
if (repos_root_url)
*repos_root_url = NULL;
@@ -4407,21 +4407,21 @@ svn_wc__db_read_info(svn_wc__db_status_t
}
if (changed_rev)
{
- if (have_work)
+ if (*have_work)
*changed_rev = svn_sqlite__column_revnum(stmt_work, 4);
else
*changed_rev = svn_sqlite__column_revnum(stmt_base, 7);
}
if (changed_date)
{
- if (have_work)
+ if (*have_work)
*changed_date = svn_sqlite__column_int64(stmt_work, 5);
else
*changed_date = svn_sqlite__column_int64(stmt_base, 8);
}
if (changed_author)
{
- if (have_work)
+ if (*have_work)
*changed_author = svn_sqlite__column_text(stmt_work, 6,
result_pool);
else
@@ -4430,7 +4430,7 @@ svn_wc__db_read_info(svn_wc__db_status_t
}
if (last_mod_time)
{
- if (have_work)
+ if (*have_work)
*last_mod_time = svn_sqlite__column_int64(stmt_work, 14);
else
*last_mod_time = svn_sqlite__column_int64(stmt_base, 12);
@@ -4446,7 +4446,7 @@ svn_wc__db_read_info(svn_wc__db_status_t
{
const char *depth_str;
- if (have_work)
+ if (*have_work)
depth_str = svn_sqlite__column_text(stmt_work, 7, NULL);
else
depth_str = svn_sqlite__column_text(stmt_base, 10, NULL);
@@ -4466,7 +4466,7 @@ svn_wc__db_read_info(svn_wc__db_status_t
else
{
svn_error_t *err2;
- if (have_work)
+ if (*have_work)
err2 = svn_sqlite__column_checksum(checksum, stmt_work, 2,
result_pool);
else
@@ -4485,7 +4485,7 @@ svn_wc__db_read_info(svn_wc__db_status_t
}
if (translated_size)
{
- if (have_work)
+ if (*have_work)
*translated_size = get_translated_size(stmt_work, 3);
else
*translated_size = get_translated_size(stmt_base, 6);
@@ -4494,7 +4494,7 @@ svn_wc__db_read_info(svn_wc__db_status_t
{
if (node_kind != svn_wc__db_kind_symlink)
*target = NULL;
- else if (have_work)
+ else if (*have_work)
*target = svn_sqlite__column_text(stmt_work, 8, result_pool);
else
*target = svn_sqlite__column_text(stmt_base, 11, result_pool);
@@ -4508,13 +4508,13 @@ svn_wc__db_read_info(svn_wc__db_status_t
}
if (original_repos_relpath)
{
- if (have_work)
+ if (*have_work)
*original_repos_relpath = svn_sqlite__column_text(stmt_work, 10,
result_pool);
else
*original_repos_relpath = NULL;
}
- if (!have_work || svn_sqlite__column_is_null(stmt_work, 9))
+ if (!*have_work || svn_sqlite__column_is_null(stmt_work, 9))
{
if (original_root_url)
*original_root_url = NULL;
@@ -4533,24 +4533,15 @@ svn_wc__db_read_info(svn_wc__db_status_t
}
if (original_revision)
{
- if (have_work)
+ if (*have_work)
*original_revision = svn_sqlite__column_revnum(stmt_work, 11);
else
*original_revision = SVN_INVALID_REVNUM;
}
- if (text_mod)
- {
- /* ### fix this */
- *text_mod = FALSE;
- }
if (props_mod)
{
*props_mod = have_act && !svn_sqlite__column_is_null(stmt_act, 6);
}
- if (base_shadowed)
- {
- *base_shadowed = have_base && have_work;
- }
if (conflicted)
{
if (have_act)
@@ -4857,7 +4848,6 @@ svn_wc__db_global_relocate(svn_wc__db_t
svn_wc__db_status_t status;
struct relocate_baton rb;
const char *old_repos_root_url, *stored_local_dir_abspath;
- svn_boolean_t base_shadowed;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_dir_abspath));
/* ### assert that we were passed a directory? */
@@ -4872,36 +4862,12 @@ svn_wc__db_global_relocate(svn_wc__db_t
&rb.repos_relpath, &old_repos_root_url,
&rb.repos_uuid,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- &base_shadowed,
- NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ &rb.have_base_node,
+ NULL, NULL, NULL,
db, local_dir_abspath,
scratch_pool, scratch_pool));
- if (status == svn_wc__db_status_excluded
- || status == svn_wc__db_status_incomplete)
- {
- if (base_shadowed)
- rb.have_base_node = TRUE;
- else
- {
- svn_sqlite__stmt_t *stmt;
-
- SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
- STMT_SELECT_BASE_NODE));
- SVN_ERR(svn_sqlite__bindf(stmt, "is",
- pdh->wcroot->wc_id, rb.local_relpath));
- SVN_ERR(svn_sqlite__step(&rb.have_base_node, stmt));
- SVN_ERR(svn_sqlite__reset(stmt));
- }
- }
- else if (base_shadowed || status == svn_wc__db_status_normal
- || status == svn_wc__db_status_absent
- || status == svn_wc__db_status_not_present)
- rb.have_base_node = TRUE;
- else
- rb.have_base_node = FALSE;
-
if (status == svn_wc__db_status_excluded)
{
/* The parent cannot be excluded, so look at the parent and then
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=955212&r1=955211&r2=955212&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Wed Jun 16 12:07:04 2010
@@ -180,7 +180,7 @@ typedef enum {
svn_wc__db_status_normal,
/* The node has been added (potentially obscuring a delete or move of
- the BASE node; see BASE_SHADOWED param). The text will be marked as
+ the BASE node; see HAVE_BASE param). The text will be marked as
modified, and if properties exist, they will be marked as modified.
In many cases svn_wc__db_status_added means any of added, moved-here
@@ -1329,9 +1329,9 @@ svn_wc__db_op_set_tree_conflict(svn_wc__
ORIGINAL_ROOT_URL NULL
ORIGINAL_UUID NULL
ORIGINAL_REVISION SVN_INVALID_REVNUM
- TEXT_MOD n/a (always available)
PROPS_MOD n/a (always available)
- BASE_SHADOWED n/a (always available)
+ HAVE_BASE n/a (always available)
+ HAVE_WORK n/a (always available)
CONFLICTED FALSE
LOCK NULL
@@ -1342,7 +1342,7 @@ svn_wc__db_op_set_tree_conflict(svn_wc__
svn_wc__db_status_added
svn_wc__db_status_obstructed_add
- A node has been added/copied/moved to here. See BASE_SHADOWED to see
+ A node has been added/copied/moved to here. See HAVE_BASE to see
if this change overwrites a BASE node. Use scan_addition() to resolve
whether this has been added, copied, or moved, and the details of the
operation (this function only looks at LOCAL_ABSPATH, but resolving
@@ -1367,8 +1367,6 @@ svn_wc__db_op_set_tree_conflict(svn_wc__
The node has been excluded from the working copy tree. This may
be an exclusion from the BASE tree, or an exclusion in the
WORKING tree for a child node of a copied/moved parent.
- (### If BASE_SHADOWED is FALSE it is not possible to distinguish
- between the two trees).
svn_wc__db_status_not_present
This is a node from the BASE tree, has been marked as "not-present"
@@ -1379,8 +1377,6 @@ svn_wc__db_op_set_tree_conflict(svn_wc__
svn_wc__db_status_incomplete
The BASE or WORKING node is incomplete due to an interrupted
operation.
- (### If BASE_SHADOWED is FALSE it is not possible to distinguish
- between the two trees).
If REVISION is requested, it will be set to the revision of the
unmodified (BASE) node, or to SVN_INVALID_REVNUM if any structural
@@ -1463,10 +1459,9 @@ svn_wc__db_read_info(svn_wc__db_status_t
svn_revnum_t *original_revision,
/* ### the followed are derived fields */
- svn_boolean_t *text_mod, /* ### possibly modified */
svn_boolean_t *props_mod,
- svn_boolean_t *base_shadowed, /* ### WORKING shadows a
- ### deleted BASE? */
+ svn_boolean_t *have_base,
+ svn_boolean_t *have_work,
svn_boolean_t *conflicted,
Modified: subversion/trunk/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/db-test.c?rev=955212&r1=955211&r2=955212&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/db-test.c Wed Jun 16 12:07:04 2010
@@ -838,9 +838,9 @@ test_working_info(apr_pool_t *pool)
const char *original_root_url;
const char *original_uuid;
svn_revnum_t original_revnum;
- svn_boolean_t text_mod;
svn_boolean_t props_mod;
- svn_boolean_t base_shadowed;
+ svn_boolean_t have_base;
+ svn_boolean_t have_work;
svn_boolean_t conflicted;
svn_wc__db_lock_t *lock;
svn_wc__db_t *db;
@@ -857,7 +857,7 @@ test_working_info(apr_pool_t *pool)
&depth, &checksum, &translated_size, &target,
&changelist, &original_repos_relpath, &original_root_url,
&original_uuid, &original_revnum,
- &text_mod, &props_mod, &base_shadowed,
+ &props_mod, &have_base, &have_work,
&conflicted, &lock,
db, svn_dirent_join(local_abspath, "I", pool),
pool, pool));
@@ -879,9 +879,9 @@ test_working_info(apr_pool_t *pool)
SVN_TEST_STRING_ASSERT(original_root_url, ROOT_TWO);
SVN_TEST_STRING_ASSERT(original_uuid, UUID_TWO);
SVN_TEST_ASSERT(original_revnum == 2);
- SVN_TEST_ASSERT(text_mod == FALSE);
SVN_TEST_ASSERT(props_mod == FALSE);
- SVN_TEST_ASSERT(base_shadowed == TRUE);
+ SVN_TEST_ASSERT(have_base == TRUE);
+ SVN_TEST_ASSERT(have_work == TRUE);
SVN_TEST_ASSERT(conflicted == FALSE);
SVN_TEST_ASSERT(lock == NULL);