You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/05/13 22:16:44 UTC
svn commit: r1102886 - in /subversion/trunk/subversion: include/
libsvn_client/ libsvn_wc/ tests/cmdline/
Author: rhuijben
Date: Fri May 13 20:16:43 2011
New Revision: 1102886
URL: http://svn.apache.org/viewvc?rev=1102886&view=rev
Log:
Revert my orginal fix for issue #3351 in preparation for handling the removal
of file and other externals properly on update instead of on commit.
* subversion/include/svn_wc.h
(svn_wc_process_committed_queue2): Remove two arguments.
* subversion/libsvn_client/client.h
(svn_client__handle_externals): Remove delete_only option.
* subversion/libsvn_client/commit.c
(svn_client_commit5): Stop collecting and processing externals.
* subversion/libsvn_client/externals.c
(item_change_baton_t): Remove variable.
(handle_external_item_change): Don't check for delete_only.
(handle_externals_change): Use constant baton as argument
instead of separate args.
(svn_client__handle_externals): Pass baton instead of arguments.
(svn_client__export_externals): Update caller.
* subversion/libsvn_client/switch.c
(switch_internal): Update caller.
* subversion/libsvn_client/update.c
(update_internal): Update caller.
* subversion/libsvn_wc/adm_ops.c
(process_committed_leaf,
svn_wc__process_committed_internal): Remove external processing.
(svn_wc_process_committed_queue2): Don't collect externals and don't
send them to the callback.
* subversion/libsvn_wc/deprecated.c
(svn_wc_process_committed_queue,
svn_wc_process_committed4): Update caller.
* subversion/libsvn_wc/wc.h
(svn_wc__process_committed_internal): Remove external arguments.
* subversion/tests/cmdline/externals_tests.py
(update_lose_file_external): Remove assumption that commit changes the
external and reapply XFail marking.
Modified:
subversion/trunk/subversion/include/svn_wc.h
subversion/trunk/subversion/libsvn_client/client.h
subversion/trunk/subversion/libsvn_client/commit.c
subversion/trunk/subversion/libsvn_client/externals.c
subversion/trunk/subversion/libsvn_client/switch.c
subversion/trunk/subversion/libsvn_client/update.c
subversion/trunk/subversion/libsvn_wc/adm_ops.c
subversion/trunk/subversion/libsvn_wc/deprecated.c
subversion/trunk/subversion/libsvn_wc/wc.h
subversion/trunk/subversion/tests/cmdline/externals_tests.py
Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1102886&r1=1102885&r2=1102886&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Fri May 13 20:16:43 2011
@@ -4926,9 +4926,6 @@ svn_wc_queue_committed(svn_wc_committed_
* If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
* if the client wants to cancel the operation.
*
- * If @a external_func is non-NULL, call it with @a external_baton on
- * 'svn:externals' changes applied to the working copy.
- *
* @since New in 1.7.
*/
svn_error_t *
@@ -4937,8 +4934,6 @@ svn_wc_process_committed_queue2(svn_wc_c
svn_revnum_t new_revnum,
const char *rev_date,
const char *rev_author,
- svn_wc_external_update_t external_func,
- void *external_baton,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool);
Modified: subversion/trunk/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/client.h?rev=1102886&r1=1102885&r2=1102886&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/client.h (original)
+++ subversion/trunk/subversion/libsvn_client/client.h Fri May 13 20:16:43 2011
@@ -916,8 +916,6 @@ svn_client__do_commit(const char *base_u
timestamp integrity, *TIMESTAMP_SLEEP will be unchanged if no sleep
is required.
- If DELETE_ONLY is TRUE, only process removals of externals.
-
Use POOL for temporary allocation. */
svn_error_t *
svn_client__handle_externals(apr_hash_t *externals_old,
@@ -925,7 +923,6 @@ svn_client__handle_externals(apr_hash_t
apr_hash_t *ambient_depths,
const char *repos_root_url,
svn_depth_t requested_depth,
- svn_boolean_t delete_only,
svn_boolean_t *timestamp_sleep,
svn_client_ctx_t *ctx,
apr_pool_t *pool);
Modified: subversion/trunk/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit.c?rev=1102886&r1=1102885&r2=1102886&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit.c Fri May 13 20:16:43 2011
@@ -1408,11 +1408,6 @@ svn_client_commit5(const apr_array_heade
|| (cmt_err->apr_err == SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED))
{
svn_wc_committed_queue_t *queue = svn_wc_committed_queue_create(pool);
- svn_client__external_func_baton_t efb = {0};
-
- efb.externals_old = apr_hash_make(pool);
- efb.externals_new = apr_hash_make(pool);
- efb.result_pool = pool;
/* Make a note that our commit is finished. */
commit_in_progress = FALSE;
@@ -1440,21 +1435,8 @@ svn_client_commit5(const apr_array_heade
commit_info->revision,
commit_info->date,
commit_info->author,
- svn_client__external_info_gatherer,
- &efb,
ctx->cancel_func, ctx->cancel_baton,
iterpool);
-
- if (apr_hash_count(efb.externals_old))
- {
- /* Ok, we should process externals changes; but now we have */
-
- SVN_ERR(svn_client__handle_externals(efb.externals_old,
- efb.externals_new,
- NULL, NULL,
- svn_depth_unknown, TRUE,
- NULL, ctx, iterpool));
- }
}
/* Sleep to ensure timestamp integrity. */
Modified: subversion/trunk/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/externals.c?rev=1102886&r1=1102885&r2=1102886&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/externals.c (original)
+++ subversion/trunk/subversion/libsvn_client/externals.c Fri May 13 20:16:43 2011
@@ -57,7 +57,6 @@ struct item_change_baton_t
svn_boolean_t *timestamp_sleep;
svn_boolean_t is_export;
- svn_boolean_t delete_only;
};
/* Remove the directory at LOCAL_ABSPATH from revision control, and do the
@@ -760,7 +759,7 @@ handle_external_item_change(const struct
/* If the external is being checked out, exported or updated,
determine if the external is a file or directory. */
- if (new_item && !ib->delete_only)
+ if (new_item)
{
svn_node_kind_t kind;
@@ -800,7 +799,7 @@ handle_external_item_change(const struct
the global case is hard, and it should be pretty obvious to a
user when it happens. Worst case: your disk fills up :-). */
- if (! old_item && !ib->delete_only)
+ if (! old_item)
{
/* This branch is only used during a checkout or an export. */
const char *parent_abspath;
@@ -952,7 +951,7 @@ handle_external_item_change(const struct
SVN_ERR(err);
}
- else if (!ib->delete_only)
+ else
{
/* This branch handles all other changes. */
@@ -1048,18 +1047,14 @@ handle_external_item_change_wrapper(cons
KEY is a 'const char *'.
*/
static svn_error_t *
-handle_externals_change(const char *local_abspath,
+handle_externals_change(const struct item_change_baton_t *ib,
+ const char *local_abspath,
const char *old_desc_text,
const char *new_desc_text,
svn_depth_t ambient_depth,
svn_depth_t requested_depth,
- const char *repos_root_url,
- svn_boolean_t delete_only,
- svn_boolean_t *timestamp_sleep,
- svn_client_ctx_t *ctx,
apr_pool_t *scratch_pool)
{
- struct item_change_baton_t ib = { 0 };
apr_array_header_t *old_desc, *new_desc;
apr_hash_t *new_desc_hash;
int i;
@@ -1106,22 +1101,10 @@ handle_externals_change(const char *loca
APR_HASH_KEY_STRING, item);
}
- ib.repos_root_url = repos_root_url;
- ib.ctx = ctx;
- ib.is_export = FALSE;
- ib.native_eol = NULL;
- ib.delete_only = delete_only;
- ib.timestamp_sleep = timestamp_sleep;
-
- if (!ib.repos_root_url)
- SVN_ERR(svn_wc__node_get_repos_info(&ib.repos_root_url, NULL,
- ctx->wc_ctx, local_abspath,
- scratch_pool, scratch_pool));
-
- SVN_ERR(svn_wc__node_get_url(&url, ctx->wc_ctx, local_abspath,
+ SVN_ERR(svn_wc__node_get_url(&url, ib->ctx->wc_ctx, local_abspath,
scratch_pool, scratch_pool));
- SVN_ERR_ASSERT(url && ib.repos_root_url);
+ SVN_ERR_ASSERT(url);
for (i = 0; old_desc && (i < old_desc->nelts); i++)
{
@@ -1139,7 +1122,7 @@ handle_externals_change(const char *loca
new_item = apr_hash_get(new_desc_hash, old_item->target_dir,
APR_HASH_KEY_STRING);
- SVN_ERR(handle_external_item_change_wrapper(&ib, local_abspath, url,
+ SVN_ERR(handle_external_item_change_wrapper(ib, local_abspath, url,
target_abspath,
old_item, new_item,
iterpool));
@@ -1164,7 +1147,7 @@ handle_externals_change(const char *loca
new_item->target_dir,
iterpool);
- SVN_ERR(handle_external_item_change_wrapper(&ib, local_abspath, url,
+ SVN_ERR(handle_external_item_change_wrapper(ib, local_abspath, url,
target_abspath,
NULL, new_item,
iterpool));
@@ -1183,7 +1166,6 @@ svn_client__handle_externals(apr_hash_t
apr_hash_t *ambient_depths,
const char *repos_root_url,
svn_depth_t requested_depth,
- svn_boolean_t delete_only,
svn_boolean_t *timestamp_sleep,
svn_client_ctx_t *ctx,
apr_pool_t *scratch_pool)
@@ -1191,6 +1173,15 @@ svn_client__handle_externals(apr_hash_t
apr_hash_t *combined;
apr_hash_index_t *hi;
apr_pool_t *iterpool;
+ struct item_change_baton_t ib;
+
+ SVN_ERR_ASSERT(repos_root_url);
+
+ ib.repos_root_url = repos_root_url;
+ ib.ctx = ctx;
+ ib.native_eol = NULL;
+ ib.timestamp_sleep = timestamp_sleep;
+ ib.is_export = FALSE;
if (! externals_old)
combined = externals_new;
@@ -1232,14 +1223,11 @@ svn_client__handle_externals(apr_hash_t
}
SVN_ERR(handle_externals_change(
+ &ib,
svn__apr_hash_index_key(hi),
externals_old ? apr_hash_get(externals_old, key, klen) : NULL,
externals_new ? apr_hash_get(externals_new, key, klen) : NULL,
ambient_depth, requested_depth,
- repos_root_url,
- delete_only,
- timestamp_sleep,
- ctx,
iterpool));
}
@@ -1271,7 +1259,6 @@ svn_client__export_externals(apr_hash_t
ib.native_eol = native_eol;
ib.timestamp_sleep = timestamp_sleep;
ib.is_export = TRUE;
- ib.delete_only = FALSE;
for (hi = apr_hash_first(scratch_pool, externals);
hi;
Modified: subversion/trunk/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/switch.c?rev=1102886&r1=1102885&r2=1102886&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/switch.c (original)
+++ subversion/trunk/subversion/libsvn_client/switch.c Fri May 13 20:16:43 2011
@@ -290,7 +290,7 @@ switch_internal(svn_revnum_t *result_rev
err = svn_client__handle_externals(efb.externals_old,
efb.externals_new, efb.ambient_depths,
source_root,
- depth, FALSE, use_sleep, ctx, pool);
+ depth, use_sleep, ctx, pool);
}
/* Sleep to ensure timestamp integrity (we do this regardless of
Modified: subversion/trunk/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/update.c?rev=1102886&r1=1102885&r2=1102886&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/update.c (original)
+++ subversion/trunk/subversion/libsvn_client/update.c Fri May 13 20:16:43 2011
@@ -293,7 +293,7 @@ update_internal(svn_revnum_t *result_rev
efb.externals_new,
efb.ambient_depths,
repos_root,
- depth, FALSE, use_sleep,
+ depth, use_sleep,
ctx, pool));
}
Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=1102886&r1=1102885&r2=1102886&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Fri May 13 20:16:43 2011
@@ -119,7 +119,6 @@ process_committed_leaf(svn_wc__db_t *db,
svn_boolean_t no_unlock,
svn_boolean_t keep_changelist,
const svn_checksum_t *checksum,
- apr_hash_t *old_externals,
apr_pool_t *scratch_pool)
{
svn_wc__db_status_t status;
@@ -217,40 +216,6 @@ process_committed_leaf(svn_wc__db_t *db,
prop_mods,
scratch_pool, scratch_pool));
}
- else
- {
- /* Handle svn:externals changes */
- if (have_base && !have_work
- && prop_mods && had_props
- && old_externals)
- {
- apr_hash_t *props;
- const svn_string_t *val;
-
- /* We are committing a property modification to a not-shadoweded
- directory, which might be an svn:externals change.
-
- BH: I think this is the only kind of change we have to capture.
- (If the node is shadowed it's definition wasn't currently in
- used anyway) */
- SVN_ERR(svn_wc__db_base_get_props(&props, db, local_abspath,
- scratch_pool, scratch_pool));
-
- val = props ? apr_hash_get(props, SVN_PROP_EXTERNALS,
- APR_HASH_KEY_STRING)
- : NULL;
-
- if (val)
- {
- apr_pool_t *hash_pool = apr_hash_pool_get(old_externals);
-
- apr_hash_set(old_externals, apr_pstrdup(hash_pool,
- local_abspath),
- APR_HASH_KEY_STRING,
- svn_string_dup(val, hash_pool));
- }
- }
- }
/* The new text base will be found in the pristine store by its checksum. */
SVN_ERR(svn_wc__db_global_commit(db, local_abspath,
@@ -281,7 +246,6 @@ svn_wc__process_committed_internal(svn_w
svn_boolean_t keep_changelist,
const svn_checksum_t *sha1_checksum,
const svn_wc_committed_queue_t *queue,
- apr_hash_t *old_externals,
apr_pool_t *scratch_pool)
{
svn_wc__db_kind_t kind;
@@ -293,7 +257,7 @@ svn_wc__process_committed_internal(svn_w
new_revnum, new_date, rev_author,
new_dav_cache,
no_unlock, keep_changelist,
- sha1_checksum, old_externals,
+ sha1_checksum,
scratch_pool));
/* Only check kind after processing the node itself. The node might
@@ -362,7 +326,6 @@ svn_wc__process_committed_internal(svn_w
keep_changelist,
sha1_checksum,
queue,
- old_externals,
iterpool));
}
@@ -482,8 +445,6 @@ svn_wc_process_committed_queue2(svn_wc_c
svn_revnum_t new_revnum,
const char *rev_date,
const char *rev_author,
- svn_wc_external_update_t external_func,
- void *external_baton,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
@@ -494,10 +455,6 @@ svn_wc_process_committed_queue2(svn_wc_c
apr_time_t new_date;
apr_hash_t *run_wqs = apr_hash_make(scratch_pool);
apr_hash_index_t *hi;
- apr_hash_t *old_externals = NULL;
-
- if (external_func)
- old_externals = apr_hash_make(scratch_pool);
if (rev_date)
SVN_ERR(svn_time_from_cstring(&new_date, rev_date, iterpool));
@@ -533,7 +490,6 @@ svn_wc_process_committed_queue2(svn_wc_c
cqi->no_unlock,
cqi->keep_changelist,
cqi->sha1_checksum, queue,
- old_externals,
iterpool));
/* Don't run the wq now, but remember that we must call it for this
@@ -555,34 +511,8 @@ svn_wc_process_committed_queue2(svn_wc_c
/* Ok; everything is committed now. Now we can start calling callbacks */
- /* Are there changed externals definitions that we should report? */
- if (old_externals != NULL && apr_hash_count(old_externals) > 0)
- {
- for (hi = apr_hash_first(scratch_pool, old_externals);
- hi;
- hi = apr_hash_next(hi))
- {
- apr_hash_t *node_props;
- const char *local_abspath = svn__apr_hash_index_key(hi);
- const svn_string_t *old_val = svn__apr_hash_index_val(hi);
- const svn_string_t *new_val = NULL;
-
- svn_pool_clear(iterpool);
-
- SVN_ERR(svn_wc__db_base_get_props(&node_props, wc_ctx->db,
- local_abspath,
- iterpool, iterpool));
-
- if (node_props)
- new_val = apr_hash_get(node_props, SVN_PROP_EXTERNALS,
- APR_HASH_KEY_STRING);
-
- SVN_ERR(external_func(external_baton, local_abspath,
- old_val, new_val, svn_depth_unknown,
- iterpool));
-
- }
- }
+ if (cancel_func)
+ SVN_ERR(cancel_func(cancel_baton));
for (hi = apr_hash_first(scratch_pool, run_wqs);
hi;
Modified: subversion/trunk/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/deprecated.c?rev=1102886&r1=1102885&r2=1102886&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_wc/deprecated.c Fri May 13 20:16:43 2011
@@ -648,7 +648,7 @@ svn_wc_process_committed_queue(svn_wc_co
pool));
SVN_ERR(svn_wc_process_committed_queue2(queue, wc_ctx, new_revnum,
rev_date, rev_author,
- NULL, NULL, NULL, NULL, pool));
+ NULL, NULL, pool));
SVN_ERR(svn_wc_context_destroy(wc_ctx));
return SVN_NO_ERROR;
@@ -707,7 +707,7 @@ svn_wc_process_committed4(const char *pa
new_revnum, new_date, rev_author,
wcprop_changes_hash,
!remove_lock, !remove_changelist,
- sha1_checksum, NULL, NULL, pool));
+ sha1_checksum, NULL, pool));
/* Run the log file(s) we just created. */
return svn_error_return(svn_wc__wq_run(db, local_abspath, NULL, NULL, pool));
Modified: subversion/trunk/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc.h?rev=1102886&r1=1102885&r2=1102886&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc.h Fri May 13 20:16:43 2011
@@ -255,9 +255,6 @@ svn_wc__get_committed_queue_pool(const s
* If @a sha1_checksum is non-NULL, use it to identify the node's pristine
* text.
*
- * If @a old_externals is non-NULL, store the old version of just removed
- * svn:externals definitions on unshadowed directories in @a old_externals.
- *
* Set TOP_OF_RECURSE to TRUE to show that this the top of a possibly
* recursive commit operation.
*/
@@ -274,7 +271,6 @@ svn_wc__process_committed_internal(svn_w
svn_boolean_t keep_changelist,
const svn_checksum_t *sha1_checksum,
const svn_wc_committed_queue_t *queue,
- apr_hash_t *old_externals,
apr_pool_t *scratch_pool);
Modified: subversion/trunk/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/externals_tests.py?rev=1102886&r1=1102885&r2=1102886&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/externals_tests.py Fri May 13 20:16:43 2011
@@ -1177,6 +1177,7 @@ def binary_file_externals(sbox):
#----------------------------------------------------------------------
# Issue #3351.
+@XFail()
@Issue(3351)
def update_lose_file_external(sbox):
"delete a file external"
@@ -1226,12 +1227,10 @@ def update_lose_file_external(sbox):
# commit the property change
expected_output = svntest.wc.State(wc_dir, {
'A/C' : Item(verb='Sending'),
- 'A/C/external' : Item(verb='Removed external'),
})
# (re-use above expected_status)
expected_status.tweak('A/C', wc_rev = 3)
- expected_status.remove('A/C/external')
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)