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/04/24 10:52:46 UTC
svn commit: r1096285 - in /subversion/trunk/subversion: include/svn_wc.h
libsvn_client/status.c libsvn_wc/deprecated.c libsvn_wc/status.c
Author: rhuijben
Date: Sun Apr 24 08:52:45 2011
New Revision: 1096285
URL: http://svn.apache.org/viewvc?rev=1096285&view=rev
Log:
Following up on r1096279, make the status editor use the same kind of
client side ambient filtering as the diff and update editors in libsvn_wc.
Even though the code didn't wrap the editor before, make the filtering
default behavior for similarity with the other editors.
* subversion/include/svn_wc.h
(svn_wc_get_status_editor5): Add server_performs_filtering argument.
* subversion/libsvn_client/status.c
(svn_client_status5): Open ra session before creating the editor to allow
passing server_supports_depth.
* subversion/libsvn_wc/deprecated.c
(svn_wc_get_status_editor4): Pass FALSE for server_supports_depth.
* subversion/libsvn_wc/status.c
(svn_wc_get_status_editor5): Wrap the editor with an ambient depth filter
when server_performs_filtering is FALSE.
Modified:
subversion/trunk/subversion/include/svn_wc.h
subversion/trunk/subversion/libsvn_client/status.c
subversion/trunk/subversion/libsvn_wc/deprecated.c
subversion/trunk/subversion/libsvn_wc/status.c
Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1096285&r1=1096284&r2=1096285&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Sun Apr 24 08:52:45 2011
@@ -3933,6 +3933,10 @@ svn_wc_walk_status(svn_wc_context_t *wc_
* found, and with the current external definition provided as both
* the @a old_val and @a new_val parameters of the callback function.
*
+ * If @a server_performs_filtering is TRUE, assume that the server handles
+ * the ambient depth filtering, so this doesn't have to be handled in the
+ * editor.
+ *
* Allocate the editor itself in @a pool, but the editor does temporary
* allocations in a subpool of @a pool.
*
@@ -3949,6 +3953,7 @@ svn_wc_get_status_editor5(const svn_delt
svn_depth_t depth,
svn_boolean_t get_all,
svn_boolean_t no_ignore,
+ svn_boolean_t server_performs_filtering,
const apr_array_header_t *ignore_patterns,
svn_wc_status_func4_t status_func,
void *status_baton,
@@ -3961,9 +3966,11 @@ svn_wc_get_status_editor5(const svn_delt
/**
* Same as svn_wc_get_status_editor5, but using #svn_wc_status_func3_t
- * instead of #svn_wc_status_func4_t. This also uses a single pool
- * parameter, stating that all temporary allocations are performed in
- * manually constructed/destroyed subpool.
+ * instead of #svn_wc_status_func4_t. And @a server_performs_filtering
+ * always set to #TRUE.
+ *
+ * This also uses a single pool parameter, stating that all temporary
+ * allocations are performed in manually constructed/destroyed subpool.
*
* @since New in 1.6.
* @deprecated Provided for backward compatibility with the 1.6 API.
Modified: subversion/trunk/subversion/libsvn_client/status.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/status.c?rev=1096285&r1=1096284&r2=1096285&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/status.c (original)
+++ subversion/trunk/subversion/libsvn_client/status.c Sun Apr 24 08:52:45 2011
@@ -390,11 +390,21 @@ svn_client_status5(svn_revnum_t *result_
_("Entry '%s' has no URL"),
svn_dirent_local_style(dir, pool));
+ /* Open a repository session to the URL. */
+ SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL, URL,
+ dir_abspath,
+ NULL, FALSE, TRUE,
+ ctx, pool));
+
+ SVN_ERR(svn_ra_has_capability(ra_session, &server_supports_depth,
+ SVN_RA_CAPABILITY_DEPTH, pool));
+
SVN_ERR(svn_wc_get_status_editor5(&editor, &edit_baton, &set_locks_baton,
&edit_revision, ctx->wc_ctx,
dir_abspath, target_basename,
depth, get_all,
- no_ignore, ignores, tweak_status, &sb,
+ no_ignore, server_supports_depth,
+ ignores, tweak_status, &sb,
ignore_externals
? NULL
: svn_client__external_info_gatherer,
@@ -402,11 +412,6 @@ svn_client_status5(svn_revnum_t *result_
ctx->cancel_func, ctx->cancel_baton,
pool, pool));
- /* Open a repository session to the URL. */
- SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL, URL,
- dir_abspath,
- NULL, FALSE, TRUE,
- ctx, pool));
/* Verify that URL exists in HEAD. If it doesn't, this can save
us a whole lot of hassle; if it does, the cost of this
@@ -475,9 +480,6 @@ svn_client_status5(svn_revnum_t *result_
else
rb.depth = depth;
- 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,
EDITOR will be driven to describe differences between our
Modified: subversion/trunk/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/deprecated.c?rev=1096285&r1=1096284&r2=1096285&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_wc/deprecated.c Sun Apr 24 08:52:45 2011
@@ -2520,7 +2520,9 @@ svn_wc_get_status_editor4(const svn_delt
SVN_ERR(svn_wc_get_status_editor5(editor, edit_baton, set_locks_baton,
edit_revision, wc_ctx, anchor_abspath,
target, depth, get_all,
- no_ignore, ignore_patterns,
+ no_ignore,
+ FALSE /* server_performs_filtering */,
+ ignore_patterns,
status4_wrapper_func, swb,
external_func, eb,
cancel_func, cancel_baton,
Modified: subversion/trunk/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/status.c?rev=1096285&r1=1096284&r2=1096285&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/status.c (original)
+++ subversion/trunk/subversion/libsvn_wc/status.c Sun Apr 24 08:52:45 2011
@@ -2262,6 +2262,7 @@ svn_wc_get_status_editor5(const svn_delt
svn_depth_t depth,
svn_boolean_t get_all,
svn_boolean_t no_ignore,
+ svn_boolean_t server_performs_filtering,
const apr_array_header_t *ignore_patterns,
svn_wc_status_func4_t status_func,
void *status_baton,
@@ -2274,6 +2275,8 @@ svn_wc_get_status_editor5(const svn_delt
{
struct edit_baton *eb;
svn_delta_editor_t *tree_editor = svn_delta_default_editor(result_pool);
+ void *inner_baton;
+ const svn_delta_editor_t *inner_editor;
/* Construct an edit baton. */
eb = apr_pcalloc(result_pool, sizeof(*eb));
@@ -2291,8 +2294,6 @@ svn_wc_get_status_editor5(const svn_delt
eb->target_abspath = svn_dirent_join(anchor_abspath, target_basename,
result_pool);
-
-
eb->target_basename = apr_pstrdup(result_pool, target_basename);
eb->root_opened = FALSE;
@@ -2339,10 +2340,26 @@ svn_wc_get_status_editor5(const svn_delt
tree_editor->close_file = close_file;
tree_editor->close_edit = close_edit;
+ inner_editor = tree_editor;
+ inner_baton = eb;
+
+ if (!server_performs_filtering
+ && depth == svn_depth_unknown)
+ SVN_ERR(svn_wc__ambient_depth_filter_editor(&inner_editor,
+ &inner_baton,
+ wc_ctx->db,
+ anchor_abspath,
+ target_basename,
+ TRUE /* read_base */,
+ inner_editor,
+ inner_baton,
+ result_pool));
+
/* Conjoin a cancellation editor with our status editor. */
SVN_ERR(svn_delta_get_cancellation_editor(cancel_func, cancel_baton,
- tree_editor, eb, editor,
- edit_baton, result_pool));
+ inner_editor, inner_baton,
+ editor, edit_baton,
+ result_pool));
if (set_locks_baton)
*set_locks_baton = eb;