You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2011/07/20 22:22:21 UTC

svn commit: r1148918 - /subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c

Author: cmpilato
Date: Wed Jul 20 19:47:55 2011
New Revision: 1148918

URL: http://svn.apache.org/viewvc?view=rev&rev=1148918
Log:
Fix issue #3964 ("Inconsistent output in 'svn log' for revisions with
no changed paths").

* subversion/libsvn_ra_local/ra_plugin.c
  (log_receiver_wrapper): Was cancellation_log_receiver().  Now
    conditionally calls the cancellation callback.  Also, replace empty
    changed-paths hashes with NULL ones (like the other RA layers do).
  (svn_ra_local__get_log): Unconditionally use log_receiver_wrapper().

Modified:
   subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c

Modified: subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c
Url: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c?view=diff&rev=1148918&p1=subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c&r1=1148917&p2=subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c&r2=1148918
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c	(original)
+++ subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c	Wed Jul 20 19:47:55 2011
@@ -860,14 +860,24 @@ struct log_baton
 };
 
 static svn_error_t *
-cancellation_log_receiver(void *baton,
-                          svn_log_entry_t *log_entry,
-                          apr_pool_t *pool)
+log_receiver_wrapper(void *baton,
+                     svn_log_entry_t *log_entry,
+                     apr_pool_t *pool)
 {
   struct log_baton *b = baton;
   svn_ra_local__session_baton_t *sess = b->sess;
 
-  SVN_ERR((sess->callbacks->cancel_func)(sess->callback_baton));
+  if (sess->callbacks->cancel_func)
+    SVN_ERR((sess->callbacks->cancel_func)(sess->callback_baton));
+
+  /* For consistency with the other RA layers, replace an empty
+     changed-paths hash with a NULL one. */
+  if ((log_entry->changed_paths2)
+      && (apr_hash_count(log_entry->changed_paths2) == 0))
+    {
+      log_entry->changed_paths = NULL;
+      log_entry->changed_paths2 = NULL;
+    }
 
   return b->real_cb(b->real_baton, log_entry, pool);
 }
@@ -904,16 +914,11 @@ svn_ra_local__get_log(svn_ra_session_t *
         }
     }
 
-  if (sess->callbacks &&
-      sess->callbacks->cancel_func)
-    {
-      lb.real_cb = receiver;
-      lb.real_baton = receiver_baton;
-      lb.sess = sess;
-
-      receiver = cancellation_log_receiver;
-      receiver_baton = &lb;
-    }
+  lb.real_cb = receiver;
+  lb.real_baton = receiver_baton;
+  lb.sess = sess;
+  receiver = log_receiver_wrapper;
+  receiver_baton = &lb;
 
   return svn_repos_get_logs4(sess->repos,
                              abs_paths,