You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2013/07/14 01:02:29 UTC

svn commit: r1502909 - /subversion/trunk/subversion/libsvn_ra_svn/client.c

Author: rhuijben
Date: Sat Jul 13 23:02:29 2013
New Revision: 1502909

URL: http://svn.apache.org/r1502909
Log:
Following up on r1502811 and r1502901, make ra_serf capable of ignoring log
messages when the log callback returns a SVN_ERR_CEASE_INVOCATION value, to
allow re-using the ra-session after svn_ra_get_log2() returns.

* subversion/libsvn_ra_svn/client.c
  (ra_svn_log): Handle cease invocation error by skipping the result. Don't
    store the error instance to avoid having to combine errors everywhere.

Modified:
    subversion/trunk/subversion/libsvn_ra_svn/client.c

Modified: subversion/trunk/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/client.c?rev=1502909&r1=1502908&r2=1502909&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/client.c Sat Jul 13 23:02:29 2013
@@ -1501,6 +1501,7 @@ static svn_error_t *ra_svn_log(svn_ra_se
   svn_boolean_t want_author = FALSE;
   svn_boolean_t want_message = FALSE;
   svn_boolean_t want_date = FALSE;
+  svn_boolean_t cease_invocation = FALSE;
 
   SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w((!", "log"));
   if (paths)
@@ -1646,8 +1647,10 @@ static svn_error_t *ra_svn_log(svn_ra_se
         cphash = NULL;
 
       nreceived = 0;
-      if (! (limit && (nest_level == 0) && (++nreceived > limit)))
+      if (! (limit && (nest_level == 0) && (++nreceived > limit))
+          && ! cease_invocation)
         {
+          svn_error_t *err;
           log_entry = svn_log_entry_create(iterpool);
 
           log_entry->changed_paths = cphash;
@@ -1671,7 +1674,12 @@ static svn_error_t *ra_svn_log(svn_ra_se
             svn_hash_sets(log_entry->revprops,
                           SVN_PROP_REVISION_LOG, message);
 
-          SVN_ERR(receiver(receiver_baton, log_entry, iterpool));
+          err = receiver(receiver_baton, log_entry, iterpool);
+          if (err && err->apr_err == SVN_ERR_CEASE_INVOCATION)
+            {
+              svn_error_clear(err);
+              cease_invocation = TRUE;
+            }
           if (log_entry->has_children)
             {
               nest_level++;
@@ -1686,7 +1694,16 @@ static svn_error_t *ra_svn_log(svn_ra_se
   svn_pool_destroy(iterpool);
 
   /* Read the response. */
-  return svn_ra_svn__read_cmd_response(conn, pool, "");
+  {
+    svn_error_t *err = svn_ra_svn__read_cmd_response(conn, pool, "");
+
+    if (cease_invocation)
+      err = svn_error_compose_create(
+                svn_error_create(SVN_ERR_CEASE_INVOCATION, NULL, NULL),
+                err);
+
+    return svn_error_trace(err);
+  }
 }