You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ne...@apache.org on 2011/08/22 03:10:19 UTC

svn commit: r1160093 - in /subversion/branches/hold/subversion: include/svn_client.h include/svn_wc.h libsvn_client/diff.c libsvn_wc/diff_editor.c libsvn_wc/diff_local.c svn/diff-cmd.c svn/main.c

Author: neels
Date: Mon Aug 22 01:10:18 2011
New Revision: 1160093

URL: http://svn.apache.org/viewvc?rev=1160093&view=rev
Log:
On 'hold' branch: teach 'svn diff' to hold local mods.

Make 'diff' omit (only the) local modifications on files that have the
'svn:hold' property set. (diff_repos_repos is not affected, and diff_repos_wc
only omits the local mods, if any, but shows the repos_repos part of mods.)

Also add the --do-not-hold option to 'svn diff', which, when passed, does not
omit any modifications, regardless of 'svn:hold'.

* subversion/include/svn_client.h
  (svn_client_diff6, svn_client_diff_peg6):
    New functions; add DO_NOT_HOLD over *5().

* subversion/include/svn_wc.h
  (svn_wc_get_diff_editor7, svn_wc_diff7): 
    New functions; add DO_NOT_HOLD over *6().

* subversion/libsvn_client/diff.c
  (do_diff, diff_wc_wc, diff_repos_wc):
    Add parameter DO_NOT_HOLD and pass through to ultimately
    svn_wc_diff7() (wc-wc) or svn_wc_get_diff_editor7() (wc-url).
  (svn_client_diff6, svn_client_diff_peg6): New functions (s.a.).
  (svn_client_diff5, svn_client_diff_peg5):
    Call *6(), passing DO_NOT_HOLD as TRUE to yield previous behavior.

* subversion/libsvn_wc/diff_editor.c
  (struct edit_baton): Add DO_NOT_HOLD.
  (make_edit_baton): Add parameter DO_NOT_HOLD, placed in the new baton.
  (file_diff):
    Skip file diffs if they have an svn:hold prop (locally added files).
  (close_file):
    Skip local mods on files that have an svn:hold prop (wc-url).
  (svn_wc_get_diff_editor7): New function (s.a.).
  (svn_wc_get_diff_editor6):
    Call *7() with DO_NOT_HOLD as TRUE to yield previous behavior.

* subversion/libsvn_wc/diff_local.c
  (struct diff_baton): Add DO_NOT_HOLD.
  (file_diff): Skip file diffs if they have an svn:hold prop (wc-wc).
  (svn_wc_diff7): New function (s.a.).
  (svn_wc_diff6):
    Call *7() with DO_NOT_HOLD as TRUE to yield previous behavior.

* subversion/svn/diff-cmd.c
  (svn_cl__diff): 
    Call svn_client_diff[_peg]6() instead of *5(), pass DO_NOT_HOLD.

* subversion/svn/main.c
  (svn_cl__options):
    Revise online help string for --do-not-hold option, to also match diff.
  (svn_cl__cmd_table): Add OPT_DO_NOT_HOLD to the 'diff' command.


Modified:
    subversion/branches/hold/subversion/include/svn_client.h
    subversion/branches/hold/subversion/include/svn_wc.h
    subversion/branches/hold/subversion/libsvn_client/diff.c
    subversion/branches/hold/subversion/libsvn_wc/diff_editor.c
    subversion/branches/hold/subversion/libsvn_wc/diff_local.c
    subversion/branches/hold/subversion/svn/diff-cmd.c
    subversion/branches/hold/subversion/svn/main.c

Modified: subversion/branches/hold/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/hold/subversion/include/svn_client.h?rev=1160093&r1=1160092&r2=1160093&view=diff
==============================================================================
--- subversion/branches/hold/subversion/include/svn_client.h (original)
+++ subversion/branches/hold/subversion/include/svn_client.h Mon Aug 22 01:10:18 2011
@@ -2807,6 +2807,10 @@ svn_client_blame(const char *path_or_url
  * will be used.
  * ### Do we need to say more about the format? A reference perhaps?
  *
+ * If @a do_not_hold is FALSE, local modifications of files that have the
+ * @c svn:hold property set will be omitted from the diff (the "default
+ * behavior"). If @a do_not_hold is TRUE, all local modifications are shown.
+ *
  * Generated headers are encoded using @a header_encoding.
  *
  * Diff output will not be generated for binary files, unless @a
@@ -2837,6 +2841,32 @@ svn_client_blame(const char *path_or_url
  * @note @a relative_to_dir doesn't affect the path index generated by
  * external diff programs.
  *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_client_diff6(const apr_array_header_t *diff_options,
+                 const char *path1,
+                 const svn_opt_revision_t *revision1,
+                 const char *path2,
+                 const svn_opt_revision_t *revision2,
+                 const char *relative_to_dir,
+                 svn_depth_t depth,
+                 svn_boolean_t ignore_ancestry,
+                 svn_boolean_t no_diff_deleted,
+                 svn_boolean_t show_copies_as_adds,
+                 svn_boolean_t ignore_content_type,
+                 svn_boolean_t use_git_diff_format,
+                 svn_boolean_t do_not_hold,
+                 const char *header_encoding,
+                 apr_file_t *outfile,
+                 apr_file_t *errfile,
+                 const apr_array_header_t *changelists,
+                 svn_client_ctx_t *ctx,
+                 apr_pool_t *pool);
+
+/**
+ * Similar to svn_client_diff6(), but with @a do_not_hold set to @c TRUE.
+ *
  * @since New in 1.7.
  */
 svn_error_t *
@@ -2966,7 +2996,33 @@ svn_client_diff(const apr_array_header_t
  * identically to svn_client_diff5(), using @a path for both of that
  * function's @a path1 and @a path2 arguments.
  *
- * All other options are handled identically to svn_client_diff5().
+ * All other options are handled identically to svn_client_diff6().
+ *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_client_diff_peg6(const apr_array_header_t *diff_options,
+                     const char *path,
+                     const svn_opt_revision_t *peg_revision,
+                     const svn_opt_revision_t *start_revision,
+                     const svn_opt_revision_t *end_revision,
+                     const char *relative_to_dir,
+                     svn_depth_t depth,
+                     svn_boolean_t ignore_ancestry,
+                     svn_boolean_t no_diff_deleted,
+                     svn_boolean_t show_copies_as_adds,
+                     svn_boolean_t ignore_content_type,
+                     svn_boolean_t use_git_diff_format,
+                     svn_boolean_t do_not_hold,
+                     const char *header_encoding,
+                     apr_file_t *outfile,
+                     apr_file_t *errfile,
+                     const apr_array_header_t *changelists,
+                     svn_client_ctx_t *ctx,
+                     apr_pool_t *pool);
+
+/**
+ * Similar to svn_client_diff_peg6(), but with @a do_not_hold set to TRUE.
  *
  * @since New in 1.7.
  */

Modified: subversion/branches/hold/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/hold/subversion/include/svn_wc.h?rev=1160093&r1=1160092&r2=1160093&view=diff
==============================================================================
--- subversion/branches/hold/subversion/include/svn_wc.h (original)
+++ subversion/branches/hold/subversion/include/svn_wc.h Mon Aug 22 01:10:18 2011
@@ -6141,6 +6141,10 @@ svn_wc_canonicalize_svn_prop(const svn_s
  * if they weren't modified after being copied. This allows the callbacks
  * to generate appropriate --git diff headers for such files.
  *
+ * If @a do_not_hold is FALSE, local modifications of files that have the
+ * @c svn:hold property set will be omitted from the diff (the "default
+ * behavior"). If @a do_not_hold is TRUE, all local modifications are shown.
+ *
  * Normally, the difference from repository->working_copy is shown.
  * If @a reverse_order is TRUE, then show working_copy->repository diffs.
  *
@@ -6157,6 +6161,33 @@ svn_wc_canonicalize_svn_prop(const svn_s
  * the ambient depth filtering, so this doesn't have to be handled in the
  * editor.
  *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_wc_get_diff_editor7(const svn_delta_editor_t **editor,
+                        void **edit_baton,
+                        svn_wc_context_t *wc_ctx,
+                        const char *anchor_abspath,
+                        const char *target,
+                        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 do_not_hold,
+                        svn_boolean_t use_text_base,
+                        svn_boolean_t reverse_order,
+                        svn_boolean_t server_performs_filtering,
+                        const apr_array_header_t *changelist_filter,
+                        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_editor7(), but with @a do_not_hold set to TRUE.
+ *
  * @since New in 1.7.
  */
 svn_error_t *
@@ -6331,6 +6362,10 @@ svn_wc_get_diff_editor(svn_wc_adm_access
  * if they weren't modified after being copied. This allows the callbacks
  * to generate appropriate --git diff headers for such files.
  *
+ * If @a do_not_hold is FALSE, local modifications of files that have the
+ * @c svn:hold property set will be omitted from the diff (the "default
+ * behavior"). If @a do_not_hold is TRUE, all local modifications are shown.
+ *
  * @a changelist_filter is an array of <tt>const char *</tt> changelist
  * names, used as a restrictive filter on items whose differences are
  * reported; that is, don't generate diffs about any item unless
@@ -6341,6 +6376,26 @@ svn_wc_get_diff_editor(svn_wc_adm_access
  * points during the operation.  If it returns an error (typically
  * #SVN_ERR_CANCELLED), return that error immediately.
  *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_wc_diff7(svn_wc_context_t *wc_ctx,
+             const char *target_abspath,
+             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 do_not_hold,
+             const apr_array_header_t *changelist_filter,
+             svn_cancel_func_t cancel_func,
+             void *cancel_baton,
+             apr_pool_t *scratch_pool);
+
+/**
+ * Similar to svn_wc_diff7(), but with @a do_not_hold set to @c TRUE.
+ *
  * @since New in 1.7.
  */
 svn_error_t *

Modified: subversion/branches/hold/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/hold/subversion/libsvn_client/diff.c?rev=1160093&r1=1160092&r2=1160093&view=diff
==============================================================================
--- subversion/branches/hold/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/hold/subversion/libsvn_client/diff.c Mon Aug 22 01:10:18 2011
@@ -1618,6 +1618,7 @@ diff_wc_wc(const char *path1,
            svn_boolean_t ignore_ancestry,
            svn_boolean_t show_copies_as_adds,
            svn_boolean_t use_git_diff_format,
+           svn_boolean_t do_not_hold,
            const apr_array_header_t *changelists,
            const svn_wc_diff_callbacks4_t *callbacks,
            struct diff_cmd_baton *callback_baton,
@@ -1670,12 +1671,12 @@ diff_wc_wc(const char *path1,
   else
     callback_baton->anchor = path1;
 
-  SVN_ERR(svn_wc_diff6(ctx->wc_ctx,
+  SVN_ERR(svn_wc_diff7(ctx->wc_ctx,
                        abspath1,
                        callbacks, callback_baton,
                        depth,
                        ignore_ancestry, show_copies_as_adds,
-                       use_git_diff_format, changelists,
+                       use_git_diff_format, do_not_hold, changelists,
                        ctx->cancel_func, ctx->cancel_baton,
                        pool));
   return SVN_NO_ERROR;
@@ -1796,6 +1797,7 @@ diff_repos_wc(const char *path1,
               svn_boolean_t ignore_ancestry,
               svn_boolean_t show_copies_as_adds,
               svn_boolean_t use_git_diff_format,
+              svn_boolean_t do_not_hold,
               const apr_array_header_t *changelists,
               const svn_wc_diff_callbacks4_t *callbacks,
               struct diff_cmd_baton *callback_baton,
@@ -1887,7 +1889,7 @@ diff_repos_wc(const char *path1,
   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,
+  SVN_ERR(svn_wc_get_diff_editor7(&diff_editor, &diff_edit_baton,
                                   ctx->wc_ctx,
                                   anchor_abspath,
                                   target,
@@ -1895,6 +1897,7 @@ diff_repos_wc(const char *path1,
                                   ignore_ancestry,
                                   show_copies_as_adds,
                                   use_git_diff_format,
+                                  do_not_hold,
                                   rev2_is_base,
                                   reverse,
                                   server_supports_depth,
@@ -1957,6 +1960,7 @@ do_diff(const svn_wc_diff_callbacks4_t *
         svn_boolean_t ignore_ancestry,
         svn_boolean_t show_copies_as_adds,
         svn_boolean_t use_git_diff_format,
+        svn_boolean_t do_not_hold,
         const apr_array_header_t *changelists,
         apr_pool_t *pool)
 {
@@ -1981,7 +1985,7 @@ do_diff(const svn_wc_diff_callbacks4_t *
           SVN_ERR(diff_repos_wc(path1, revision1, peg_revision,
                                 path2, revision2, FALSE, depth,
                                 ignore_ancestry, show_copies_as_adds,
-                                use_git_diff_format, changelists,
+                                use_git_diff_format, do_not_hold, changelists,
                                 callbacks, callback_baton, ctx, pool));
         }
     }
@@ -1992,14 +1996,14 @@ do_diff(const svn_wc_diff_callbacks4_t *
           SVN_ERR(diff_repos_wc(path2, revision2, peg_revision,
                                 path1, revision1, TRUE, depth,
                                 ignore_ancestry, show_copies_as_adds,
-                                use_git_diff_format, changelists,
+                                use_git_diff_format, do_not_hold, changelists,
                                 callbacks, callback_baton, ctx, pool));
         }
       else /* path2 is a working copy path */
         {
           SVN_ERR(diff_wc_wc(path1, revision1, path2, revision2,
                              depth, ignore_ancestry, show_copies_as_adds,
-                             use_git_diff_format, changelists,
+                             use_git_diff_format, do_not_hold, changelists,
                              callbacks, callback_baton, ctx, pool));
         }
     }
@@ -2217,7 +2221,7 @@ set_up_diff_cmd_and_options(struct diff_
       * These cases require server communication.
 */
 svn_error_t *
-svn_client_diff5(const apr_array_header_t *options,
+svn_client_diff6(const apr_array_header_t *options,
                  const char *path1,
                  const svn_opt_revision_t *revision1,
                  const char *path2,
@@ -2229,6 +2233,7 @@ svn_client_diff5(const apr_array_header_
                  svn_boolean_t show_copies_as_adds,
                  svn_boolean_t ignore_content_type,
                  svn_boolean_t use_git_diff_format,
+                 svn_boolean_t do_not_hold,
                  const char *header_encoding,
                  apr_file_t *outfile,
                  apr_file_t *errfile,
@@ -2269,11 +2274,39 @@ svn_client_diff5(const apr_array_header_
   return do_diff(&diff_callbacks, &diff_cmd_baton, ctx,
                  path1, path2, revision1, revision2, &peg_revision,
                  depth, ignore_ancestry, show_copies_as_adds,
-                 use_git_diff_format, changelists, pool);
+                 use_git_diff_format, do_not_hold, changelists, pool);
 }
 
 svn_error_t *
-svn_client_diff_peg5(const apr_array_header_t *options,
+svn_client_diff5(const apr_array_header_t *options,
+                 const char *path1,
+                 const svn_opt_revision_t *revision1,
+                 const char *path2,
+                 const svn_opt_revision_t *revision2,
+                 const char *relative_to_dir,
+                 svn_depth_t depth,
+                 svn_boolean_t ignore_ancestry,
+                 svn_boolean_t no_diff_deleted,
+                 svn_boolean_t show_copies_as_adds,
+                 svn_boolean_t ignore_content_type,
+                 svn_boolean_t use_git_diff_format,
+                 const char *header_encoding,
+                 apr_file_t *outfile,
+                 apr_file_t *errfile,
+                 const apr_array_header_t *changelists,
+                 svn_client_ctx_t *ctx,
+                 apr_pool_t *pool)
+{
+  return svn_client_diff6(options, path1, revision1, path2, revision2,
+                          relative_to_dir, depth, ignore_ancestry,
+                          no_diff_deleted, show_copies_as_adds,
+                          ignore_content_type, use_git_diff_format, TRUE,
+                          header_encoding, outfile, errfile, changelists, ctx,
+                          pool);
+}
+
+svn_error_t *
+svn_client_diff_peg6(const apr_array_header_t *options,
                      const char *path,
                      const svn_opt_revision_t *peg_revision,
                      const svn_opt_revision_t *start_revision,
@@ -2285,6 +2318,7 @@ svn_client_diff_peg5(const apr_array_hea
                      svn_boolean_t show_copies_as_adds,
                      svn_boolean_t ignore_content_type,
                      svn_boolean_t use_git_diff_format,
+                     svn_boolean_t do_not_hold,
                      const char *header_encoding,
                      apr_file_t *outfile,
                      apr_file_t *errfile,
@@ -2321,7 +2355,37 @@ svn_client_diff_peg5(const apr_array_hea
   return do_diff(&diff_callbacks, &diff_cmd_baton, ctx,
                  path, path, start_revision, end_revision, peg_revision,
                  depth, ignore_ancestry, show_copies_as_adds,
-                 use_git_diff_format, changelists, pool);
+                 use_git_diff_format, do_not_hold, changelists, pool);
+}
+
+svn_error_t *
+svn_client_diff_peg5(const apr_array_header_t *options,
+                     const char *path,
+                     const svn_opt_revision_t *peg_revision,
+                     const svn_opt_revision_t *start_revision,
+                     const svn_opt_revision_t *end_revision,
+                     const char *relative_to_dir,
+                     svn_depth_t depth,
+                     svn_boolean_t ignore_ancestry,
+                     svn_boolean_t no_diff_deleted,
+                     svn_boolean_t show_copies_as_adds,
+                     svn_boolean_t ignore_content_type,
+                     svn_boolean_t use_git_diff_format,
+                     const char *header_encoding,
+                     apr_file_t *outfile,
+                     apr_file_t *errfile,
+                     const apr_array_header_t *changelists,
+                     svn_client_ctx_t *ctx,
+                     apr_pool_t *pool)
+{
+  return svn_client_diff_peg6(options, path, peg_revision, start_revision,
+                              end_revision, relative_to_dir, depth,
+                              ignore_content_type, no_diff_deleted,
+                              show_copies_as_adds, ignore_content_type,
+                              use_git_diff_format,
+                              TRUE,
+                              header_encoding, outfile, errfile, changelists,
+                              ctx, pool);
 }
 
 svn_error_t *

Modified: subversion/branches/hold/subversion/libsvn_wc/diff_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/hold/subversion/libsvn_wc/diff_editor.c?rev=1160093&r1=1160092&r2=1160093&view=diff
==============================================================================
--- subversion/branches/hold/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/branches/hold/subversion/libsvn_wc/diff_editor.c Mon Aug 22 01:10:18 2011
@@ -233,6 +233,9 @@ struct edit_baton {
   /* Are we producing a git-style diff? */
   svn_boolean_t use_git_diff_format;
 
+  /* Whether local mods of files with an svn:hold property are shown. */
+  svn_boolean_t do_not_hold;
+
   /* Possibly diff repos against text-bases instead of working files. */
   svn_boolean_t use_text_base;
 
@@ -350,6 +353,7 @@ make_edit_baton(struct edit_baton **edit
                 svn_boolean_t ignore_ancestry,
                 svn_boolean_t show_copies_as_adds,
                 svn_boolean_t use_git_diff_format,
+                svn_boolean_t do_not_hold,
                 svn_boolean_t use_text_base,
                 svn_boolean_t reverse_order,
                 const apr_array_header_t *changelist_filter,
@@ -376,6 +380,7 @@ make_edit_baton(struct edit_baton **edit
   eb->ignore_ancestry = ignore_ancestry;
   eb->show_copies_as_adds = show_copies_as_adds;
   eb->use_git_diff_format = use_git_diff_format;
+  eb->do_not_hold = do_not_hold;
   eb->use_text_base = use_text_base;
   eb->reverse_order = reverse_order;
   eb->changelist_hash = changelist_hash;
@@ -547,6 +552,17 @@ file_diff(struct edit_baton *eb,
                                           eb->changelist_hash, scratch_pool))
     return SVN_NO_ERROR;
 
+  /* Skip files that are on hold via an svn:hold prop. */
+  if (! eb->do_not_hold)
+    {
+      const svn_string_t *propval;
+      SVN_ERR(svn_wc__internal_propget(&propval, eb->db, local_abspath,
+                                       SVN_PROP_HOLD,
+                                       scratch_pool, scratch_pool));
+      if (propval != NULL)
+        return SVN_NO_ERROR;
+    }
+
   SVN_ERR(svn_wc__db_read_info(&status, NULL, &revision, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -1579,6 +1595,7 @@ close_file(void *file_baton,
   /* The working copy properties at the base of the wc->repos
      comparison: either BASE or WORKING. */
   apr_hash_t *originalprops;
+  svn_boolean_t held;
 
   if (expected_md5_digest != NULL)
     {
@@ -1626,6 +1643,18 @@ close_file(void *file_baton,
   else
     SVN_ERR(err);
 
+  /* Determine if an svn:hold prop has any bearing on this file. */
+  if (! eb->do_not_hold)
+    {
+      const svn_string_t *propval;
+      SVN_ERR(svn_wc__internal_propget(&propval, eb->db, fb->local_abspath,
+                                       SVN_PROP_HOLD,
+                                       scratch_pool, scratch_pool));
+      held = (propval != NULL);
+    }
+  else
+    held = FALSE;
+
   SVN_ERR(get_empty_file(eb, &empty_file));
 
   if (fb->added)
@@ -1720,14 +1749,14 @@ close_file(void *file_baton,
      against WORKING, we also need to check whether there are any local
      (BASE:WORKING) modifications. */
   modified = (fb->temp_file_path != NULL);
-  if (!modified && !eb->use_text_base)
+  if (!modified && !eb->use_text_base && !held)
     SVN_ERR(svn_wc__internal_file_modified_p(&modified, eb->db,
                                              fb->local_abspath,
                                              FALSE, scratch_pool));
 
   if (modified)
     {
-      if (eb->use_text_base)
+      if (eb->use_text_base || held)
         SVN_ERR(get_pristine_file(&localfile, eb->db, fb->local_abspath,
                                   FALSE, scratch_pool, scratch_pool));
       else
@@ -1741,7 +1770,7 @@ close_file(void *file_baton,
   else
     localfile = repos_file = NULL;
 
-  if (eb->use_text_base)
+  if (eb->use_text_base || held)
     {
       originalprops = pristine_props;
     }
@@ -1856,7 +1885,7 @@ close_edit(void *edit_baton,
 
 /* Create a diff editor and baton. */
 svn_error_t *
-svn_wc_get_diff_editor6(const svn_delta_editor_t **editor,
+svn_wc_get_diff_editor7(const svn_delta_editor_t **editor,
                         void **edit_baton,
                         svn_wc_context_t *wc_ctx,
                         const char *anchor_abspath,
@@ -1865,6 +1894,7 @@ svn_wc_get_diff_editor6(const svn_delta_
                         svn_boolean_t ignore_ancestry,
                         svn_boolean_t show_copies_as_adds,
                         svn_boolean_t use_git_diff_format,
+                        svn_boolean_t do_not_hold,
                         svn_boolean_t use_text_base,
                         svn_boolean_t reverse_order,
                         svn_boolean_t server_performs_filtering,
@@ -1888,7 +1918,7 @@ svn_wc_get_diff_editor6(const svn_delta_
                           anchor_abspath, target,
                           callbacks, callback_baton,
                           depth, ignore_ancestry, show_copies_as_adds,
-                          use_git_diff_format,
+                          use_git_diff_format, do_not_hold,
                           use_text_base, reverse_order, changelist_filter,
                           cancel_func, cancel_baton,
                           result_pool));
@@ -1931,3 +1961,34 @@ svn_wc_get_diff_editor6(const svn_delta_
                                            edit_baton,
                                            result_pool);
 }
+
+svn_error_t *
+svn_wc_get_diff_editor6(const svn_delta_editor_t **editor,
+                        void **edit_baton,
+                        svn_wc_context_t *wc_ctx,
+                        const char *anchor_abspath,
+                        const char *target,
+                        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 *changelist_filter,
+                        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)
+{
+  return svn_wc_get_diff_editor7(editor, edit_baton, wc_ctx, anchor_abspath,
+                                 target, depth, ignore_ancestry,
+                                 show_copies_as_adds, use_git_diff_format,
+                                 TRUE,
+                                 use_text_base, reverse_order,
+                                 server_performs_filtering, changelist_filter,
+                                 callbacks, callback_baton, cancel_func,
+                                 cancel_baton, result_pool, scratch_pool);
+}

Modified: subversion/branches/hold/subversion/libsvn_wc/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/branches/hold/subversion/libsvn_wc/diff_local.c?rev=1160093&r1=1160092&r2=1160093&view=diff
==============================================================================
--- subversion/branches/hold/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/branches/hold/subversion/libsvn_wc/diff_local.c Mon Aug 22 01:10:18 2011
@@ -71,6 +71,9 @@ struct diff_baton
   /* Are we producing a git-style diff? */
   svn_boolean_t use_git_diff_format;
 
+  /* Whether local mods of files with an svn:hold property are shown. */
+  svn_boolean_t do_not_hold;
+
   /* Empty file used to diff adds / deletes */
   const char *empty_file;
 
@@ -151,6 +154,16 @@ file_diff(struct diff_baton *eb,
   const svn_checksum_t *base_checksum;
   const char *pristine_abspath;
 
+  /* Skip files that are on hold via an svn:hold prop. */
+  if (! eb->do_not_hold) {
+    const svn_string_t *propval;
+    SVN_ERR(svn_wc__internal_propget(&propval, db, local_abspath,
+                                     SVN_PROP_HOLD,
+                                     scratch_pool, scratch_pool));
+    if (propval != NULL)
+      return SVN_NO_ERROR;
+  }
+
   SVN_ERR(svn_wc__db_read_info(&status, &kind, &revision, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, &checksum, NULL,
                                &original_repos_relpath, NULL, NULL, NULL,
@@ -505,7 +518,7 @@ diff_status_callback(void *baton,
 
 /* Public Interface */
 svn_error_t *
-svn_wc_diff6(svn_wc_context_t *wc_ctx,
+svn_wc_diff7(svn_wc_context_t *wc_ctx,
              const char *local_abspath,
              const svn_wc_diff_callbacks4_t *callbacks,
              void *callback_baton,
@@ -513,6 +526,7 @@ svn_wc_diff6(svn_wc_context_t *wc_ctx,
              svn_boolean_t ignore_ancestry,
              svn_boolean_t show_copies_as_adds,
              svn_boolean_t use_git_diff_format,
+             svn_boolean_t do_not_hold,
              const apr_array_header_t *changelist_filter,
              svn_cancel_func_t cancel_func,
              void *cancel_baton,
@@ -537,6 +551,7 @@ svn_wc_diff6(svn_wc_context_t *wc_ctx,
   eb.ignore_ancestry = ignore_ancestry;
   eb.show_copies_as_adds = show_copies_as_adds;
   eb.use_git_diff_format = use_git_diff_format;
+  eb.do_not_hold = do_not_hold;
   eb.empty_file = NULL;
   eb.pool = scratch_pool;
 
@@ -561,3 +576,25 @@ svn_wc_diff6(svn_wc_context_t *wc_ctx,
 
   return SVN_NO_ERROR;
 }
+
+svn_error_t *
+svn_wc_diff6(svn_wc_context_t *wc_ctx,
+             const char *local_abspath,
+             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,
+             const apr_array_header_t *changelist_filter,
+             svn_cancel_func_t cancel_func,
+             void *cancel_baton,
+             apr_pool_t *scratch_pool)
+{
+  return svn_wc_diff7(wc_ctx, local_abspath, callbacks, callback_baton,
+                      depth, ignore_ancestry, show_copies_as_adds,
+                      use_git_diff_format,
+                      TRUE,
+                      changelist_filter, cancel_func, callback_baton,
+                      scratch_pool);
+}

Modified: subversion/branches/hold/subversion/svn/diff-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/hold/subversion/svn/diff-cmd.c?rev=1160093&r1=1160092&r2=1160093&view=diff
==============================================================================
--- subversion/branches/hold/subversion/svn/diff-cmd.c (original)
+++ subversion/branches/hold/subversion/svn/diff-cmd.c Mon Aug 22 01:10:18 2011
@@ -353,7 +353,7 @@ svn_cl__diff(apr_getopt_t *os,
                      summarize_func, &target1,
                      ctx, iterpool));
           else
-            SVN_ERR(svn_client_diff5
+            SVN_ERR(svn_client_diff6
                     (options,
                      target1,
                      &(opt_state->start_revision),
@@ -366,6 +366,7 @@ svn_cl__diff(apr_getopt_t *os,
                      opt_state->show_copies_as_adds,
                      opt_state->force,
                      opt_state->use_git_diff_format,
+                     opt_state->do_not_hold,
                      svn_cmdline_output_encoding(pool),
                      outfile,
                      errfile,
@@ -398,7 +399,7 @@ svn_cl__diff(apr_getopt_t *os,
                      summarize_func, &truepath,
                      ctx, iterpool));
           else
-            SVN_ERR(svn_client_diff_peg5
+            SVN_ERR(svn_client_diff_peg6
                     (options,
                      truepath,
                      &peg_revision,
@@ -411,6 +412,7 @@ svn_cl__diff(apr_getopt_t *os,
                      opt_state->show_copies_as_adds,
                      opt_state->force,
                      opt_state->use_git_diff_format,
+                     opt_state->do_not_hold,
                      svn_cmdline_output_encoding(pool),
                      outfile,
                      errfile,

Modified: subversion/branches/hold/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/hold/subversion/svn/main.c?rev=1160093&r1=1160092&r2=1160093&view=diff
==============================================================================
--- subversion/branches/hold/subversion/svn/main.c (original)
+++ subversion/branches/hold/subversion/svn/main.c Mon Aug 22 01:10:18 2011
@@ -344,9 +344,8 @@ const apr_getopt_option_t svn_cl__option
                        "                             "
                        "Please run 'svn update' instead.")},
   {"do-not-hold", opt_do_not_hold, 0,
-                    N_("do not hold any files. This allows\n"
-                       "                             "
-                       "committing the svn:hold property.")},
+                    N_("do not hold any files (see svn:hold property)\n"
+                       )},
 
   /* Long-opt Aliases
    *
@@ -532,7 +531,8 @@ const svn_opt_subcommand_desc2_t svn_cl_
     {'r', 'c', opt_old_cmd, opt_new_cmd, 'N', opt_depth, opt_diff_cmd,
      opt_internal_diff, 'x', opt_no_diff_deleted, opt_show_copies_as_adds,
      opt_notice_ancestry, opt_summarize, opt_changelist, opt_force, opt_xml,
-     opt_use_git_diff_format} },
+     opt_use_git_diff_format, opt_do_not_hold} },
+
   { "export", svn_cl__export, {0}, N_
     ("Create an unversioned copy of a tree.\n"
      "usage: 1. export [-r REV] URL[@PEGREV] [PATH]\n"