aboutsummaryrefslogtreecommitdiffstats
path: root/subversion/svn/diff-cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/svn/diff-cmd.c')
-rw-r--r--subversion/svn/diff-cmd.c48
1 files changed, 37 insertions, 11 deletions
diff --git a/subversion/svn/diff-cmd.c b/subversion/svn/diff-cmd.c
index 9e389ec856a6..b5f3702033f0 100644
--- a/subversion/svn/diff-cmd.c
+++ b/subversion/svn/diff-cmd.c
@@ -181,6 +181,24 @@ summarize_regular(const svn_client_diff_summarize_t *summary,
return svn_cmdline_fflush(stdout);
}
+svn_error_t *
+svn_cl__get_diff_summary_writer(svn_client_diff_summarize_func_t *func_p,
+ void **baton_p,
+ svn_boolean_t xml,
+ svn_boolean_t ignore_properties,
+ const char *anchor,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ struct summarize_baton_t *b = apr_pcalloc(result_pool, sizeof(*b));
+
+ b->anchor = anchor;
+ b->ignore_properties = ignore_properties;
+ *func_p = xml ? summarize_xml : summarize_regular;
+ *baton_p = b;
+ return SVN_NO_ERROR;
+}
+
/* An svn_opt_subcommand_t to handle the 'diff' command.
This implements the `svn_opt_subcommand_t' interface. */
svn_error_t *
@@ -203,9 +221,6 @@ svn_cl__diff(apr_getopt_t *os,
svn_boolean_t ignore_properties =
opt_state->diff.patch_compatible || opt_state->diff.ignore_properties;
int i;
- struct summarize_baton_t summarize_baton;
- const svn_client_diff_summarize_func_t summarize_func =
- (opt_state->xml ? summarize_xml : summarize_regular);
if (opt_state->extensions)
options = svn_cstring_split(opt_state->extensions, " \t\n\r", TRUE, pool);
@@ -448,9 +463,13 @@ svn_cl__diff(apr_getopt_t *os,
if (opt_state->diff.summarize)
{
- summarize_baton.anchor = target1;
- summarize_baton.ignore_properties = ignore_properties;
+ svn_client_diff_summarize_func_t summarize_func;
+ void *summarize_baton;
+ SVN_ERR(svn_cl__get_diff_summary_writer(
+ &summarize_func, &summarize_baton,
+ opt_state->xml, ignore_properties, target1,
+ iterpool, iterpool));
SVN_ERR(svn_client_diff_summarize2(
target1,
&opt_state->start_revision,
@@ -459,11 +478,11 @@ svn_cl__diff(apr_getopt_t *os,
opt_state->depth,
! opt_state->diff.notice_ancestry,
opt_state->changelists,
- summarize_func, &summarize_baton,
+ summarize_func, summarize_baton,
ctx, iterpool));
}
else
- SVN_ERR(svn_client_diff6(
+ SVN_ERR(svn_client_diff7(
options,
target1,
&(opt_state->start_revision),
@@ -479,6 +498,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,
@@ -501,8 +521,13 @@ svn_cl__diff(apr_getopt_t *os,
if (opt_state->diff.summarize)
{
- summarize_baton.anchor = truepath;
- summarize_baton.ignore_properties = ignore_properties;
+ svn_client_diff_summarize_func_t summarize_func;
+ void *summarize_baton;
+
+ SVN_ERR(svn_cl__get_diff_summary_writer(
+ &summarize_func, &summarize_baton,
+ opt_state->xml, ignore_properties, truepath,
+ iterpool, iterpool));
SVN_ERR(svn_client_diff_summarize_peg2(
truepath,
&peg_revision,
@@ -511,11 +536,11 @@ svn_cl__diff(apr_getopt_t *os,
opt_state->depth,
! opt_state->diff.notice_ancestry,
opt_state->changelists,
- summarize_func, &summarize_baton,
+ summarize_func, summarize_baton,
ctx, iterpool));
}
else
- SVN_ERR(svn_client_diff_peg6(
+ SVN_ERR(svn_client_diff_peg7(
options,
truepath,
&peg_revision,
@@ -531,6 +556,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,