You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2018/01/23 15:25:29 UTC
svn commit: r1822014 - in /subversion/trunk/subversion: include/svn_client.h
libsvn_client/deprecated.c libsvn_client/diff.c svn/diff-cmd.c
Author: julianfoad
Date: Tue Jan 23 15:25:29 2018
New Revision: 1822014
URL: http://svn.apache.org/viewvc?rev=1822014&view=rev
Log:
Expose the 'pretty_print_mergeinfo' flag of svn_diff__display_prop_diffs()
up through higher APIs.
Partly because disabling that should help me produce patches that are
compatible with 'svn patch'. Partly because it's the Right Thing to do.
* subversion/include/svn_client.h
subversion/libsvn_client/deprecated.c
(svn_client_diff7,
svn_client_diff_peg7): New, adding a 'pretty_print_mergeinfo' parameter.
(svn_client_diff6,
svn_client_diff_peg6): Deprecate.
* subversion/libsvn_client/diff.c
(display_prop_diffs,
diff_writer_info_t,
diff_props_changed): Take and pass on 'pretty_print_mergeinfo' parameter.
(svn_client_diff7,
svn_client_diff_peg7): Rename from '...6'. Take and pass on a
'pretty_print_mergeinfo' parameter.
* subversion/svn/diff-cmd.c
(svn_cl__diff): Use new API, passing TRUE for 'pretty_print_mergeinfo'.
Modified:
subversion/trunk/subversion/include/svn_client.h
subversion/trunk/subversion/libsvn_client/deprecated.c
subversion/trunk/subversion/libsvn_client/diff.c
subversion/trunk/subversion/svn/diff-cmd.c
Modified: subversion/trunk/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h?rev=1822014&r1=1822013&r2=1822014&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_client.h (original)
+++ subversion/trunk/subversion/include/svn_client.h Tue Jan 23 15:25:29 2018
@@ -3060,6 +3060,11 @@ svn_client_blame(const char *path_or_url
* The above two options are mutually exclusive. It is an error to set
* both to TRUE.
*
+ * If @a pretty_print_mergeinfo is true, then describe 'svn:mergeinfo'
+ * property changes in a human-readable form that says what changes were
+ * merged or reverse merged; otherwise (or if the mergeinfo property values
+ * don't parse correctly) display them just like any other property.
+ *
* Generated headers are encoded using @a header_encoding.
*
* Diff output will not be generated for binary files, unless @a
@@ -3090,8 +3095,39 @@ 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.11.
+ */
+svn_error_t *
+svn_client_diff7(const apr_array_header_t *diff_options,
+ const char *path_or_url1,
+ const svn_opt_revision_t *revision1,
+ const char *path_or_url2,
+ 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_added,
+ svn_boolean_t no_diff_deleted,
+ svn_boolean_t show_copies_as_adds,
+ svn_boolean_t ignore_content_type,
+ svn_boolean_t ignore_properties,
+ svn_boolean_t properties_only,
+ svn_boolean_t use_git_diff_format,
+ svn_boolean_t pretty_print_mergeinfo,
+ const char *header_encoding,
+ svn_stream_t *outstream,
+ svn_stream_t *errstream,
+ const apr_array_header_t *changelists,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool);
+
+/** Similar to svn_client_diff7(), but with @a pretty_print_mergeinfo
+ * always passed as @c TRUE.
+ *
+ * @deprecated Provided for backward compatibility with the 1.10 API.
* @since New in 1.8.
*/
+SVN_DEPRECATED
svn_error_t *
svn_client_diff6(const apr_array_header_t *diff_options,
const char *path_or_url1,
@@ -3249,14 +3285,45 @@ svn_client_diff(const apr_array_header_t
* be either a working-copy path or URL.
*
* If @a peg_revision is #svn_opt_revision_unspecified, behave
- * identically to svn_client_diff6(), using @a path_or_url for both of that
+ * identically to svn_client_diff7(), using @a path_or_url for both of that
* function's @a path_or_url1 and @a path_or_url2 arguments.
*
- * All other options are handled identically to svn_client_diff6().
+ * All other options are handled identically to svn_client_diff7().
*
* @since New in 1.8.
*/
svn_error_t *
+svn_client_diff_peg7(const apr_array_header_t *diff_options,
+ const char *path_or_url,
+ 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_added,
+ svn_boolean_t no_diff_deleted,
+ svn_boolean_t show_copies_as_adds,
+ svn_boolean_t ignore_content_type,
+ svn_boolean_t ignore_properties,
+ svn_boolean_t properties_only,
+ svn_boolean_t use_git_diff_format,
+ svn_boolean_t pretty_print_mergeinfo,
+ const char *header_encoding,
+ svn_stream_t *outstream,
+ svn_stream_t *errstream,
+ const apr_array_header_t *changelists,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool);
+
+/** Similar to svn_client_diff_peg7(), but with @a pretty_print_mergeinfo
+ * always passed as @c TRUE.
+ *
+ * @deprecated Provided for backward compatibility with the 1.7 API.
+ * @since New in 1.7.
+ */
+SVN_DEPRECATED
+svn_error_t *
svn_client_diff_peg6(const apr_array_header_t *diff_options,
const char *path_or_url,
const svn_opt_revision_t *peg_revision,
@@ -3419,7 +3486,7 @@ svn_client_diff_peg(const apr_array_head
* Calls @a summarize_func with @a summarize_baton for each difference
* with a #svn_client_diff_summarize_t structure describing the difference.
*
- * See svn_client_diff6() for a description of the other parameters.
+ * See svn_client_diff7() for a description of the other parameters.
*
* @since New in 1.5.
*/
Modified: subversion/trunk/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/deprecated.c?rev=1822014&r1=1822013&r2=1822014&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_client/deprecated.c Tue Jan 23 15:25:29 2018
@@ -936,6 +936,42 @@ svn_client_delete(svn_client_commit_info
/*** From diff.c ***/
svn_error_t *
+svn_client_diff6(const apr_array_header_t *diff_options,
+ const char *path_or_url1,
+ const svn_opt_revision_t *revision1,
+ const char *path_or_url2,
+ 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_added,
+ svn_boolean_t no_diff_deleted,
+ svn_boolean_t show_copies_as_adds,
+ svn_boolean_t ignore_content_type,
+ svn_boolean_t ignore_properties,
+ svn_boolean_t properties_only,
+ svn_boolean_t use_git_diff_format,
+ const char *header_encoding,
+ svn_stream_t *outstream,
+ svn_stream_t *errstream,
+ const apr_array_header_t *changelists,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool)
+{
+ return svn_client_diff7(diff_options,
+ path_or_url1, revision1,
+ path_or_url2, revision2,
+ relative_to_dir, depth,
+ ignore_ancestry, no_diff_added,
+ no_diff_deleted, show_copies_as_adds,
+ ignore_content_type, ignore_properties,
+ properties_only, use_git_diff_format,
+ TRUE /*pretty_print_mergeinfo*/,
+ header_encoding,
+ outstream, errstream, changelists, ctx, pool);
+}
+
+svn_error_t *
svn_client_diff5(const apr_array_header_t *diff_options,
const char *path1,
const svn_opt_revision_t *revision1,
@@ -1058,6 +1094,53 @@ svn_client_diff(const apr_array_header_t
}
svn_error_t *
+svn_client_diff_peg6(const apr_array_header_t *options,
+ const char *path_or_url,
+ 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_added,
+ svn_boolean_t no_diff_deleted,
+ svn_boolean_t show_copies_as_adds,
+ svn_boolean_t ignore_content_type,
+ svn_boolean_t ignore_properties,
+ svn_boolean_t properties_only,
+ svn_boolean_t use_git_diff_format,
+ const char *header_encoding,
+ svn_stream_t *outstream,
+ svn_stream_t *errstream,
+ const apr_array_header_t *changelists,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool)
+{
+ return svn_client_diff_peg7(options,
+ path_or_url,
+ peg_revision,
+ start_revision,
+ end_revision,
+ relative_to_dir,
+ depth,
+ ignore_ancestry,
+ no_diff_added,
+ no_diff_deleted,
+ show_copies_as_adds,
+ ignore_content_type,
+ ignore_properties,
+ properties_only,
+ use_git_diff_format,
+ TRUE /*pretty_print_mergeinfo*/,
+ header_encoding,
+ outstream,
+ errstream,
+ changelists,
+ ctx,
+ pool);
+}
+
+svn_error_t *
svn_client_diff_peg5(const apr_array_header_t *diff_options,
const char *path,
const svn_opt_revision_t *peg_revision,
Modified: subversion/trunk/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/diff.c?rev=1822014&r1=1822013&r2=1822014&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/diff.c Tue Jan 23 15:25:29 2018
@@ -498,6 +498,11 @@ print_git_diff_header(svn_stream_t *os,
needed to normalize paths relative the repository root, and are ignored
if USE_GIT_DIFF_FORMAT is FALSE.
+ If @a pretty_print_mergeinfo is true, then describe 'svn:mergeinfo'
+ property changes in a human-readable form that says what changes were
+ merged or reverse merged; otherwise (or if the mergeinfo property values
+ don't parse correctly) display them just like any other property.
+
ANCHOR is the local path where the diff editor is anchored. */
static svn_error_t *
display_prop_diffs(const apr_array_header_t *propchanges,
@@ -514,6 +519,7 @@ display_prop_diffs(const apr_array_heade
const char *relative_to_dir,
svn_boolean_t show_diff_header,
svn_boolean_t use_git_diff_format,
+ svn_boolean_t pretty_print_mergeinfo,
const char *ra_session_relpath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
@@ -588,7 +594,7 @@ display_prop_diffs(const apr_array_heade
SVN_ERR(svn_diff__display_prop_diffs(
outstream, encoding, propchanges, left_props,
- TRUE /* pretty_print_mergeinfo */,
+ pretty_print_mergeinfo,
-1 /* context_size */,
cancel_func, cancel_baton, scratch_pool));
@@ -668,6 +674,9 @@ typedef struct diff_writer_info_t
/* Whether to ignore copyfrom information when showing adds */
svn_boolean_t show_copies_as_adds;
+ /* Whether to show mergeinfo prop changes in human-readable form */
+ svn_boolean_t pretty_print_mergeinfo;
+
/* Empty files for creating diffs or NULL if not used yet */
const char *empty_file;
@@ -718,6 +727,7 @@ diff_props_changed(const char *diff_relp
dwi->relative_to_dir,
show_diff_header,
dwi->use_git_diff_format,
+ dwi->pretty_print_mergeinfo,
dwi->ddi.session_relpath,
dwi->cancel_func,
dwi->cancel_baton,
@@ -2519,7 +2529,7 @@ create_diff_writer_info(diff_writer_info
* These cases require server communication.
*/
svn_error_t *
-svn_client_diff6(const apr_array_header_t *options,
+svn_client_diff7(const apr_array_header_t *options,
const char *path_or_url1,
const svn_opt_revision_t *revision1,
const char *path_or_url2,
@@ -2534,6 +2544,7 @@ svn_client_diff6(const apr_array_header_
svn_boolean_t ignore_properties,
svn_boolean_t properties_only,
svn_boolean_t use_git_diff_format,
+ svn_boolean_t pretty_print_mergeinfo,
const char *header_encoding,
svn_stream_t *outstream,
svn_stream_t *errstream,
@@ -2573,6 +2584,7 @@ svn_client_diff6(const apr_array_header_
dwi.no_diff_added = no_diff_added;
dwi.no_diff_deleted = no_diff_deleted;
dwi.show_copies_as_adds = show_copies_as_adds;
+ dwi.pretty_print_mergeinfo = pretty_print_mergeinfo;
dwi.cancel_func = ctx->cancel_func;
dwi.cancel_baton = ctx->cancel_baton;
@@ -2607,7 +2619,7 @@ svn_client_diff6(const apr_array_header_
}
svn_error_t *
-svn_client_diff_peg6(const apr_array_header_t *options,
+svn_client_diff_peg7(const apr_array_header_t *options,
const char *path_or_url,
const svn_opt_revision_t *peg_revision,
const svn_opt_revision_t *start_revision,
@@ -2622,6 +2634,7 @@ svn_client_diff_peg6(const apr_array_hea
svn_boolean_t ignore_properties,
svn_boolean_t properties_only,
svn_boolean_t use_git_diff_format,
+ svn_boolean_t pretty_print_mergeinfo,
const char *header_encoding,
svn_stream_t *outstream,
svn_stream_t *errstream,
@@ -2657,6 +2670,7 @@ svn_client_diff_peg6(const apr_array_hea
dwi.no_diff_added = no_diff_added;
dwi.no_diff_deleted = no_diff_deleted;
dwi.show_copies_as_adds = show_copies_as_adds;
+ dwi.pretty_print_mergeinfo = pretty_print_mergeinfo;
dwi.cancel_func = ctx->cancel_func;
dwi.cancel_baton = ctx->cancel_baton;
Modified: subversion/trunk/subversion/svn/diff-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/diff-cmd.c?rev=1822014&r1=1822013&r2=1822014&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/diff-cmd.c (original)
+++ subversion/trunk/subversion/svn/diff-cmd.c Tue Jan 23 15:25:29 2018
@@ -463,7 +463,7 @@ svn_cl__diff(apr_getopt_t *os,
ctx, iterpool));
}
else
- SVN_ERR(svn_client_diff6(
+ SVN_ERR(svn_client_diff7(
options,
target1,
&(opt_state->start_revision),
@@ -479,6 +479,7 @@ svn_cl__diff(apr_getopt_t *os,
ignore_properties,
opt_state->diff.properties_only,
opt_state->diff.use_git_diff_format,
+ TRUE /*pretty_print_mergeinfo*/,
svn_cmdline_output_encoding(pool),
outstream,
errstream,
@@ -515,7 +516,7 @@ svn_cl__diff(apr_getopt_t *os,
ctx, iterpool));
}
else
- SVN_ERR(svn_client_diff_peg6(
+ SVN_ERR(svn_client_diff_peg7(
options,
truepath,
&peg_revision,
@@ -531,6 +532,7 @@ svn_cl__diff(apr_getopt_t *os,
ignore_properties,
opt_state->diff.properties_only,
opt_state->diff.use_git_diff_format,
+ TRUE /*pretty_print_mergeinfo*/,
svn_cmdline_output_encoding(pool),
outstream,
errstream,