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:20:24 UTC

svn commit: r1096279 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_client/diff.c libsvn_wc/deprecated.c libsvn_wc/diff.c

Author: rhuijben
Date: Sun Apr 24 08:20:24 2011
New Revision: 1096279

URL: http://svn.apache.org/viewvc?rev=1096279&view=rev
Log:
Following up on r1091187, and r1092502 also use the server side depth filtering
for the working copy diff handling.

Like the other cases this required making the server provide less changes,
which improves overall performance.

* subversion/include/svn_wc.h
  (svn_wc_get_diff_editor6): Update documentation. Reorder a few arguments to
    our new standard ordering.
  (svn_wc_get_diff_editor5): Update documentation.

* subversion/libsvn_client/diff.c
  (diff_repos_wc): Tell libsvn_wc the ra layer can filter. Call ra_update
    with depth unknown to follow the ambient depth. Update caller.

* subversion/libsvn_wc/deprecated.c
  (svn_wc_get_diff_editor5): Update caller.

* subversion/libsvn_wc/diff.c
  (svn_wc_get_diff_editor6): Follow prototype changes. Don't use the
    ambient depth filter if not necessary.

Modified:
    subversion/trunk/subversion/include/svn_wc.h
    subversion/trunk/subversion/libsvn_client/diff.c
    subversion/trunk/subversion/libsvn_wc/deprecated.c
    subversion/trunk/subversion/libsvn_wc/diff.c

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1096279&r1=1096278&r2=1096279&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Sun Apr 24 08:20:24 2011
@@ -5918,8 +5918,10 @@ svn_wc_canonicalize_svn_prop(const svn_s
  * @a anchor_abspath/@a target represent the base of the hierarchy to be
  * compared. The diff callback paths will be relative to this path.
  *
- * @a callbacks/@a callback_baton is the callback table to use when two
- * files are to be compared.
+ * Diffs will be reported as valid relpaths, with @a anchor_abspath being
+ * the root ("").
+ *
+ * @a callbacks/@a callback_baton is the callback table to use.
  *
  * If @a depth is #svn_depth_empty, just diff exactly @a target or
  * @a anchor_path if @a target is empty.  If #svn_depth_files then do the same
@@ -5953,6 +5955,10 @@ svn_wc_canonicalize_svn_prop(const svn_s
  * it's a member of one of those changelists.  If @a changelists is
  * empty (or altogether @c NULL), no changelist filtering occurs.
  *
+  * 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.
+ *
  * @since New in 1.7.
  */
 svn_error_t *
@@ -5961,25 +5967,29 @@ svn_wc_get_diff_editor6(const svn_delta_
                         svn_wc_context_t *wc_ctx,
                         const char *anchor_abspath,
                         const char *target,
-                        const svn_wc_diff_callbacks4_t *callbacks,
-                        void *callback_baton,
                         svn_depth_t depth,
                         svn_boolean_t ignore_ancestry,
                         svn_boolean_t show_copies_as_adds,
                         svn_boolean_t use_git_diff_format,
                         svn_boolean_t use_text_base,
                         svn_boolean_t reverse_order,
+                        svn_boolean_t server_performs_filtering,
                         const apr_array_header_t *changelists,
+                        const svn_wc_diff_callbacks4_t *callbacks,
+                        void *callback_baton,
                         svn_cancel_func_t cancel_func,
                         void *cancel_baton,
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool);
 
 /**
- * Similar to svn_wc_get_diff_editor6(), but with an
+ * Similar to svn_wc_get_diff_editor6(), but with an access baton and relative
+ * path. @a server_performs_filtering always true and with a
  * #svn_wc_diff_callbacks3_t instead of #svn_wc_diff_callbacks4_t,
  * @a show_copies_as_adds, and @a use_git_diff_format set to @c FALSE.
  *
+ * Diffs will be reported as below the relative path stored in @a anchor.
+ *
  * @since New in 1.6.
  *
  * @deprecated Provided for backward compatibility with the 1.6 API.

Modified: subversion/trunk/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/diff.c?rev=1096279&r1=1096278&r2=1096279&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/diff.c Sun Apr 24 08:20:24 2011
@@ -1867,24 +1867,29 @@ diff_repos_wc(const char *path1,
     }
   callback_baton->anchor = anchor;
 
+  SVN_ERR(svn_ra_has_capability(ra_session, &server_supports_depth,
+                                SVN_RA_CAPABILITY_DEPTH, pool));
+
   SVN_ERR(svn_wc_get_diff_editor6(&diff_editor, &diff_edit_baton,
                                   ctx->wc_ctx,
                                   anchor_abspath,
                                   target,
-                                  callbacks, callback_baton,
                                   depth,
                                   ignore_ancestry,
                                   show_copies_as_adds,
                                   use_git_diff_format,
                                   rev2_is_base,
                                   reverse,
+                                  server_supports_depth,
                                   changelists,
+                                  callbacks, callback_baton,
                                   ctx->cancel_func, ctx->cancel_baton,
                                   pool, pool));
 
   /* Tell the RA layer we want a delta to change our txn to URL1 */
   SVN_ERR(svn_client__get_revision_number(&rev, NULL, ctx->wc_ctx,
-                                          (strcmp(path1, url1) == 0) ? NULL : abspath1,
+                                          (strcmp(path1, url1) == 0)
+                                                    ? NULL : abspath1,
                                           ra_session, revision1, pool));
 
   if (!reverse)
@@ -1896,15 +1901,12 @@ diff_repos_wc(const char *path1,
                           &reporter, &reporter_baton,
                           rev,
                           target,
-                          depth,
+                          svn_depth_unknown,
                           ignore_ancestry,
                           TRUE,  /* text_deltas */
                           url1,
                           diff_editor, diff_edit_baton, pool));
 
-  SVN_ERR(svn_ra_has_capability(ra_session, &server_supports_depth,
-                                SVN_RA_CAPABILITY_DEPTH, pool));
-
   /* Create a txn mirror of path2;  the diff editor will print
      diffs in reverse.  :-)  */
   SVN_ERR(svn_wc_crawl_revisions5(ctx->wc_ctx, abspath2,

Modified: subversion/trunk/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/deprecated.c?rev=1096279&r1=1096278&r2=1096279&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_wc/deprecated.c Sun Apr 24 08:20:24 2011
@@ -1852,15 +1852,16 @@ svn_wc_get_diff_editor5(svn_wc_adm_acces
                                    wc_ctx,
                                    svn_wc__adm_access_abspath(anchor),
                                    target,
-                                   &diff_callbacks3_wrapper,
-                                   b,
                                    depth,
                                    ignore_ancestry,
                                    FALSE,
                                    FALSE,
                                    use_text_base,
                                    reverse_order,
+                                   FALSE,
                                    changelists,
+                                   &diff_callbacks3_wrapper,
+                                   b,
                                    cancel_func,
                                    cancel_baton,
                                    pool,

Modified: subversion/trunk/subversion/libsvn_wc/diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/diff.c?rev=1096279&r1=1096278&r2=1096279&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/diff.c (original)
+++ subversion/trunk/subversion/libsvn_wc/diff.c Sun Apr 24 08:20:24 2011
@@ -1853,15 +1853,16 @@ svn_wc_get_diff_editor6(const svn_delta_
                         svn_wc_context_t *wc_ctx,
                         const char *anchor_abspath,
                         const char *target,
-                        const svn_wc_diff_callbacks4_t *callbacks,
-                        void *callback_baton,
                         svn_depth_t depth,
                         svn_boolean_t ignore_ancestry,
                         svn_boolean_t show_copies_as_adds,
                         svn_boolean_t use_git_diff_format,
                         svn_boolean_t use_text_base,
                         svn_boolean_t reverse_order,
+                        svn_boolean_t server_performs_filtering,
                         const apr_array_header_t *changelists,
+                        const svn_wc_diff_callbacks4_t *callbacks,
+                        void *callback_baton,
                         svn_cancel_func_t cancel_func,
                         void *cancel_baton,
                         apr_pool_t *result_pool,
@@ -1903,7 +1904,7 @@ svn_wc_get_diff_editor6(const svn_delta_
   inner_editor = tree_editor;
   inner_baton = eb;
 
-  if (depth == svn_depth_unknown)
+  if (!server_performs_filtering && depth == svn_depth_unknown)
     SVN_ERR(svn_wc__ambient_depth_filter_editor(&inner_editor,
                                                 &inner_baton,
                                                 wc_ctx->db,