Author: julianfoad
Date: Fri Aug 26 09:37:29 2011
New Revision: 1162046

URL: http://svn.apache.org/viewvc?rev=1162046&view=rev
Log:
In 'diff --summarize', don't call the summarizing callback if there is no
change to report. A follow-up to r1159880.

* subversion/libsvn_client/repos_diff_summarize.c
  (send_summary): Assert that there is some change to report.
  (cb_file_changed): Don't send a summary if there is no change to report.

Modified:
    subversion/trunk/subversion/libsvn_client/repos_diff_summarize.c

Modified: subversion/trunk/subversion/libsvn_client/repos_diff_summarize.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/repos_diff_summarize.c?rev=1162046&r1=1162045&r2=1162046&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/repos_diff_summarize.c (original)
+++ subversion/trunk/subversion/libsvn_client/repos_diff_summarize.c Fri Aug 26 
09:37:29 2011
@@ -61,6 +61,9 @@ send_summary(struct summarize_baton_t *b
 {
   svn_client_diff_summarize_t *sum = apr_pcalloc(scratch_pool, sizeof(*sum));
 
+  SVN_ERR_ASSERT(summarize_kind != svn_client_diff_summarize_kind_normal
+                 || prop_changed);
+
   /* PATH is relative to the anchor of the diff, but SUM->path needs to be
      relative to the target of the diff. */
   sum->path = svn_relpath_skip_ancestor(b->target, path);
@@ -263,12 +266,13 @@ cb_file_changed(svn_wc_notify_state_t *c
 {
   struct summarize_baton_t *b = diff_baton;
   svn_boolean_t text_change = (tmpfile2 != NULL);
+  svn_boolean_t prop_change = props_changed(propchanges, scratch_pool);
 
-  SVN_ERR(send_summary(b, path,
-                       text_change ? svn_client_diff_summarize_kind_modified
-                                   : svn_client_diff_summarize_kind_normal,
-                       props_changed(propchanges, scratch_pool),
-                       svn_node_file, scratch_pool));
+  if (text_change || prop_change)
+    SVN_ERR(send_summary(b, path,
+                         text_change ? svn_client_diff_summarize_kind_modified
+                                     : svn_client_diff_summarize_kind_normal,
+                         prop_change, svn_node_file, scratch_pool));
 
   if (contentstate)
     *contentstate = svn_wc_notify_state_inapplicable;


Reply via email to