Author: rhuijben
Date: Wed Mar 30 15:08:12 2011
New Revision: 1086983
URL: http://svn.apache.org/viewvc?rev=1086983&view=rev
Log:
Apply some small portions of a patch I mostly reverted to prepare for redoing
this patch.
* subversion/include/private/svn_wc_private.h
(svn_wc__node_get_commit_status): Add 3 arguments to help in identifying
copies vs additions.
* subversion/libsvn_client/commit_util.c
(harvest_committables): Rename argument to match its double usage.
Update caller.
* subversion/libsvn_wc/node.c
(svn_wc__node_get_commit_status): Set the new output arguments.
Modified:
subversion/trunk/subversion/include/private/svn_wc_private.h
subversion/trunk/subversion/libsvn_client/commit_util.c
subversion/trunk/subversion/libsvn_wc/node.c
Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1086983&r1=1086982&r2=1086983&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Wed Mar 30
15:08:12 2011
@@ -902,9 +902,12 @@ svn_wc__node_get_commit_status(svn_node_
svn_boolean_t *added,
svn_boolean_t *deleted,
svn_boolean_t *not_present,
+ svn_boolean_t *is_op_root,
svn_boolean_t *symlink,
svn_revnum_t *revision,
const char **repos_relpath,
+ svn_revnum_t *original_revision,
+ const char **original_repos_relpath,
svn_boolean_t *conflicted,
const char **changelist,
svn_boolean_t *props_mod,
Modified: subversion/trunk/subversion/libsvn_client/commit_util.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit_util.c?rev=1086983&r1=1086982&r2=1086983&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit_util.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit_util.c Wed Mar 30 15:08:12
2011
@@ -311,8 +311,8 @@ bail_on_tree_conflicted_ancestor(svn_wc_
lock tokens as commit candidates.
If in COPY_MODE, treat the entry as if it is destined to be added
- with history as REPOS_RELPATH, and add 'deleted' entries to COMMITTABLES as
- items to delete in the copy destination. REPOS_RELPATH must be NULL if not
+ with history as COMMIT_RELPATH, and add 'deleted' entries to COMMITTABLES as
+ items to delete in the copy destination. COMMIT_RELPATH must be NULL if not
in COPY_MODE. COPY_MODE_ROOT should be set TRUE for the first call for
which COPY_MODE is TRUE, i.e. not for for the recursive calls, and FALSE
otherwise.
@@ -332,7 +332,7 @@ harvest_committables(apr_hash_t *committ
apr_hash_t *lock_tokens,
const char *local_abspath,
const char *repos_root_url,
- const char *repos_relpath,
+ const char *commit_relpath,
svn_boolean_t adds_only,
svn_boolean_t copy_mode,
svn_boolean_t copy_mode_root,
@@ -372,8 +372,8 @@ harvest_committables(apr_hash_t *committ
if (look_up_committable(committables, local_abspath, scratch_pool))
return SVN_NO_ERROR;
- SVN_ERR_ASSERT((copy_mode && repos_relpath)
- || (! copy_mode && ! repos_relpath));
+ SVN_ERR_ASSERT((copy_mode && commit_relpath)
+ || (! copy_mode && ! commit_relpath));
SVN_ERR_ASSERT((copy_mode_root && copy_mode) || ! copy_mode_root);
SVN_ERR_ASSERT((just_locked && lock_tokens) || !just_locked);
@@ -384,16 +384,17 @@ harvest_committables(apr_hash_t *committ
the node itself, since a path might have changed kind since its
entry was written. */
SVN_ERR(svn_wc__node_get_commit_status(&db_kind, &is_added, &is_deleted,
- &is_not_present, &is_symlink,
+ &is_not_present, NULL, &is_symlink,
&entry_rev, &entry_relpath,
+ NULL, NULL,
&conflicted,
&node_changelist,
&prop_mod, &is_update_root,
ctx->wc_ctx, local_abspath,
scratch_pool, scratch_pool));
- if (!entry_relpath && repos_relpath)
- entry_relpath = repos_relpath;
+ if (!entry_relpath && commit_relpath)
+ entry_relpath = commit_relpath;
if ((db_kind != svn_node_file) && (db_kind != svn_node_dir))
return svn_error_createf
@@ -480,7 +481,7 @@ harvest_committables(apr_hash_t *committ
/* Our own URL wins if not in COPY_MODE. In COPY_MODE the
telescoping URLs are used. */
if (! copy_mode)
- repos_relpath = entry_relpath;
+ commit_relpath = entry_relpath;
/* Check for the deletion case. Deletes occur only when not in
"adds-only mode". We use the SVN_CLIENT_COMMIT_ITEM_DELETE flag
@@ -712,7 +713,7 @@ harvest_committables(apr_hash_t *committ
{
/* Finally, add the committable item. */
SVN_ERR(add_committable(committables, local_abspath, db_kind,
- repos_root_url, repos_relpath,
+ repos_root_url, commit_relpath,
entry_rev,
cf_relpath,
cf_rev,
@@ -721,7 +722,7 @@ harvest_committables(apr_hash_t *committ
if (state_flags & SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN)
apr_hash_set(lock_tokens,
svn_path_url_add_component2(
- repos_root_url, repos_relpath,
+ repos_root_url, commit_relpath,
apr_hash_pool_get(lock_tokens)),
APR_HASH_KEY_STRING, entry_lock_token);
}
@@ -764,7 +765,7 @@ harvest_committables(apr_hash_t *committ
continue;
}
- this_repos_relpath = svn_relpath_join(repos_relpath, name,
+ this_repos_relpath = svn_relpath_join(commit_relpath, name,
iterpool);
/* Recurse. */
@@ -1052,6 +1053,7 @@ harvest_copy_committables(void *baton, v
struct copy_committables_baton *btn = baton;
svn_client__copy_pair_t *pair = *(svn_client__copy_pair_t **)item;
const char *repos_root_url;
+ const char *commit_relpath;
/* Read the entry for this SRC. */
SVN_ERR_ASSERT(svn_dirent_is_absolute(pair->src_abspath_or_url));
@@ -1060,15 +1062,15 @@ harvest_copy_committables(void *baton, v
pair->src_abspath_or_url, TRUE, TRUE,
pool, pool));
+ commit_relpath = svn_path_uri_decode(svn_uri_skip_ancestor(
+ repos_root_url,
+ pair->dst_abspath_or_url),
+ pool);
+
/* Handle this SRC. */
return harvest_committables(btn->committables, NULL,
pair->src_abspath_or_url,
- repos_root_url,
- svn_path_uri_decode(
- svn_uri_skip_ancestor(
- repos_root_url,
- pair->dst_abspath_or_url),
- pool),
+ repos_root_url, commit_relpath,
FALSE, /* ADDS_ONLY */
TRUE, /* COPY_MODE */
TRUE, /* COPY_MODE_ROOT */
Modified: subversion/trunk/subversion/libsvn_wc/node.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=1086983&r1=1086982&r2=1086983&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Wed Mar 30 15:08:12 2011
@@ -1595,9 +1595,12 @@ svn_wc__node_get_commit_status(svn_node_
svn_boolean_t *added,
svn_boolean_t *deleted,
svn_boolean_t *not_present,
+ svn_boolean_t *is_op_root,
svn_boolean_t *symlink,
svn_revnum_t *revision,
const char **repos_relpath,
+ svn_revnum_t *original_revision,
+ const char **original_repos_relpath,
svn_boolean_t *conflicted,
const char **changelist,
svn_boolean_t *props_mod,
@@ -1614,8 +1617,9 @@ svn_wc__node_get_commit_status(svn_node_
/* ### All of this should be handled inside a single read transaction */
SVN_ERR(svn_wc__db_read_info(&status, &db_kind, revision, repos_relpath,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL,NULL, changelist, NULL, NULL, NULL, NULL,
- props_mod, &have_base, NULL, conflicted, NULL,
+ NULL,NULL, changelist, original_repos_relpath,
+ NULL, NULL, original_revision, props_mod,
+ &have_base, NULL, conflicted, NULL,
wc_ctx->db, local_abspath,
result_pool, scratch_pool));
@@ -1635,6 +1639,42 @@ svn_wc__node_get_commit_status(svn_node_
if (not_present)
*not_present = (status == svn_wc__db_status_not_present);
+ if (is_op_root)
+ {
+ const char *op_root_abspath;
+ switch(status)
+ {
+ case svn_wc__db_status_added:
+ SVN_ERR(svn_wc__db_scan_addition(&status, &op_root_abspath,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ wc_ctx->db, local_abspath,
+ scratch_pool, scratch_pool));
+
+ *is_op_root = (strcmp(op_root_abspath, local_abspath) == 0);
+ break;
+ case svn_wc__db_status_deleted:
+ {
+ const char *base_del_abspath;
+ const char *work_del_abspath;
+
+ SVN_ERR(svn_wc__db_scan_deletion(&base_del_abspath,
+ NULL, &work_del_abspath,
+ wc_ctx->db, local_abspath,
+ scratch_pool, scratch_pool));
+
+ op_root_abspath = (work_del_abspath != NULL) ? work_del_abspath
+ : base_del_abspath;
+ }
+
+ *is_op_root = (strcmp(op_root_abspath, local_abspath) == 0);
+ break;
+ default:
+ *is_op_root = FALSE;
+ break;
+ }
+ }
+
if (symlink)
{
apr_hash_t *props;