[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1091187 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_client/switch.c libsvn_client/update.c libsvn_wc/deprecated.c libsvn_wc/update_editor.c

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Tue, 12 Apr 2011 17:03:13 +0100

Hi Bert. A question about the "server handles [depth] filtering"
flag...

On Mon, 2011-04-11, rhuijben_at_apache.org wrote:
> Author: rhuijben
> Date: Mon Apr 11 19:58:27 2011
> New Revision: 1091187
>
> URL: http://svn.apache.org/viewvc?rev=1091187&view=rev
> Log:
> Update the svn_wc_get_update_editor3() and svn_wc_get_switch_editor3() apis
> to accept two new booleans: One to allow disabling the automatic conversion
> of local additions into modifications and one to allow disabling the depth
> filter (Which is only needed when talking to pre 1.5 servers).
>
> Disabling the depth filter allows avoiding many db operations (should be set by
> libsvn_client when it knows the server understands depth), while the local
> additions filter is for clients that prefer to explicitly handle tree
> conflicts over the update editor magic.
>
> * subversion/include/svn_wc.h
> (svn_wc_get_update_editor4): Update prototype and documentation
> (svn_wc_get_update_editor3): Update documentation.
> (svn_wc_get_update_switch4): Update prototype and documentation
> (svn_wc_get_update_switch3): Update documentation.
>
> * subversion/libsvn_client/switch.c
> (switch_internal): Update caller. Report that the server handles depth when
> depth is unknown.
[...]

> Modified: subversion/trunk/subversion/include/svn_wc.h
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1091187&r1=1091186&r2=1091187&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/include/svn_wc.h (original)
> +++ subversion/trunk/subversion/include/svn_wc.h Mon Apr 11 19:58:27 2011
> @@ -5302,6 +5302,9 @@ typedef svn_error_t *(*svn_wc_get_file_t
> * If @a allow_unver_obstructions is TRUE, then allow unversioned
> * obstructions when adding a path.
> *
> + * If @a adds_as_modification is TRUE, local additions are seen as a local
> + * modification of added nodes when the node kind matches.
> + *
> * If @a depth is #svn_depth_infinity, update fully recursively.
> * Else if it is #svn_depth_immediates, update the uppermost
> * directory, its file entries, and the presence or absence of
> @@ -5315,6 +5318,10 @@ typedef svn_error_t *(*svn_wc_get_file_t
> * #svn_depth_unknown, then in addition to updating PATHS, also set
> * their sticky ambient depth value to @a depth.
> *
> + * If @a repository_performs_filtering is TRUE, assume that the server handles
> + * the ambient depth filtering, so this doesn't have to be handled in the
> + * editor.
> + *
> * @since New in 1.7.
> */
> svn_error_t *
> @@ -5328,6 +5335,8 @@ svn_wc_get_update_editor4(const svn_delt
> svn_depth_t depth,
> svn_boolean_t depth_is_sticky,
> svn_boolean_t allow_unver_obstructions,
> + svn_boolean_t adds_as_modification,
> + svn_boolean_t server_performs_filtering,
> const char *diff3_cmd,
> const apr_array_header_t *preserved_exts,
> svn_wc_conflict_resolver_func_t conflict_func,
> @@ -5344,7 +5353,8 @@ svn_wc_get_update_editor4(const svn_delt
> /** Similar to svn_wc_get_update_editor4, but uses access batons and relative
> * path instead of a working copy context-abspath pair and
> * svn_wc_traversal_info_t instead of an externals callback. Also,
> - * @a fetch_func and @a fetch_baton are ignored.
> + * @a fetch_func and @a fetch_baton are ignored. Always sets
> + * server_performs_filtering to FALSE.
> *
> * If @a ti is non-NULL, record traversal info in @a ti, for use by
> * post-traversal accessors such as svn_wc_edited_externals().
> @@ -5352,6 +5362,9 @@ svn_wc_get_update_editor4(const svn_delt
> * All locks, both those in @a anchor and newly acquired ones, will be
> * released when the editor driver calls @c close_edit.
> *
> + * Always sets @a adds_as_modification to TRUE and @a server_performs_filtering
> + * to FALSE.
> + *
> * @since New in 1.5.
> * @deprecated Provided for backward compatibility with the 1.6 API.
> */
> @@ -5454,6 +5467,8 @@ svn_wc_get_switch_editor4(const svn_delt
> svn_depth_t depth,
> svn_boolean_t depth_is_sticky,
> svn_boolean_t allow_unver_obstructions,
> + svn_boolean_t adds_as_modification,
> + svn_boolean_t server_performs_filtering,
> const char *diff3_cmd,
> const apr_array_header_t *preserved_exts,
> svn_wc_conflict_resolver_func_t conflict_func,
> @@ -5477,6 +5492,9 @@ svn_wc_get_switch_editor4(const svn_delt
> * All locks, both those in @a anchor and newly acquired ones, will be
> * released when the editor driver calls @c close_edit.
> *
> + * Always sets @a adds_as_modification to TRUE and @a server_performs_filtering
> + * to FALSE.
> + *
> * @since New in 1.5.
> * @deprecated Provided for backward compatibility with the 1.6 API.
> */
>
> Modified: subversion/trunk/subversion/libsvn_client/switch.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/switch.c?rev=1091187&r1=1091186&r2=1091187&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_client/switch.c (original)
> +++ subversion/trunk/subversion/libsvn_client/switch.c Mon Apr 11 19:58:27 2011
> @@ -209,11 +209,18 @@ switch_internal(svn_revnum_t *result_rev
> efb.externals_old = apr_hash_make(pool);
> efb.ambient_depths = apr_hash_make(pool);
> efb.result_pool = pool;
> +
> + SVN_ERR(svn_ra_has_capability(ra_session, &server_supports_depth,
> + SVN_RA_CAPABILITY_DEPTH, pool));
> +
> SVN_ERR(svn_wc_get_switch_editor4(&switch_editor, &switch_edit_baton,
> &revnum, ctx->wc_ctx, anchor_abspath,
> target, switch_rev_url, use_commit_times,
> depth,
> depth_is_sticky, allow_unver_obstructions,
> + TRUE,
> + server_supports_depth
> + && (depth == svn_depth_unknown),

Why do you only pass this "server supports depth" knowledge on when the
requested depth is "unknown"? Does "server supports depth" not mean
quite the same as "server handles depth filtering"?

> diff3_cmd, preserved_exts,
> ctx->conflict_func, ctx->conflict_baton,
> svn_client__external_info_gatherer, &efb,
> @@ -227,9 +234,6 @@ switch_internal(svn_revnum_t *result_rev
> target, depth, switch_rev_url,
> switch_editor, switch_edit_baton, pool));
>
> - SVN_ERR(svn_ra_has_capability(ra_session, &server_supports_depth,
> - SVN_RA_CAPABILITY_DEPTH, pool));
> -
> /* Drive the reporter structure, describing the revisions within
> PATH. When we call reporter->finish_report, the update_editor
> will be driven by svn_repos_dir_delta2.
>
> Modified: subversion/trunk/subversion/libsvn_client/update.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/update.c?rev=1091187&r1=1091186&r2=1091187&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_client/update.c (original)
> +++ subversion/trunk/subversion/libsvn_client/update.c Mon Apr 11 19:58:27 2011
> @@ -224,12 +224,18 @@ update_internal(svn_revnum_t *result_rev
> efb.ambient_depths = apr_hash_make(pool);
> efb.result_pool = pool;
>
> + SVN_ERR(svn_ra_has_capability(ra_session, &server_supports_depth,
> + SVN_RA_CAPABILITY_DEPTH, pool));
> +
> /* Fetch the update editor. If REVISION is invalid, that's okay;
> the RA driver will call editor->set_target_revision later on. */
> SVN_ERR(svn_wc_get_update_editor4(&update_editor, &update_edit_baton,
> &revnum, ctx->wc_ctx, anchor_abspath,
> target, use_commit_times, depth,
> depth_is_sticky, allow_unver_obstructions,
> + TRUE,
> + server_supports_depth
> + && (depth == svn_depth_unknown),
> diff3_cmd, preserved_exts,
> ctx->conflict_func, ctx->conflict_baton,
> ignore_externals
> @@ -246,9 +252,6 @@ update_internal(svn_revnum_t *result_rev
> revnum, target, depth, FALSE,
> update_editor, update_edit_baton, pool));
>
> - SVN_ERR(svn_ra_has_capability(ra_session, &server_supports_depth,
> - SVN_RA_CAPABILITY_DEPTH, pool));
> -
> /* Drive the reporter structure, describing the revisions within
> PATH. When we call reporter->finish_report, the
> update_editor will be driven by svn_repos_dir_delta2. */
>
[...]
> Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1091187&r1=1091186&r2=1091187&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
> +++ subversion/trunk/subversion/libsvn_wc/update_editor.c Mon Apr 11 19:58:27 2011
[...]
> @@ -4368,9 +4376,9 @@ make_editor(svn_revnum_t *target_revisio
> But even what we do so might extend beyond the scope of our
> ambient depth. So we use another filtering editor to avoid
> modifying the ambient working copy depth when not asked to do so.
> - (This can also be skipped if the server understands depth; consider
> - letting the depth RA capability percolate down to this level.) */
> - if (!depth_is_sticky)
> + (This can also be skipped if the server understands depth.) */
> + if (!server_performs_filtering
> + && !depth_is_sticky)
> SVN_ERR(svn_wc__ambient_depth_filter_editor(&inner_editor,
> &inner_baton,
> wc_ctx->db,
[...]
Received on 2011-04-12 18:03:56 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.