On Sun, Apr 24, 2011 at 6:09 AM, <rhuijben_at_apache.org> wrote:
> Author: rhuijben
> Date: Sun Apr 24 11:09:29 2011
> New Revision: 1096306
>
> URL: http://svn.apache.org/viewvc?rev=1096306&view=rev
> Log:
> At popular request: allow api users to choose whether they want to apply local
> property changes when updating and switching.
>
> This doesn't change the 'svn' behavior (yet), but it allows tools like TSVN to
> take advantage of this feature.
>
> This mostly reverts r1095130.
>
> * subversion/bindings/javahl/native/SVNClient.cpp
> (SVNClient::update): Update caller.
There was also a change to SVNClient::doSwitch().
>
> * subversion/include/svn_client.h
> (svn_client_update4,
> svn_client_switch3): Add argument. Update documentation.
>
> * subversion/libsvn_client/checkout.c
> (svn_client__checkout_internal): Update caller.
>
> * subversion/libsvn_client/client.h
> (svn_client__update_internal,
> svn_client__switch_internal): Add argument. Reorder arguments to regain
> some sense.
> (svn_client__gather_local_external_changes): New function, copied from
> pre r1095130.
>
> * subversion/libsvn_client/deprecated.c
> (svn_client_update3,
> svn_client_switch2,
> svn_client_switch): Update callers.
>
> * subversion/libsvn_client/externals.c
> (switch_dir_external.
> switch_file_external): Update caller.
> (svn_client__gather_local_external_changes): New function.
>
> * subversion/libsvn_client/switch.c
> (switch_internal): Update arguments. Gather local externals changes.
> (svn_client__switch_internal): Update arguments. Update caller.
> (svn_client_switch3): Update arguments. Update caller.
>
> * subversion/libsvn_client/update.c
> (update_internal): Update arguments. Gather local externals changes.
> (svn_client__update_internal): Update arguments. Update caller.
> (svn_client_update4): Update arguments. Update caller.
>
> * subversion/svn/switch-cmd.c
> (svn_cl__switch): Update caller.
>
> * subversion/svn/update-cmd.c
> (svn_cl__update): Update caller.
>
> * subversion/tests/cmdline/externals_tests.py
> (update_external_on_locally_added_dir): New function; XFail. (Brought back)
>
> * subversion/tests/libsvn_wc/op-depth-test.c
> (wc_update): Update caller.
>
> Modified:
> subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp
> subversion/trunk/subversion/include/svn_client.h
> subversion/trunk/subversion/libsvn_client/checkout.c
> subversion/trunk/subversion/libsvn_client/client.h
> subversion/trunk/subversion/libsvn_client/deprecated.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/svn/switch-cmd.c
> subversion/trunk/subversion/svn/update-cmd.c
> subversion/trunk/subversion/tests/cmdline/externals_tests.py
> subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
>
> Modified: subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp?rev=1096306&r1=1096305&r2=1096306&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp (original)
> +++ subversion/trunk/subversion/bindings/javahl/native/SVNClient.cpp Sun Apr 24 11:09:29 2011
> @@ -341,7 +341,7 @@ jlongArray SVNClient::update(Targets &ta
> ignoreExternals,
> allowUnverObstructions,
> TRUE /* adds_as_modification */,
> - makeParents,
> + FALSE, makeParents,
> ctx, requestPool.pool()),
> NULL);
>
> @@ -543,6 +543,7 @@ jlong SVNClient::doSwitch(const char *pa
> ignoreExternals,
> allowUnverObstructions,
> ignoreAncestry,
> + FALSE,
> ctx,
> requestPool.pool()),
> -1);
>
> Modified: subversion/trunk/subversion/include/svn_client.h
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h?rev=1096306&r1=1096305&r2=1096306&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/include/svn_client.h (original)
> +++ subversion/trunk/subversion/include/svn_client.h Sun Apr 24 11:09:29 2011
> @@ -1205,6 +1205,10 @@ svn_client_checkout(svn_revnum_t *result
> * files restored from text-base. If @a ctx->cancel_func is non-NULL, invoke
> * it passing @a ctx->cancel_baton at various places during the update.
> *
> + * If @a apply_local_external_modifications is TRUE, local versions of the
> + * svn:externals property are processed during update instead of their
> + * committed version.
> + *
> * Use @a pool for any temporary allocation.
> *
> * @todo Multiple Targets
> @@ -1229,6 +1233,7 @@ svn_client_update4(apr_array_header_t **
> svn_boolean_t ignore_externals,
> svn_boolean_t allow_unver_obstructions,
> svn_boolean_t adds_as_modification,
> + svn_boolean_t apply_local_external_modifications,
> svn_boolean_t make_parents,
> svn_client_ctx_t *ctx,
> apr_pool_t *pool);
> @@ -1337,6 +1342,11 @@ svn_client_update(svn_revnum_t *result_r
> * combination of @a url, @a peg_revision, and @a revision),
> * and returning #SVN_ERR_CLIENT_UNRELATED_RESOURCES if they
> * do not. If @c TRUE, no such sanity checks are performed.
> + *
> + * @param [in] a apply_local_external_modifications If @c TRUE, local versions
> + * of the svn:externals property are processed during switch
> + * instead of their committed version.
> + *
> * @param[in] ctx The standard client context, used for authentication and
> * notification. The notifier is invoked for paths affected by
> * the switch, and also for files which may be restored from the
> @@ -1367,6 +1377,7 @@ svn_client_switch3(svn_revnum_t *result_
> svn_boolean_t ignore_externals,
> svn_boolean_t allow_unver_obstructions,
> svn_boolean_t ignore_ancestry,
> + svn_boolean_t apply_local_external_modifications,
> svn_client_ctx_t *ctx,
> apr_pool_t *pool);
>
>
> Modified: subversion/trunk/subversion/libsvn_client/checkout.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/checkout.c?rev=1096306&r1=1096305&r2=1096306&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_client/checkout.c (original)
> +++ subversion/trunk/subversion/libsvn_client/checkout.c Sun Apr 24 11:09:29 2011
> @@ -218,8 +218,8 @@ svn_client__checkout_internal(svn_revnum
> ignore_externals,
> allow_unver_obstructions,
> TRUE /* adds_as_modification */,
> - use_sleep, innercheckout, FALSE,
> - ctx, pool);
> + FALSE, FALSE,
> + FALSE, use_sleep, ctx, pool);
> }
>
> if (err)
>
> Modified: subversion/trunk/subversion/libsvn_client/client.h
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/client.h?rev=1096306&r1=1096305&r2=1096306&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_client/client.h (original)
> +++ subversion/trunk/subversion/libsvn_client/client.h Sun Apr 24 11:09:29 2011
> @@ -492,9 +492,10 @@ svn_client__update_internal(svn_revnum_t
> svn_boolean_t ignore_externals,
> svn_boolean_t allow_unver_obstructions,
> svn_boolean_t adds_as_modification,
> - svn_boolean_t *timestamp_sleep,
> - svn_boolean_t innerupdate,
> svn_boolean_t make_parents,
> + svn_boolean_t apply_local_external_modifications,
> + svn_boolean_t innerupdate,
> + svn_boolean_t *timestamp_sleep,
> svn_client_ctx_t *ctx,
> apr_pool_t *pool);
>
> @@ -609,11 +610,12 @@ svn_client__switch_internal(svn_revnum_t
> const svn_opt_revision_t *revision,
> svn_depth_t depth,
> svn_boolean_t depth_is_sticky,
> - svn_boolean_t *timestamp_sleep,
> svn_boolean_t ignore_externals,
> svn_boolean_t allow_unver_obstructions,
> - svn_boolean_t innerswitch,
> + svn_boolean_t apply_local_external_modifications,
> svn_boolean_t ignore_ancestry,
> + svn_boolean_t innerswitch,
> + svn_boolean_t *timestamp_sleep,
> svn_client_ctx_t *ctx,
> apr_pool_t *pool);
>
> @@ -1007,6 +1009,24 @@ svn_client__crawl_for_externals(apr_hash
> apr_pool_t *result_pool,
> apr_pool_t *scratch_pool);
>
> +/* Helper function to fix issue #2267,
> + * "support svn:externals on locally added directories".
> + *
> + * Crawl all externals beneath ANCHOR_ABSPATH (this is cheap because we're
> + * only crawling the WC DB itself). If there are externals within the
> + * REQUESTED_DEPTH that weren't already picked up while we were crawling
> + * the BASE tree, add them to the EXTERNALS_NEW hash with ambient depth
> + * infinity. Facilitates populating externals in locally added directories.
> + *
> + * ### This is a bit of a hack. We should try to find a better solution
> + * ### to this problem. */
> +svn_error_t *
> +svn_client__gather_local_external_changes(apr_hash_t *externals_new,
> + apr_hash_t *ambient_depths,
> + const char *anchor_abspath,
> + svn_depth_t requested_depth,
> + svn_client_ctx_t *ctx,
> + apr_pool_t *scratch_pool);
>
> /* Baton type for svn_wc__external_info_gatherer(). */
> typedef struct svn_client__external_func_baton_t
>
> Modified: subversion/trunk/subversion/libsvn_client/deprecated.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/deprecated.c?rev=1096306&r1=1096305&r2=1096306&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_client/deprecated.c (original)
> +++ subversion/trunk/subversion/libsvn_client/deprecated.c Sun Apr 24 11:09:29 2011
> @@ -1876,7 +1876,8 @@ svn_client_update3(apr_array_header_t **
> {
> return svn_client_update4(result_revs, paths, revision,
> depth, depth_is_sticky, ignore_externals,
> - allow_unver_obstructions, TRUE, FALSE, ctx, pool);
> + allow_unver_obstructions, TRUE, FALSE, FALSE,
> + ctx, pool);
> }
>
> svn_error_t *
> @@ -1930,7 +1931,7 @@ svn_client_switch2(svn_revnum_t *result_
> {
> return svn_client_switch3(result_rev, path, switch_url, peg_revision,
> revision, depth, depth_is_sticky, ignore_externals,
> - allow_unver_obstructions, TRUE, ctx, pool);
> + allow_unver_obstructions, TRUE, FALSE, ctx, pool);
> }
>
> svn_error_t *
> @@ -1944,11 +1945,10 @@ svn_client_switch(svn_revnum_t *result_r
> {
> svn_opt_revision_t peg_revision;
> peg_revision.kind = svn_opt_revision_unspecified;
> - return svn_client__switch_internal(result_rev, path, switch_url,
> - &peg_revision, revision,
> - SVN_DEPTH_INFINITY_OR_FILES(recurse),
> - FALSE, NULL, FALSE, FALSE, FALSE, TRUE,
> - ctx, pool);
> + return svn_client_switch2(result_rev, path, switch_url,
> + &peg_revision, revision,
> + SVN_DEPTH_INFINITY_OR_FILES(recurse),
> + FALSE, FALSE, FALSE, ctx, pool);
> }
>
> /*** From cat.c ***/
>
> Modified: subversion/trunk/subversion/libsvn_client/externals.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/externals.c?rev=1096306&r1=1096305&r2=1096306&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_client/externals.c (original)
> +++ subversion/trunk/subversion/libsvn_client/externals.c Sun Apr 24 11:09:29 2011
> @@ -206,7 +206,8 @@ switch_dir_external(const char *path,
> SVN_ERR(svn_client__update_internal(NULL, local_abspath,
> revision, svn_depth_unknown,
> FALSE, FALSE, FALSE, TRUE,
> - timestamp_sleep, TRUE, FALSE,
> + FALSE, FALSE, TRUE,
> + timestamp_sleep,
> ctx, subpool));
> svn_pool_destroy(subpool);
> return SVN_NO_ERROR;
> @@ -251,8 +252,9 @@ switch_dir_external(const char *path,
> SVN_ERR(svn_client__switch_internal(NULL, path, url,
> peg_revision, revision,
> svn_depth_infinity,
> - TRUE, timestamp_sleep,
> - FALSE, FALSE, TRUE, TRUE,
> + TRUE, FALSE, FALSE,
> + FALSE, TRUE, TRUE,
> + timestamp_sleep,
> ctx, subpool));
>
> svn_pool_destroy(subpool);
> @@ -448,11 +450,12 @@ switch_file_external(const char *path,
> err = svn_client__switch_internal(NULL, path, url, peg_revision, revision,
> svn_depth_empty,
> FALSE, /* depth_is_sticky */
> - timestamp_sleep,
> TRUE, /* ignore_externals */
> FALSE, /* allow_unver_obstructions */
> - FALSE, /* innerswitch */
> + FALSE, /* apply_local_external_mods */
> TRUE, /* ignore_ancestry */
> + FALSE, /* innerswitch */
> + timestamp_sleep,
> ctx,
> pool);
> if (err)
> @@ -1458,3 +1461,45 @@ svn_client__crawl_for_externals(apr_hash
> *externals_p = externals_hash;
> return SVN_NO_ERROR;
> }
> +
> +svn_error_t *
> +svn_client__gather_local_external_changes(apr_hash_t *externals_new,
> + apr_hash_t *ambient_depths,
> + const char *anchor_abspath,
> + svn_depth_t requested_depth,
> + svn_client_ctx_t *ctx,
> + apr_pool_t *scratch_pool)
> +{
> + apr_hash_t *all_externals;
> + apr_hash_index_t *hi;
> +
> + /* If there was no requested depth for this operation, use infinity.
> + * svn_client__crawl_for_externals() doesn't like depth 'unknown'. */
> + if (requested_depth == svn_depth_unknown)
> + requested_depth = svn_depth_infinity;
> +
> + SVN_ERR(svn_client__crawl_for_externals(&all_externals, anchor_abspath,
> + requested_depth, ctx, scratch_pool,
> + scratch_pool));
> +
> + for (hi = apr_hash_first(scratch_pool, all_externals);
> + hi;
> + hi = apr_hash_next(hi))
> + {
> + const char *local_abspath = svn__apr_hash_index_key(hi);
> +
> + if (! apr_hash_get(externals_new, local_abspath, APR_HASH_KEY_STRING))
> + {
> + apr_pool_t *hash_pool = apr_hash_pool_get(externals_new);
> + svn_string_t *propval = svn__apr_hash_index_val(hi);
> +
> + apr_hash_set(externals_new, local_abspath, APR_HASH_KEY_STRING,
> + apr_pstrdup(hash_pool, propval->data));
> + apr_hash_set(ambient_depths, local_abspath, APR_HASH_KEY_STRING,
> + svn_depth_to_word(svn_depth_infinity));
> + }
> + }
> +
> + return SVN_NO_ERROR;
> +}
> +
>
> Modified: subversion/trunk/subversion/libsvn_client/switch.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/switch.c?rev=1096306&r1=1096305&r2=1096306&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_client/switch.c (original)
> +++ subversion/trunk/subversion/libsvn_client/switch.c Sun Apr 24 11:09:29 2011
> @@ -64,11 +64,12 @@ switch_internal(svn_revnum_t *result_rev
> const svn_opt_revision_t *revision,
> svn_depth_t depth,
> svn_boolean_t depth_is_sticky,
> - svn_boolean_t *timestamp_sleep,
> svn_boolean_t ignore_externals,
> svn_boolean_t allow_unver_obstructions,
> - svn_boolean_t innerswitch,
> svn_boolean_t ignore_ancestry,
> + svn_boolean_t apply_local_external_modifications,
> + svn_boolean_t innerswitch,
> + svn_boolean_t *timestamp_sleep,
> svn_client_ctx_t *ctx,
> apr_pool_t *pool)
> {
> @@ -267,6 +268,11 @@ switch_internal(svn_revnum_t *result_rev
> the primary operation. */
> if (SVN_DEPTH_IS_RECURSIVE(depth) && (! ignore_externals))
> {
> + if (apply_local_external_modifications)
> + SVN_ERR(svn_client__gather_local_external_changes(
> + efb.externals_new, efb.ambient_depths, local_abspath,
> + depth, ctx, pool));
> +
> err = svn_client__handle_externals(efb.externals_old,
> efb.externals_new, efb.ambient_depths,
> svn_dirent_join(anchor_abspath,
> @@ -313,11 +319,12 @@ svn_client__switch_internal(svn_revnum_t
> const svn_opt_revision_t *revision,
> svn_depth_t depth,
> svn_boolean_t depth_is_sticky,
> - svn_boolean_t *timestamp_sleep,
> svn_boolean_t ignore_externals,
> svn_boolean_t allow_unver_obstructions,
> - svn_boolean_t innerswitch,
> + svn_boolean_t apply_local_external_modifications,
> svn_boolean_t ignore_ancestry,
> + svn_boolean_t innerswitch,
> + svn_boolean_t *timestamp_sleep,
> svn_client_ctx_t *ctx,
> apr_pool_t *pool)
> {
> @@ -343,9 +350,10 @@ svn_client__switch_internal(svn_revnum_t
> err1 = switch_internal(result_rev, local_abspath, anchor_abspath,
> switch_url, peg_revision, revision,
> depth, depth_is_sticky,
> - timestamp_sleep, ignore_externals,
> - allow_unver_obstructions, innerswitch,
> - ignore_ancestry, ctx, pool);
> + ignore_externals,
> + allow_unver_obstructions, ignore_ancestry,
> + apply_local_external_modifications, innerswitch,
> + timestamp_sleep, ctx, pool);
>
> if (acquired_lock)
> err2 = svn_wc__release_write_lock(ctx->wc_ctx, anchor_abspath, pool);
> @@ -366,6 +374,7 @@ svn_client_switch3(svn_revnum_t *result_
> svn_boolean_t ignore_externals,
> svn_boolean_t allow_unver_obstructions,
> svn_boolean_t ignore_ancestry,
> + svn_boolean_t apply_local_external_modifications,
> svn_client_ctx_t *ctx,
> apr_pool_t *pool)
> {
> @@ -375,7 +384,9 @@ svn_client_switch3(svn_revnum_t *result_
>
> return svn_client__switch_internal(result_rev, path, switch_url,
> peg_revision, revision, depth,
> - depth_is_sticky, NULL, ignore_externals,
> - allow_unver_obstructions, FALSE,
> - ignore_ancestry, ctx, pool);
> + depth_is_sticky, ignore_externals,
> + allow_unver_obstructions,
> + apply_local_external_modifications,
> + ignore_ancestry,
> + FALSE, NULL, ctx, pool);
> }
>
> Modified: subversion/trunk/subversion/libsvn_client/update.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/update.c?rev=1096306&r1=1096305&r2=1096306&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_client/update.c (original)
> +++ subversion/trunk/subversion/libsvn_client/update.c Sun Apr 24 11:09:29 2011
> @@ -66,8 +66,9 @@ update_internal(svn_revnum_t *result_rev
> svn_boolean_t ignore_externals,
> svn_boolean_t allow_unver_obstructions,
> svn_boolean_t adds_as_modification,
> - svn_boolean_t *timestamp_sleep,
> + svn_boolean_t apply_local_external_modifications,
> svn_boolean_t innerupdate,
> + svn_boolean_t *timestamp_sleep,
> svn_boolean_t notify_summary,
> svn_client_ctx_t *ctx,
> apr_pool_t *pool)
> @@ -284,6 +285,10 @@ update_internal(svn_revnum_t *result_rev
> the primary operation. */
> if (SVN_DEPTH_IS_RECURSIVE(depth) && (! ignore_externals))
> {
> + if (apply_local_external_modifications)
> + SVN_ERR(svn_client__gather_local_external_changes(
> + efb.externals_new, efb.ambient_depths, anchor_abspath,
> + depth, ctx, pool));
> SVN_ERR(svn_client__handle_externals(efb.externals_old,
> efb.externals_new,
> efb.ambient_depths,
> @@ -327,9 +332,10 @@ svn_client__update_internal(svn_revnum_t
> svn_boolean_t ignore_externals,
> svn_boolean_t allow_unver_obstructions,
> svn_boolean_t adds_as_modification,
> - svn_boolean_t *timestamp_sleep,
> - svn_boolean_t innerupdate,
> svn_boolean_t make_parents,
> + svn_boolean_t apply_local_external_modifications,
> + svn_boolean_t innerupdate,
> + svn_boolean_t *timestamp_sleep,
> svn_client_ctx_t *ctx,
> apr_pool_t *pool)
> {
> @@ -379,8 +385,10 @@ svn_client__update_internal(svn_revnum_t
> err = update_internal(result_rev, missing_parent, anchor_abspath,
> &peg_revision, svn_depth_empty, FALSE,
> ignore_externals, allow_unver_obstructions,
> - adds_as_modification, timestamp_sleep,
> - innerupdate, FALSE, ctx, pool);
> + adds_as_modification,
> + apply_local_external_modifications,
> + innerupdate, timestamp_sleep,
> + FALSE, ctx, pool);
> if (err)
> goto cleanup;
> anchor_abspath = missing_parent;
> @@ -404,7 +412,10 @@ svn_client__update_internal(svn_revnum_t
> &peg_revision, depth, depth_is_sticky,
> ignore_externals, allow_unver_obstructions,
> adds_as_modification,
> - timestamp_sleep, innerupdate, TRUE, ctx, pool);
> + apply_local_external_modifications,
> + innerupdate,
> + timestamp_sleep,
> + TRUE, ctx, pool);
> cleanup:
> err = svn_error_compose_create(
> err,
> @@ -423,6 +434,7 @@ svn_client_update4(apr_array_header_t **
> svn_boolean_t ignore_externals,
> svn_boolean_t allow_unver_obstructions,
> svn_boolean_t adds_as_modification,
> + svn_boolean_t apply_local_external_modifications,
> svn_boolean_t make_parents,
> svn_client_ctx_t *ctx,
> apr_pool_t *pool)
> @@ -462,7 +474,9 @@ svn_client_update4(apr_array_header_t **
> ignore_externals,
> allow_unver_obstructions,
> adds_as_modification,
> - &sleep, FALSE, make_parents,
> + make_parents,
> + apply_local_external_modifications,
> + FALSE, &sleep,
> ctx, subpool);
>
> if (err)
>
> Modified: subversion/trunk/subversion/svn/switch-cmd.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/switch-cmd.c?rev=1096306&r1=1096305&r2=1096306&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/svn/switch-cmd.c (original)
> +++ subversion/trunk/subversion/svn/switch-cmd.c Sun Apr 24 11:09:29 2011
> @@ -177,6 +177,7 @@ svn_cl__switch(apr_getopt_t *os,
> &(opt_state->start_revision), depth,
> depth_is_sticky, opt_state->ignore_externals,
> opt_state->force, opt_state->ignore_ancestry,
> + FALSE /* apply_local_external_modifications */,
> ctx, scratch_pool);
> if (err)
> {
>
> Modified: subversion/trunk/subversion/svn/update-cmd.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/update-cmd.c?rev=1096306&r1=1096305&r2=1096306&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/svn/update-cmd.c (original)
> +++ subversion/trunk/subversion/svn/update-cmd.c Sun Apr 24 11:09:29 2011
> @@ -167,6 +167,7 @@ svn_cl__update(apr_getopt_t *os,
> depth, depth_is_sticky,
> opt_state->ignore_externals,
> opt_state->force, TRUE /* adds_as_modification */,
> + FALSE /* apply_local_external_modifications */,
> opt_state->parents,
> ctx, 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=1096306&r1=1096305&r2=1096306&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/tests/cmdline/externals_tests.py (original)
> +++ subversion/trunk/subversion/tests/cmdline/externals_tests.py Sun Apr 24 11:09:29 2011
> @@ -1579,6 +1579,97 @@ def update_modify_file_external(sbox):
> None, None, None, None, None,
> True)
>
> +# Test for issue #2267
> +@Issue(2267)
> +@XFail() # Needs new commandline option
> +def update_external_on_locally_added_dir(sbox):
> + "update an external on a locally added dir"
> +
> + external_url_for = externals_test_setup(sbox)
> + wc_dir = sbox.wc_dir
> +
> + repo_url = sbox.repo_url
> + other_repo_url = repo_url + ".other"
> +
> + # Checkout a working copy
> + svntest.actions.run_and_verify_svn(None, None, [],
> + 'checkout',
> + repo_url, wc_dir)
> +
> + # Add one new external item to the property on A/foo. The new item is
> + # "exdir_E", deliberately added in the middle not at the end.
> + new_externals_desc = \
> + external_url_for["A/D/exdir_A"] + " exdir_A" + \
> + "\n" + \
> + external_url_for["A/D/exdir_A/G/"] + " exdir_A/G/" + \
> + "\n" + \
> + "exdir_E " + other_repo_url + "/A/B/E" + \
> + "\n" + \
> + "exdir_A/H -r 1 " + external_url_for["A/D/exdir_A/H"] + \
> + "\n" + \
> + external_url_for["A/D/x/y/z/blah"] + " x/y/z/blah" + \
> + "\n"
> +
> + # Add A/foo and set the property on it
> + new_dir = sbox.ospath("A/foo")
> + sbox.simple_mkdir("A/foo")
> + change_external(new_dir, new_externals_desc, commit=False)
> +
> + # Update the working copy, see if we get the new item.
> + svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
> +
> + probe_paths_exist([os.path.join(wc_dir, "A", "foo", "exdir_E")])
> +
> +# Test for issue #2267
> +@Issue(2267)
> +@XFail() # Needs new commandline option
> +def switch_external_on_locally_added_dir(sbox):
> + "switch an external on a locally added dir"
> +
> + external_url_for = externals_test_setup(sbox)
> + wc_dir = sbox.wc_dir
> +
> + repo_url = sbox.repo_url
> + other_repo_url = repo_url + ".other"
> + A_path = repo_url + "/A"
> + A_copy_path = repo_url + "/A_copy"
> +
> + # Create a branch of A
> + # Checkout a working copy
> + svntest.actions.run_and_verify_svn(None, None, [],
> + 'copy',
> + A_path, A_copy_path,
> + '-m', 'Create branch of A')
> +
> + # Checkout a working copy
> + svntest.actions.run_and_verify_svn(None, None, [],
> + 'checkout',
> + A_path, wc_dir)
> +
> + # Add one new external item to the property on A/foo. The new item is
> + # "exdir_E", deliberately added in the middle not at the end.
> + new_externals_desc = \
> + external_url_for["A/D/exdir_A"] + " exdir_A" + \
> + "\n" + \
> + external_url_for["A/D/exdir_A/G/"] + " exdir_A/G/" + \
> + "\n" + \
> + "exdir_E " + other_repo_url + "/A/B/E" + \
> + "\n" + \
> + "exdir_A/H -r 1 " + external_url_for["A/D/exdir_A/H"] + \
> + "\n" + \
> + external_url_for["A/D/x/y/z/blah"] + " x/y/z/blah" + \
> + "\n"
> +
> + # Add A/foo and set the property on it
> + new_dir = sbox.ospath("foo")
> + sbox.simple_mkdir("foo")
> + change_external(new_dir, new_externals_desc, commit=False)
> +
> + # Switch the working copy to the branch, see if we get the new item.
> + svntest.actions.run_and_verify_svn(None, None, [], 'sw', A_copy_path, wc_dir)
> +
> + probe_paths_exist([os.path.join(wc_dir, "foo", "exdir_E")])
> +
> @Issue(3819)
> def file_external_in_sibling(sbox):
> "update a file external in sibling dir"
> @@ -1641,6 +1732,8 @@ test_list = [ None,
> wc_repos_file_externals,
> merge_target_with_externals,
> update_modify_file_external,
> + update_external_on_locally_added_dir,
> + switch_external_on_locally_added_dir,
> file_external_in_sibling,
> file_external_update_without_commit,
> ]
>
> Modified: subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c?rev=1096306&r1=1096305&r2=1096306&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
> +++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Sun Apr 24 11:09:29 2011
> @@ -217,7 +217,8 @@ wc_update(svn_test__sandbox_t *b, const
> APR_ARRAY_PUSH(paths, const char *) = wc_path(b, path);
> SVN_ERR(svn_client_create_context(&ctx, b->pool));
> return svn_client_update4(&result_revs, paths, &revision, svn_depth_infinity,
> - TRUE, FALSE, FALSE, FALSE, FALSE, ctx, b->pool);
> + TRUE, FALSE, FALSE, FALSE, FALSE, FALSE,
> + ctx, b->pool);
> }
>
> static svn_error_t *
>
>
>
Received on 2011-04-25 20:39:57 CEST