subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1515380 [8/15] - in /subversion/branches/move-tracking-1: ./ build/ac-macros/ build/generator/ build/generator/swig/ build/generator/templates/ contrib/client-side/emacs/ doc/programmer/ notes/http-and-webdav/ subversion/ subversion/bindin...
Date Mon, 19 Aug 2013 12:07:58 GMT
Modified: subversion/branches/move-tracking-1/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_ra_serf/update.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_ra_serf/update.c Mon Aug 19 12:07:51 2013
@@ -31,6 +31,7 @@
 
 #include <serf.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_pools.h"
 #include "svn_ra.h"
@@ -41,7 +42,6 @@
 #include "svn_base64.h"
 #include "svn_props.h"
 
-#include "svn_private_config.h"
 #include "private/svn_dep_compat.h"
 #include "private/svn_fspath.h"
 #include "private/svn_string_private.h"
@@ -82,7 +82,7 @@ typedef enum report_state_e {
     NEED_PROP_NAME,
     TXDELTA
 
-#ifdef USE_TRANSITION_PARSER
+#ifdef NOT_USED_YET
     ,
 
     CHECKED_IN,
@@ -390,6 +390,9 @@ struct report_context_t {
   /* The path to the REPORT request */
   const char *path;
 
+  /* Are we done parsing the REPORT response? */
+  svn_boolean_t done;
+
   /* Did we receive all data from the network? */
   svn_boolean_t report_received;
 
@@ -411,7 +414,7 @@ struct report_context_t {
 #define V_ SVN_DAV_PROP_NS_DAV
 static const svn_ra_serf__xml_transition_t update_ttable[] = {
   { INITIAL, S_, "update-report", UPDATE_REPORT,
-    FALSE, { NULL }, TRUE },
+    FALSE, { NULL }, FALSE },
 
   { UPDATE_REPORT, S_, "target-revision", TARGET_REVISION,
     FALSE, { "rev", NULL }, TRUE },
@@ -2565,6 +2568,7 @@ update_closed(svn_ra_serf__xml_estate_t 
   if (leaving_state == UPDATE_REPORT)
     {
       ctx->report_completed = TRUE;
+      ctx->done = TRUE;
     }
   else if (leaving_state == TARGET_REVISION)
     {
@@ -2816,10 +2820,9 @@ finish_report(void *report_baton,
   report_context_t *report = report_baton;
   svn_ra_serf__session_t *sess = report->sess;
   svn_ra_serf__handler_t *handler;
+  svn_ra_serf__xml_parser_t *parser_ctx;
 #ifdef USE_TRANSITION_PARSER
   svn_ra_serf__xml_context_t *xmlctx;
-#else
-  svn_ra_serf__xml_parser_t *parser_ctx;
 #endif
   const char *report_target;
   svn_stringbuf_t *buf = NULL;
@@ -2882,7 +2885,7 @@ finish_report(void *report_baton,
   parser_ctx->start = start_report;
   parser_ctx->end = end_report;
   parser_ctx->cdata = cdata_report;
-  parser_ctx->done = &handler->done;
+  parser_ctx->done = &report->done;
 
   handler->response_handler = svn_ra_serf__handle_xml_parser;
   handler->response_baton = parser_ctx;
@@ -2902,7 +2905,7 @@ finish_report(void *report_baton,
      network or because we've spooled the entire response into our "pending"
      content of the XML parser. The DONE flag will get set when all the
      XML content has been received *and* parsed.  */
-  while (!handler->done
+  while (!report->done
          || report->num_active_fetches
          || report->num_active_propfinds)
     {
@@ -3144,7 +3147,6 @@ finish_report(void *report_baton,
         }
       report->done_dir_propfinds = NULL;
 
-#ifndef USE_TRANSITION_PARSER
       /* If the parser is paused, and the number of active requests has
          dropped far enough, then resume parsing.  */
       if (parser_ctx->paused
@@ -3159,7 +3161,6 @@ finish_report(void *report_baton,
         SVN_ERR(svn_ra_serf__process_pending(parser_ctx,
                                              &report->report_received,
                                              iterpool_inner));
-#endif
 
       /* Debugging purposes only! */
       for (i = 0; i < sess->num_conns; i++)
@@ -3280,6 +3281,7 @@ make_update_reporter(svn_ra_session_t *r
 
   report->update_editor = update_editor;
   report->update_baton = update_baton;
+  report->done = FALSE;
 
   *reporter = &ra_serf_reporter;
   *report_baton = report;

Modified: subversion/branches/move-tracking-1/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_ra_serf/util.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_ra_serf/util.c Mon Aug 19 12:07:51 2013
@@ -35,10 +35,10 @@
 
 #include <expat.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_dirent_uri.h"
 #include "svn_path.h"
-#include "svn_private_config.h"
 #include "svn_string.h"
 #include "svn_xml.h"
 #include "svn_props.h"
@@ -192,13 +192,65 @@ construct_realm(svn_ra_serf__session_t *
 static char *
 convert_organisation_to_str(apr_hash_t *org, apr_pool_t *pool)
 {
-  return apr_psprintf(pool, "%s, %s, %s, %s, %s (%s)",
-                      (char*)svn_hash_gets(org, "OU"),
-                      (char*)svn_hash_gets(org, "O"),
-                      (char*)svn_hash_gets(org, "L"),
-                      (char*)svn_hash_gets(org, "ST"),
-                      (char*)svn_hash_gets(org, "C"),
-                      (char*)svn_hash_gets(org, "E"));
+  const char *org_unit = svn_hash_gets(org, "OU");
+  const char *org_name = svn_hash_gets(org, "O");
+  const char *locality = svn_hash_gets(org, "L");
+  const char *state = svn_hash_gets(org, "ST");
+  const char *country = svn_hash_gets(org, "C");
+  const char *email = svn_hash_gets(org, "E");
+  svn_stringbuf_t *buf = svn_stringbuf_create_empty(pool);
+
+  if (org_unit)
+    {
+      svn_stringbuf_appendcstr(buf, org_unit);
+      svn_stringbuf_appendcstr(buf, ", ");
+    }
+
+  if (org_name)
+    {
+      svn_stringbuf_appendcstr(buf, org_name);
+      svn_stringbuf_appendcstr(buf, ", ");
+    }
+
+  if (locality)
+    {
+      svn_stringbuf_appendcstr(buf, locality);
+      svn_stringbuf_appendcstr(buf, ", ");
+    }
+
+  if (state)
+    {
+      svn_stringbuf_appendcstr(buf, state);
+      svn_stringbuf_appendcstr(buf, ", ");
+    }
+
+  if (country)
+    {
+      svn_stringbuf_appendcstr(buf, country);
+      svn_stringbuf_appendcstr(buf, ", ");
+    }
+
+  /* Chop ', ' if any. */
+  svn_stringbuf_chop(buf, 2);
+
+  if (email)
+    {
+      svn_stringbuf_appendcstr(buf, "(");
+      svn_stringbuf_appendcstr(buf, email);
+      svn_stringbuf_appendcstr(buf, ")");
+    }
+
+  return buf->data;
+}
+
+static void append_reason(svn_stringbuf_t *errmsg, const char *reason, int *reasons)
+{
+  if (*reasons < 1)
+    svn_stringbuf_appendcstr(errmsg, _(": "));
+  else
+    svn_stringbuf_appendcstr(errmsg, _(", "));
+  svn_stringbuf_appendcstr(errmsg, reason);
+  (*reasons)++;
 }
 
 /* This function is called on receiving a ssl certificate of a server when
@@ -259,11 +311,12 @@ ssl_server_cert(void *baton, int failure
       for (i = 0; i < san->nelts; i++) {
           char *s = APR_ARRAY_IDX(san, i, char*);
           if (apr_fnmatch(s, conn->session->session_url.hostname,
-                          APR_FNM_PERIOD) == APR_SUCCESS) {
+                          APR_FNM_PERIOD | APR_FNM_CASE_BLIND) == APR_SUCCESS)
+            {
               found_matching_hostname = 1;
               cert_info.hostname = s;
               break;
-          }
+            }
       }
   }
 
@@ -271,7 +324,7 @@ ssl_server_cert(void *baton, int failure
   if (!found_matching_hostname && cert_info.hostname)
     {
       if (apr_fnmatch(cert_info.hostname, conn->session->session_url.hostname,
-                      APR_FNM_PERIOD) == APR_FNM_NOMATCH)
+                      APR_FNM_PERIOD | APR_FNM_CASE_BLIND) == APR_FNM_NOMATCH)
         {
           svn_failures |= SVN_AUTH_SSL_CNMISMATCH;
         }
@@ -302,7 +355,35 @@ ssl_server_cert(void *baton, int failure
                          SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO, NULL);
 
   if (!server_creds)
-    return svn_error_create(SVN_ERR_RA_SERF_SSL_CERT_UNTRUSTED, NULL, NULL);
+    {
+      svn_stringbuf_t *errmsg;
+      int reasons = 0;
+
+      errmsg = svn_stringbuf_create(
+                 _("Server SSL certificate verification failed"),
+                 scratch_pool);
+
+
+      if (svn_failures & SVN_AUTH_SSL_NOTYETVALID)
+        append_reason(errmsg, _("certificate is not yet valid"), &reasons);
+
+      if (svn_failures & SVN_AUTH_SSL_EXPIRED)
+        append_reason(errmsg, _("certificate has expired"), &reasons);
+
+      if (svn_failures & SVN_AUTH_SSL_CNMISMATCH)
+        append_reason(errmsg,
+                      _("certificate issued for a different hostname"),
+                      &reasons);
+
+      if (svn_failures & SVN_AUTH_SSL_UNKNOWNCA)
+        append_reason(errmsg, _("issuer is not trusted"), &reasons);
+
+      if (svn_failures & SVN_AUTH_SSL_OTHER)
+        append_reason(errmsg, _("and other reason(s)"), &reasons);
+
+      return svn_error_create(SVN_ERR_RA_SERF_SSL_CERT_UNTRUSTED, NULL,
+                              errmsg->data);
+    }
 
   return SVN_NO_ERROR;
 }
@@ -476,7 +557,7 @@ connection_closed(svn_ra_serf__connectio
 {
   if (why)
     {
-      SVN_ERR_MALFUNCTION();
+      return svn_error_wrap_apr(why, NULL);
     }
 
   if (conn->session->using_ssl)
@@ -747,8 +828,6 @@ svn_ra_serf__context_run_wait(svn_boolea
          the connection timed out.  */
       if (APR_STATUS_IS_TIMEUP(status))
         {
-          svn_error_clear(err);
-          err = SVN_NO_ERROR;
           status = 0;
 
           if (sess->timeout)
@@ -759,8 +838,11 @@ svn_ra_serf__context_run_wait(svn_boolea
                 }
               else
                 {
-                  return svn_error_create(SVN_ERR_RA_DAV_CONN_TIMEOUT, NULL,
-                                          _("Connection timed out"));
+                  return
+                      svn_error_compose_create(
+                            err,
+                            svn_error_create(SVN_ERR_RA_DAV_CONN_TIMEOUT, NULL,
+                                             _("Connection timed out")));
                 }
             }
         }
@@ -808,6 +890,23 @@ svn_ra_serf__context_run_one(svn_ra_serf
   /* Wait until the response logic marks its DONE status.  */
   err = svn_ra_serf__context_run_wait(&handler->done, handler->session,
                                       scratch_pool);
+
+  /* A callback invocation has been canceled. In this simple case of
+     context_run_one, we can keep the ra-session operational by resetting
+     the connection.
+
+     If we don't do this, the next context run will notice that the connection
+     is still in the error state and will just return SVN_ERR_CEASE_INVOCATION
+     (=the last error for the connection) again  */
+  if (err && err->apr_err == SVN_ERR_CEASE_INVOCATION)
+    {
+      apr_status_t status = serf_connection_reset(handler->conn->conn);
+
+      if (status)
+        err = svn_error_compose_create(err,
+                                       svn_ra_serf__wrap_err(status, NULL));
+    }
+
   if (handler->server_error)
     {
       err = svn_error_compose_create(err, handler->server_error->error);
@@ -1391,19 +1490,22 @@ inject_to_parser(svn_ra_serf__xml_parser
   int xml_status;
 
   xml_status = XML_Parse(ctx->xmlp, data, (int) len, 0);
-  if (xml_status == XML_STATUS_ERROR && !ctx->ignore_errors)
+
+  if (! ctx->ignore_errors)
     {
-      if (sl == NULL)
-        return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
-                                 _("XML parsing failed"));
+      SVN_ERR(ctx->error);
 
-      return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
-                               _("XML parsing failed: (%d %s)"),
-                               sl->code, sl->reason);
-    }
+      if (xml_status != XML_STATUS_OK)
+        {
+          if (sl == NULL)
+            return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
+                                     _("XML parsing failed"));
 
-  if (ctx->error && !ctx->ignore_errors)
-    return svn_error_trace(ctx->error);
+          return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
+                                   _("XML parsing failed: (%d %s)"),
+                                   sl->code, sl->reason);
+        }
+     }
 
   return SVN_NO_ERROR;
 }
@@ -1484,14 +1586,26 @@ svn_ra_serf__process_pending(svn_ra_serf
   if (pending_empty &&
       parser->pending->network_eof)
     {
+      int xml_status;
       SVN_ERR_ASSERT(parser->xmlp != NULL);
 
-      /* Tell the parser that no more content will be parsed. Ignore the
-         return status. We just don't care.  */
-      (void) XML_Parse(parser->xmlp, NULL, 0, 1);
+      /* Tell the parser that no more content will be parsed. */
+      xml_status = XML_Parse(parser->xmlp, NULL, 0, 1);
 
       apr_pool_cleanup_run(parser->pool, &parser->xmlp, xml_parser_cleanup);
       parser->xmlp = NULL;
+
+      if (! parser->ignore_errors)
+        {
+          SVN_ERR(parser->error);
+
+          if (xml_status != XML_STATUS_OK)
+            {
+              return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
+                                       _("XML parsing failed"));
+            }
+        }
+
       add_done_item(parser);
     }
 
@@ -1591,22 +1705,6 @@ svn_ra_serf__handle_xml_parser(serf_requ
       return svn_error_trace(err);
     }
 
-  if (ctx->headers_baton == NULL)
-    ctx->headers_baton = serf_bucket_response_get_headers(response);
-  else if (ctx->headers_baton != serf_bucket_response_get_headers(response))
-    {
-      /* We got a new response to an existing parser...
-         This tells us the connection has restarted and we should continue
-         where we stopped last time.
-       */
-
-      /* Is this a second attempt?? */
-      if (!ctx->skip_size)
-        ctx->skip_size = ctx->read_size;
-
-      ctx->read_size = 0; /* New request, nothing read */
-    }
-
   if (!ctx->xmlp)
     {
       ctx->xmlp = XML_ParserCreate(NULL);
@@ -1626,41 +1724,11 @@ svn_ra_serf__handle_xml_parser(serf_requ
       apr_size_t len;
 
       status = serf_bucket_read(response, PARSE_CHUNK_SIZE, &data, &len);
-
       if (SERF_BUCKET_READ_ERROR(status))
         {
           return svn_ra_serf__wrap_err(status, NULL);
         }
 
-      ctx->read_size += len;
-
-      if (ctx->skip_size)
-        {
-          /* Handle restarted requests correctly: Skip what we already read */
-          apr_size_t skip;
-
-          if (ctx->skip_size >= ctx->read_size)
-            {
-            /* Eek.  What did the file shrink or something? */
-              if (APR_STATUS_IS_EOF(status))
-                {
-                  SVN_ERR_MALFUNCTION();
-                }
-
-              /* Skip on to the next iteration of this loop. */
-              if (APR_STATUS_IS_EAGAIN(status))
-                {
-                  return svn_ra_serf__wrap_err(status, NULL);
-                }
-              continue;
-            }
-
-          skip = (apr_size_t)(len - (ctx->read_size - ctx->skip_size));
-          data += skip;
-          len -= skip;
-          ctx->skip_size = 0;
-        }
-
       /* Note: once the callbacks invoked by inject_to_parser() sets the
          PAUSED flag, then it will not be cleared. write_to_pending() will
          only save the content. Logic outside of serf_context_run() will
@@ -1706,12 +1774,25 @@ svn_ra_serf__handle_xml_parser(serf_requ
              in the PENDING structures, then we're completely done.  */
           if (!HAS_PENDING_DATA(ctx->pending))
             {
+              int xml_status;
               SVN_ERR_ASSERT(ctx->xmlp != NULL);
 
-              /* Ignore the return status. We just don't care.  */
-              (void) XML_Parse(ctx->xmlp, NULL, 0, 1);
+              xml_status = XML_Parse(ctx->xmlp, NULL, 0, 1);
 
               apr_pool_cleanup_run(ctx->pool, &ctx->xmlp, xml_parser_cleanup);
+
+              if (! ctx->ignore_errors)
+                {
+                  SVN_ERR(ctx->error);
+
+                  if (xml_status != XML_STATUS_OK)
+                    {
+                      return svn_error_create(
+                                    SVN_ERR_XML_MALFORMED, NULL,
+                                    _("The XML response contains invalid XML"));
+                    }
+                }
+
               add_done_item(ctx);
             }
 
@@ -1831,12 +1912,26 @@ handle_response(serf_request_t *request,
     {
       /* Uh-oh. Our connection died.  */
       if (handler->response_error)
-        SVN_ERR(handler->response_error(request, response, 0,
-                                        handler->response_error_baton));
-
-      /* Requeue another request for this handler.
-         ### how do we know if the handler can deal with this?!  */
-      svn_ra_serf__request_create(handler);
+        {
+          /* Give a handler chance to prevent request requeue. */
+          SVN_ERR(handler->response_error(request, response, 0,
+                                          handler->response_error_baton));
+
+          svn_ra_serf__request_create(handler);
+        }
+      /* Response error callback is not configured. Requeue another request
+         for this handler only if we didn't started to process body.
+         Return error otherwise. */
+      else if (!handler->reading_body)
+        {
+          svn_ra_serf__request_create(handler);
+        }
+      else
+        {
+          return svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
+                                    _("%s request on '%s' failed"),
+                                   handler->method, handler->path);
+        }
 
       return SVN_NO_ERROR;
     }
@@ -2416,8 +2511,14 @@ svn_ra_serf__error_on_status(serf_status
 
       case 411:
         return svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
-                                _("DAV request failed: "
-                                  "Content length required"));
+                    _("DAV request failed: 411 Content length required. The "
+                      "server or an intermediate proxy does not accept "
+                      "chunked encoding. Try setting 'http-chunked-requests' "
+                      "to 'auto' or 'no' in your client configuration."));
+      case 501:
+        return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+                                 _("The requested feature is not supported by "
+                                   "'%s'"), path);
     }
 
   if (sline.code >= 300)

Modified: subversion/branches/move-tracking-1/subversion/libsvn_ra_serf/xml.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_ra_serf/xml.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_ra_serf/xml.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_ra_serf/xml.c Mon Aug 19 12:07:51 2013
@@ -26,6 +26,7 @@
 #include <apr_uri.h>
 #include <serf.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_pools.h"
 #include "svn_ra.h"
@@ -36,7 +37,6 @@
 #include "svn_delta.h"
 #include "svn_path.h"
 
-#include "svn_private_config.h"
 #include "private/svn_string_private.h"
 
 #include "ra_serf.h"

Modified: subversion/branches/move-tracking-1/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_ra_svn/client.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_ra_svn/client.c Mon Aug 19 12:07:51 2013
@@ -32,6 +32,7 @@
 #include <apr_network_io.h>
 #include <apr_uri.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_types.h"
 #include "svn_string.h"
@@ -47,8 +48,6 @@
 #include "svn_mergeinfo.h"
 #include "svn_version.h"
 
-#include "svn_private_config.h"
-
 #include "private/svn_fspath.h"
 #include "private/svn_subr_private.h"
 
@@ -702,7 +701,7 @@ static svn_error_t *open_session(svn_ra_
   N_("Module for accessing a repository using the svn network protocol.")
 #endif
 
-static const char *ra_svn_get_description(void)
+static const char *ra_svn_get_description(apr_pool_t *pool)
 {
   return _(RA_SVN_DESCRIPTION);
 }
@@ -1479,16 +1478,19 @@ static svn_error_t *ra_svn_diff(svn_ra_s
 }
 
 
-static svn_error_t *ra_svn_log(svn_ra_session_t *session,
-                               const apr_array_header_t *paths,
-                               svn_revnum_t start, svn_revnum_t end,
-                               int limit,
-                               svn_boolean_t discover_changed_paths,
-                               svn_boolean_t strict_node_history,
-                               svn_boolean_t include_merged_revisions,
-                               const apr_array_header_t *revprops,
-                               svn_log_entry_receiver_t receiver,
-                               void *receiver_baton, apr_pool_t *pool)
+static svn_error_t *
+perform_ra_svn_log(svn_error_t **outer_error,
+                   svn_ra_session_t *session,
+                   const apr_array_header_t *paths,
+                   svn_revnum_t start, svn_revnum_t end,
+                   int limit,
+                   svn_boolean_t discover_changed_paths,
+                   svn_boolean_t strict_node_history,
+                   svn_boolean_t include_merged_revisions,
+                   const apr_array_header_t *revprops,
+                   svn_log_entry_receiver_t receiver,
+                   void *receiver_baton,
+                   apr_pool_t *pool)
 {
   svn_ra_svn__session_baton_t *sess_baton = session->priv;
   svn_ra_svn_conn_t *conn = sess_baton->conn;
@@ -1501,6 +1503,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;
+  int nreceived = 0;
 
   SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w((!", "log"));
   if (paths)
@@ -1562,7 +1565,6 @@ static svn_error_t *ra_svn_log(svn_ra_se
       svn_ra_svn_item_t *item;
       apr_hash_t *cphash;
       svn_revnum_t rev;
-      int nreceived;
 
       svn_pool_clear(iterpool);
       SVN_ERR(svn_ra_svn__read_item(conn, iterpool, &item));
@@ -1645,9 +1647,14 @@ static svn_error_t *ra_svn_log(svn_ra_se
       else
         cphash = NULL;
 
-      nreceived = 0;
-      if (! (limit && (nest_level == 0) && (++nreceived > limit)))
+      /* Invoke RECEIVER
+          - Except if the server sends more than a >= 1 limit top level items
+          - Or when the callback reported a SVN_ERR_CEASE_INVOCATION
+            in an earlier invocation. */
+      if (! (limit && (nest_level == 0) && (++nreceived > limit))
+          && ! *outer_error)
         {
+          svn_error_t *err;
           log_entry = svn_log_entry_create(iterpool);
 
           log_entry->changed_paths = cphash;
@@ -1671,7 +1678,15 @@ 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)
+            {
+              *outer_error = svn_error_trace(
+                                svn_error_compose_create(*outer_error, err));
+            }
+          else
+            SVN_ERR(err);
+
           if (log_entry->has_children)
             {
               nest_level++;
@@ -1686,10 +1701,41 @@ 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, "");
+  return svn_error_trace(svn_ra_svn__read_cmd_response(conn, pool, ""));
+}
+
+static svn_error_t *
+ra_svn_log(svn_ra_session_t *session,
+           const apr_array_header_t *paths,
+           svn_revnum_t start, svn_revnum_t end,
+           int limit,
+           svn_boolean_t discover_changed_paths,
+           svn_boolean_t strict_node_history,
+           svn_boolean_t include_merged_revisions,
+           const apr_array_header_t *revprops,
+           svn_log_entry_receiver_t receiver,
+           void *receiver_baton, apr_pool_t *pool)
+{
+  svn_error_t *outer_error = NULL;
+  svn_error_t *err;
+
+  err = svn_error_trace(perform_ra_svn_log(&outer_error,
+                                           session, paths,
+                                           start, end,
+                                           limit,
+                                           discover_changed_paths,
+                                           strict_node_history,
+                                           include_merged_revisions,
+                                           revprops,
+                                           receiver, receiver_baton,
+                                           pool));
+  return svn_error_trace(
+            svn_error_compose_create(outer_error,
+                                     err));
 }
 
 
+
 static svn_error_t *ra_svn_check_path(svn_ra_session_t *session,
                                       const char *path, svn_revnum_t rev,
                                       svn_node_kind_t *kind, apr_pool_t *pool)
@@ -1963,7 +2009,7 @@ static svn_error_t *ra_svn_get_file_revs
         {
           svn_stream_t *stream;
 
-          if (d_handler)
+          if (d_handler && d_handler != svn_delta_noop_window_handler)
             stream = svn_txdelta_parse_svndiff(d_handler, d_baton, TRUE,
                                                rev_pool);
           else
@@ -2730,7 +2776,7 @@ svn_ra_svn__init(const svn_version_t *lo
       { NULL, NULL }
     };
 
-  SVN_ERR(svn_ver_check_list(svn_ra_svn_version(), checklist));
+  SVN_ERR(svn_ver_check_list2(svn_ra_svn_version(), checklist, svn_ver_equal));
 
   /* Simplified version check to make sure we can safely use the
      VTABLE parameter. The RA loader does a more exhaustive check. */

Modified: subversion/branches/move-tracking-1/subversion/libsvn_ra_svn/editorp.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_ra_svn/editorp.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_ra_svn/editorp.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_ra_svn/editorp.c Mon Aug 19 12:07:51 2013
@@ -28,6 +28,7 @@
 #include <apr_general.h>
 #include <apr_strings.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_types.h"
 #include "svn_string.h"
@@ -37,7 +38,6 @@
 #include "svn_ra_svn.h"
 #include "svn_path.h"
 #include "svn_pools.h"
-#include "svn_private_config.h"
 
 #include "private/svn_fspath.h"
 #include "private/svn_editor.h"

Modified: subversion/branches/move-tracking-1/subversion/libsvn_ra_svn/marshal.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_ra_svn/marshal.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_ra_svn/marshal.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_ra_svn/marshal.c Mon Aug 19 12:07:51 2013
@@ -32,13 +32,13 @@
 #include <apr_lib.h>
 #include <apr_strings.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_types.h"
 #include "svn_string.h"
 #include "svn_error.h"
 #include "svn_pools.h"
 #include "svn_ra_svn.h"
-#include "svn_private_config.h"
 #include "svn_ctype.h"
 #include "svn_time.h"
 
@@ -411,7 +411,7 @@ static svn_error_t *readbuf_fill(svn_ra_
   return SVN_NO_ERROR;
 }
 
-static APR_INLINE svn_error_t *
+static SVN__FORCE_INLINE svn_error_t *
 readbuf_getchar(svn_ra_svn_conn_t *conn, apr_pool_t *pool, char *result)
 {
   if (conn->read_ptr == conn->read_end)
@@ -1534,6 +1534,58 @@ svn_ra_svn__read_cmd_response(svn_ra_svn
                            status);
 }
 
+static svn_error_t *
+svn_ra_svn__handle_command(svn_boolean_t *terminate,
+                           apr_hash_t *cmd_hash,
+                           void *baton,
+                           svn_ra_svn_conn_t *conn,
+                           svn_boolean_t error_on_disconnect,
+                           apr_pool_t *iterpool)
+{
+  const char *cmdname;
+  svn_error_t *err, *write_err;
+  apr_array_header_t *params;
+  const svn_ra_svn_cmd_entry_t *command;
+
+  err = svn_ra_svn__read_tuple(conn, iterpool, "wl", &cmdname, &params);
+  if (err)
+    {
+      if (!error_on_disconnect
+          && err->apr_err == SVN_ERR_RA_SVN_CONNECTION_CLOSED)
+        {
+          svn_error_clear(err);
+          *terminate = TRUE;
+          return SVN_NO_ERROR;
+        }
+      return err;
+    }
+  command = svn_hash_gets(cmd_hash, cmdname);
+
+  if (command)
+    err = (*command->handler)(conn, iterpool, params, baton);
+  else
+    {
+      err = svn_error_createf(SVN_ERR_RA_SVN_UNKNOWN_CMD, NULL,
+                              _("Unknown editor command '%s'"), cmdname);
+      err = svn_error_create(SVN_ERR_RA_SVN_CMD_ERR, err, NULL);
+    }
+
+  if (err && err->apr_err == SVN_ERR_RA_SVN_CMD_ERR)
+    {
+      write_err = svn_ra_svn__write_cmd_failure(
+                      conn, iterpool,
+                      svn_ra_svn__locate_real_error_child(err));
+      svn_error_clear(err);
+      if (write_err)
+        return write_err;
+    }
+  else if (err)
+    return err;
+
+  *terminate = (command && command->terminate);
+  return SVN_NO_ERROR;
+}
+
 svn_error_t *
 svn_ra_svn__handle_commands2(svn_ra_svn_conn_t *conn,
                              apr_pool_t *pool,
@@ -1543,10 +1595,7 @@ svn_ra_svn__handle_commands2(svn_ra_svn_
 {
   apr_pool_t *subpool = svn_pool_create(pool);
   apr_pool_t *iterpool = svn_pool_create(subpool);
-  const char *cmdname;
   const svn_ra_svn_cmd_entry_t *command;
-  svn_error_t *err, *write_err;
-  apr_array_header_t *params;
   apr_hash_t *cmd_hash = apr_hash_make(subpool);
 
   for (command = commands; command->cmdname; command++)
@@ -1554,43 +1603,18 @@ svn_ra_svn__handle_commands2(svn_ra_svn_
 
   while (1)
     {
+      svn_boolean_t terminate;
+      svn_error_t *err;
       svn_pool_clear(iterpool);
-      err = svn_ra_svn__read_tuple(conn, iterpool, "wl", &cmdname, &params);
-      if (err)
-        {
-          if (!error_on_disconnect
-              && err->apr_err == SVN_ERR_RA_SVN_CONNECTION_CLOSED)
-            {
-              svn_error_clear(err);
-              svn_pool_destroy(subpool);
-              return SVN_NO_ERROR;
-            }
-          return err;
-        }
-      command = svn_hash_gets(cmd_hash, cmdname);
-
-      if (command)
-        err = (*command->handler)(conn, iterpool, params, baton);
-      else
-        {
-          err = svn_error_createf(SVN_ERR_RA_SVN_UNKNOWN_CMD, NULL,
-                                  _("Unknown editor command '%s'"), cmdname);
-          err = svn_error_create(SVN_ERR_RA_SVN_CMD_ERR, err, NULL);
-        }
 
-      if (err && err->apr_err == SVN_ERR_RA_SVN_CMD_ERR)
+      err = svn_ra_svn__handle_command(&terminate, cmd_hash, baton, conn,
+                                       error_on_disconnect, iterpool);
+      if (err)
         {
-          write_err = svn_ra_svn__write_cmd_failure(
-                          conn, iterpool,
-                          svn_ra_svn__locate_real_error_child(err));
-          svn_error_clear(err);
-          if (write_err)
-            return write_err;
+          svn_pool_destroy(subpool);
+          return svn_error_trace(err);
         }
-      else if (err)
-        return err;
-
-      if (command && command->terminate)
+      if (terminate)
         break;
     }
   svn_pool_destroy(iterpool);
@@ -2404,7 +2428,7 @@ svn_ra_svn__write_data_log_entry(svn_ra_
                                  const svn_string_t *message,
                                  svn_boolean_t has_children,
                                  svn_boolean_t invalid_revnum,
-                                 int revprop_count)
+                                 unsigned revprop_count)
 {
   SVN_ERR(write_tuple_revision(conn, pool, revision));
   SVN_ERR(write_tuple_start_list(conn, pool));

Modified: subversion/branches/move-tracking-1/subversion/libsvn_repos/authz.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_repos/authz.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_repos/authz.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_repos/authz.c Mon Aug 19 12:07:51 2013
@@ -26,6 +26,7 @@
 #include <apr_pools.h>
 #include <apr_file_io.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_pools.h"
 #include "svn_error.h"

Modified: subversion/branches/move-tracking-1/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_repos/commit.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_repos/commit.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_repos/commit.c Mon Aug 19 12:07:51 2013
@@ -26,6 +26,7 @@
 #include <apr_pools.h>
 #include <apr_file_io.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_compat.h"
 #include "svn_pools.h"
@@ -39,7 +40,6 @@
 #include "svn_ctype.h"
 #include "svn_props.h"
 #include "svn_mergeinfo.h"
-#include "svn_private_config.h"
 
 #include "repos.h"
 

Modified: subversion/branches/move-tracking-1/subversion/libsvn_repos/delta.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_repos/delta.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_repos/delta.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_repos/delta.c Mon Aug 19 12:07:51 2013
@@ -24,6 +24,7 @@
 
 #include <apr_hash.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_types.h"
 #include "svn_delta.h"
@@ -33,7 +34,6 @@
 #include "svn_repos.h"
 #include "svn_pools.h"
 #include "svn_props.h"
-#include "svn_private_config.h"
 #include "repos.h"
 
 

Modified: subversion/branches/move-tracking-1/subversion/libsvn_repos/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_repos/deprecated.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_repos/deprecated.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_repos/deprecated.c Mon Aug 19 12:07:51 2013
@@ -26,13 +26,12 @@
    deprecated functions in this file. */
 #define SVN_DEPRECATED
 
+#include "svn_private_config.h"
 #include "svn_repos.h"
 #include "svn_compat.h"
 #include "svn_hash.h"
 #include "svn_props.h"
 
-#include "svn_private_config.h"
-
 #include "repos.h"
 
 

Modified: subversion/branches/move-tracking-1/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_repos/dump.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_repos/dump.c Mon Aug 19 12:07:51 2013
@@ -1384,6 +1384,7 @@ verify_one_revision(svn_fs_t *fs,
                                             &cancel_edit_baton,
                                             scratch_pool));
   SVN_ERR(svn_fs_revision_root(&to_root, fs, rev, scratch_pool));
+  SVN_ERR(svn_fs_verify_root(to_root, scratch_pool));
   SVN_ERR(svn_repos_replay2(to_root, "", SVN_INVALID_REVNUM, FALSE,
                             cancel_editor, cancel_edit_baton,
                             NULL, NULL, scratch_pool));

Modified: subversion/branches/move-tracking-1/subversion/libsvn_repos/fs-wrap.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_repos/fs-wrap.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_repos/fs-wrap.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_repos/fs-wrap.c Mon Aug 19 12:07:51 2013
@@ -24,6 +24,7 @@
 #include <string.h>
 #include <ctype.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_pools.h"
 #include "svn_error.h"
@@ -34,7 +35,7 @@
 #include "svn_time.h"
 #include "svn_sorts.h"
 #include "repos.h"
-#include "svn_private_config.h"
+
 #include "private/svn_repos_private.h"
 #include "private/svn_utf_private.h"
 #include "private/svn_fspath.h"

Modified: subversion/branches/move-tracking-1/subversion/libsvn_repos/hooks.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_repos/hooks.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_repos/hooks.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_repos/hooks.c Mon Aug 19 12:07:51 2013
@@ -27,6 +27,7 @@
 #include <apr_pools.h>
 #include <apr_file_io.h>
 
+#include "svn_private_config.h"
 #include "svn_config.h"
 #include "svn_hash.h"
 #include "svn_error.h"
@@ -36,7 +37,7 @@
 #include "svn_repos.h"
 #include "svn_utf.h"
 #include "repos.h"
-#include "svn_private_config.h"
+
 #include "private/svn_fs_private.h"
 #include "private/svn_repos_private.h"
 #include "private/svn_string_private.h"

Modified: subversion/branches/move-tracking-1/subversion/libsvn_repos/load-fs-vtable.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_repos/load-fs-vtable.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_repos/load-fs-vtable.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_repos/load-fs-vtable.c Mon Aug 19 12:07:51 2013
@@ -99,6 +99,9 @@ struct revision_baton
   apr_int32_t rev_offset;
   svn_boolean_t skipped;
 
+  /* Array of svn_prop_t with revision properties. */
+  apr_array_header_t *revprops;
+
   struct parse_baton *pb;
   apr_pool_t *pool;
 };
@@ -448,6 +451,7 @@ make_revision_baton(apr_hash_t *headers,
   rb->pb = pb;
   rb->pool = pool;
   rb->rev = SVN_INVALID_REVNUM;
+  rb->revprops = apr_array_make(rb->pool, 8, sizeof(svn_prop_t));
 
   if ((val = svn_hash_gets(headers, SVN_REPOS_DUMPFILE_REVISION_NUMBER)))
     {
@@ -698,10 +702,12 @@ set_revision_property(void *baton,
 
   if (rb->rev > 0)
     {
-      if (rb->pb->validate_props)
-        SVN_ERR(svn_repos_fs_change_txn_prop(rb->txn, name, value, rb->pool));
-      else
-        SVN_ERR(svn_fs_change_txn_prop(rb->txn, name, value, rb->pool));
+      svn_prop_t *prop = &APR_ARRAY_PUSH(rb->revprops, svn_prop_t);
+
+      /* Collect property changes to apply them in one FS call in
+         close_revision. */
+      prop->name = apr_pstrdup(rb->pool, name);
+      prop->value = svn_string_dup(value, rb->pool);
 
       /* Remember any datestamp that passes through!  (See comment in
          close_revision() below.) */
@@ -920,6 +926,21 @@ close_revision(void *baton)
   if (rb->skipped || (rb->rev <= 0))
     return SVN_NO_ERROR;
 
+  if (!rb->datestamp)
+    {
+      /* Remove 'svn:date' revision property that was set by FS layer when TXN
+         created if source dump doesn't have 'svn:date' property. */
+      svn_prop_t *prop = &APR_ARRAY_PUSH(rb->revprops, svn_prop_t);
+      prop->name = SVN_PROP_REVISION_DATE;
+      prop->value = NULL;
+    }
+
+  /* Apply revision property changes. */
+  if (rb->pb->validate_props)
+    SVN_ERR(svn_repos_fs_change_txn_props(rb->txn, rb->revprops, rb->pool));
+  else
+    SVN_ERR(svn_fs_change_txn_props(rb->txn, rb->revprops, rb->pool));
+
   /* Get the txn name and hooks environment if they will be needed. */
   if (pb->use_pre_commit_hook || pb->use_post_commit_hook)
     {
@@ -947,7 +968,8 @@ close_revision(void *baton)
     }
 
   /* Commit. */
-  err = svn_fs_commit_txn(&conflict_msg, &committed_rev, rb->txn, rb->pool);
+  err = svn_fs_commit_txn2(&conflict_msg, &committed_rev, rb->txn, FALSE,
+                           rb->pool);
   if (SVN_IS_VALID_REVNUM(committed_rev))
     {
       if (err)
@@ -1005,15 +1027,6 @@ close_revision(void *baton)
   /* Deltify the predecessors of paths changed in this revision. */
   SVN_ERR(svn_fs_deltify_revision(pb->fs, committed_rev, rb->pool));
 
-  /* Grrr, svn_fs_commit_txn rewrites the datestamp property to the
-     current clock-time.  We don't want that, we want to preserve
-     history exactly.  Good thing revision props aren't versioned!
-     Note that if rb->datestamp is NULL, that's fine -- if the dump
-     data doesn't carry a datestamp, we want to preserve that fact in
-     the load. */
-  SVN_ERR(change_rev_prop(pb->repos, committed_rev, SVN_PROP_REVISION_DATE,
-                          rb->datestamp, pb->validate_props, rb->pool));
-
   if (pb->notify_func)
     {
       pb->notify->action = svn_repos_notify_load_txn_committed;

Modified: subversion/branches/move-tracking-1/subversion/libsvn_repos/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_repos/log.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_repos/log.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_repos/log.c Mon Aug 19 12:07:51 2013
@@ -25,8 +25,8 @@
 #define APR_WANT_STRFUNC
 #include <apr_want.h>
 
-#include "svn_compat.h"
 #include "svn_private_config.h"
+#include "svn_compat.h"
 #include "svn_hash.h"
 #include "svn_pools.h"
 #include "svn_error.h"

Modified: subversion/branches/move-tracking-1/subversion/libsvn_repos/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_repos/replay.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_repos/replay.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_repos/replay.c Mon Aug 19 12:07:51 2013
@@ -25,6 +25,7 @@
 
 #include <apr_hash.h>
 
+#include "svn_private_config.h"
 #include "svn_types.h"
 #include "svn_delta.h"
 #include "svn_hash.h"
@@ -35,7 +36,7 @@
 #include "svn_props.h"
 #include "svn_pools.h"
 #include "svn_path.h"
-#include "svn_private_config.h"
+
 #include "private/svn_fspath.h"
 #include "private/svn_repos_private.h"
 #include "private/svn_delta_private.h"

Modified: subversion/branches/move-tracking-1/subversion/libsvn_repos/reporter.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_repos/reporter.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_repos/reporter.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_repos/reporter.c Mon Aug 19 12:07:51 2013
@@ -21,6 +21,7 @@
  * ====================================================================
  */
 
+#include "svn_private_config.h"
 #include "svn_dirent_uri.h"
 #include "svn_hash.h"
 #include "svn_path.h"
@@ -32,7 +33,6 @@
 #include "svn_pools.h"
 #include "svn_props.h"
 #include "repos.h"
-#include "svn_private_config.h"
 
 #include "private/svn_dep_compat.h"
 #include "private/svn_fspath.h"

Modified: subversion/branches/move-tracking-1/subversion/libsvn_repos/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_repos/repos.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_repos/repos.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_repos/repos.c Mon Aug 19 12:07:51 2013
@@ -23,6 +23,7 @@
 #include <apr_pools.h>
 #include <apr_file_io.h>
 
+#include "svn_private_config.h"
 #include "svn_pools.h"
 #include "svn_error.h"
 #include "svn_dirent_uri.h"
@@ -38,7 +39,6 @@
 
 #include "private/svn_repos_private.h"
 #include "private/svn_subr_private.h"
-#include "svn_private_config.h" /* for SVN_TEMPLATE_ROOT_DIR */
 
 #include "repos.h"
 

Modified: subversion/branches/move-tracking-1/subversion/libsvn_repos/rev_hunt.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_repos/rev_hunt.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_repos/rev_hunt.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_repos/rev_hunt.c Mon Aug 19 12:07:51 2013
@@ -23,8 +23,9 @@
 
 
 #include <string.h>
-#include "svn_compat.h"
+
 #include "svn_private_config.h"
+#include "svn_compat.h"
 #include "svn_hash.h"
 #include "svn_pools.h"
 #include "svn_error.h"

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/auth.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/auth.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/auth.c Mon Aug 19 12:07:51 2013
@@ -26,13 +26,13 @@
 #include <apr_tables.h>
 #include <apr_strings.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_types.h"
 #include "svn_string.h"
 #include "svn_error.h"
 #include "svn_auth.h"
 #include "svn_config.h"
-#include "svn_private_config.h"
 #include "svn_dso.h"
 #include "svn_version.h"
 #include "private/svn_dep_compat.h"
@@ -481,7 +481,8 @@ svn_auth_get_platform_specific_provider(
               check_list[0].version_query = version_function;
               check_list[1].label = NULL;
               check_list[1].version_query = NULL;
-              SVN_ERR(svn_ver_check_list(svn_subr_version(), check_list));
+              SVN_ERR(svn_ver_check_list2(svn_subr_version(), check_list,
+                                          svn_ver_equal));
             }
           if (apr_dso_sym(&provider_function_symbol,
                           dso,

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-inprocess.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-inprocess.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-inprocess.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-inprocess.c Mon Aug 19 12:07:51 2013
@@ -246,6 +246,37 @@ inprocess_cache_get(void **value_p,
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+inprocess_cache_has_key_internal(svn_boolean_t *found,
+                                 inprocess_cache_t *cache,
+                                 const void *key,
+                                 apr_pool_t *scratch_pool)
+{
+  *found = apr_hash_get(cache->hash, key, cache->klen) != NULL;
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+inprocess_cache_has_key(svn_boolean_t *found,
+                        void *cache_void,
+                        const void *key,
+                        apr_pool_t *scratch_pool)
+{
+  inprocess_cache_t *cache = cache_void;
+
+  if (key)
+    SVN_MUTEX__WITH_LOCK(cache->mutex,
+                         inprocess_cache_has_key_internal(found,
+                                                          cache,
+                                                          key,
+                                                          scratch_pool));
+  else
+    *found = FALSE;
+
+  return SVN_NO_ERROR;
+}
+
 /* Removes PAGE from the LRU list, removes all of its entries from
  * CACHE's hash, clears its pool, and sets its entry pointer to NULL.
  * Finally, puts it in the "partial page" slot in the cache and sets
@@ -604,6 +635,7 @@ inprocess_cache_get_info(void *cache_voi
 
 static svn_cache__vtable_t inprocess_cache_vtable = {
   inprocess_cache_get,
+  inprocess_cache_has_key,
   inprocess_cache_set,
   inprocess_cache_iter,
   inprocess_cache_is_cachable,

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-membuffer.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-membuffer.c Mon Aug 19 12:07:51 2013
@@ -361,6 +361,10 @@ typedef struct entry_t
    */
   apr_uint32_t previous;
 
+  /* Priority of this entry.  This entry will not be replaced by lower-
+   * priority items.
+   */
+  apr_uint32_t priority;
 #ifdef SVN_DEBUG_CACHE_MEMBUFFER
   /* Remember type, content and key hashes.
    */
@@ -1013,13 +1017,15 @@ find_entry(svn_membuffer_t *cache,
       if (group->used == GROUP_SIZE)
         {
           /* every entry gets the same chance of being removed.
-           * Otherwise, we free the first entry, fill it and
-           * remove it again on the next occasion without considering
-           * the other entries in this group.
+           * Otherwise, we free the first entry, fill it and remove it
+           * again on the next occasion without considering the other
+           * entries in this group.  Also, apply priorities strictly.
            */
           entry = &group->entries[rand() % GROUP_SIZE];
           for (i = 1; i < GROUP_SIZE; ++i)
-            if (entry->hit_count > group->entries[i].hit_count)
+            if (   (entry->priority > group->entries[i].priority)
+                || (   entry->priority == group->entries[i].priority
+                    && entry->hit_count > group->entries[i].hit_count))
               entry = &group->entries[i];
 
           /* for the entries that don't have been removed,
@@ -1128,6 +1134,16 @@ ensure_data_insertable_l2(svn_membuffer_
   apr_uint64_t average_hit_value;
   apr_uint64_t threshold;
 
+  /* accumulated size of the entries that have been removed to make
+   * room for the new one.
+   */
+  apr_size_t moved_size = 0;
+
+  /* count the number of entries that got moved.  A single large entry
+   * being moved is not enough to reject an insertion.
+   */
+  apr_size_t moved_count = 0;
+
   /* accumulated "worth" of items dropped so far */
   apr_size_t drop_hits = 0;
 
@@ -1159,10 +1175,16 @@ ensure_data_insertable_l2(svn_membuffer_
       if (end >= to_fit_in->size + cache->l2.current_data)
         return TRUE;
 
+      /* Don't be too eager to cache data.  If a lot of data has been 
+       * moved around, the current item has probably a relatively low
+       * priority.  So, give up after some time.
+       */
+      if (moved_size > 8 * to_fit_in->size && moved_count > 3)
+        return FALSE;
+
       /* if the net worth (in hits) of items removed is already larger
        * than what we want to insert, reject TO_FIT_IN because it still
-       * does not fit in.
-       */
+       * does not fit in. */
       if (drop_hits > to_fit_in->hit_count)
         return FALSE;
 
@@ -1180,8 +1202,15 @@ ensure_data_insertable_l2(svn_membuffer_
         }
       else
         {
+          svn_boolean_t keep;
           entry = get_entry(cache, cache->l2.next);
 
+          /* Reject insertion for entries with low priority, if the current
+           * entry has seen recent hits. */
+          if (   entry->hit_count
+              && to_fit_in->priority < SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY)
+            return FALSE;
+
           /* Keep entries that are very small. Those are likely to be data
            * headers or similar management structures. So, they are probably
            * important while not occupying much space.
@@ -1190,56 +1219,75 @@ ensure_data_insertable_l2(svn_membuffer_
           if (   (apr_uint64_t)entry->size * cache->used_entries
                < cache->data_used / 8)
             {
-              move_entry(cache, entry);
+              keep = TRUE;
             }
           else if (cache->l2.next / GROUP_SIZE == idx / GROUP_SIZE)
             {
               /* Special case: we cannot drop entries that are in the same
-              * group as TO_FIT_IN because that might the latter to become
-              * invalidated it it happens to be the highest used entry in
-              * the group.  So, we must keep ENTRY unconditionally.
-              * (this is a very rare condition)
-              */
-              move_entry(cache, entry);
+               * group as TO_FIT_IN because that might the latter to become
+               * invalidated it it happens to be the highest used entry in
+               * the group.  So, we must keep ENTRY unconditionally.
+               * (this is a very rare condition)
+               */
+              keep = TRUE;
             }
-          else
+          else if (   entry->priority < SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY
+                   && to_fit_in->priority > entry->priority)
+            {
+              /* Be quick to evict low-priority entries if the one to insert
+               * is of higher priority.
+               */
+              keep = FALSE;
+            }
+          else if (to_fit_in->priority != entry->priority)
+            {
+              /* Not the same priority but the lower prio side is not a
+               * clear loser either (already checked those cases above).
+               * Keep the current entry if it has seen more hits recently
+               * or is smaller than the one to insert - both relative to
+               * their respective priority.
+               */
+              keep = to_fit_in->hit_count * to_fit_in->priority
+                   < entry->hit_count * entry->priority
+                  || to_fit_in->size * to_fit_in->priority
+                   < entry->size * entry->priority;
+            }
+          else if (cache->hit_count > cache->used_entries)
             {
-              svn_boolean_t keep;
+              /* Roll the dice and determine a threshold somewhere
+               * from 0 up to 2 times the average hit count.
+               */
+              average_hit_value = cache->hit_count / cache->used_entries;
+              threshold = (average_hit_value+1) * (rand() % 4096) / 2048;
 
-              if (cache->hit_count > cache->used_entries)
-                {
-                  /* Roll the dice and determine a threshold somewhere from
-                   * 0 up to 2 times the average hit count.
-                   */
-                  average_hit_value = cache->hit_count / cache->used_entries;
-                  threshold = (average_hit_value+1) * (rand() % 4096) / 2048;
+              keep = entry->hit_count > threshold;
+            }
+          else
+            {
+              /* general hit count is low. Keep everything that got hit
+               * at all and assign some 50% survival chance to everything
+               * else.
+               */
+              keep = rand() & 1;
+            }
 
-                  keep = entry->hit_count >= threshold;
-                }
-              else
-                {
-                  /* general hit count is low. Keep everything that got
-                   * hit at all and assign some 50% survival chance to
-                   * everything else.
-                   */
-                  keep = (entry->hit_count > 0) || (rand() & 1);
-                }
+          /* keepers or destroyers? */
+          if (keep)
+            {
+              /* Moving entries around is not for free -> track costs. */
+              moved_size += entry->size;
+              moved_count++;
 
-              /* keepers or destroyers? */
-              if (keep)
-                {
-                 /* Keep ENTRY and move the insertion window.
-                  */
-                  move_entry(cache, entry);
-                }
-              else
-                {
-                 /* Drop the entry from the end of the insertion window,
-                  * because it had been hit less than the threshold.
-                  */
-                  drop_hits += entry->hit_count;
-                  drop_entry(cache, entry);
-                }
+              move_entry(cache, entry);
+            }
+          else
+            {
+              /* Drop the entry from the end of the insertion window, if it
+               * has been hit less than the threshold. Otherwise, keep it and
+               * move the insertion window one entry further.
+               */
+              drop_hits += entry->hit_count;
+              drop_entry(cache, entry);
             }
         }
     }
@@ -1582,6 +1630,7 @@ membuffer_cache_set_internal(svn_membuff
                              apr_uint32_t group_index,
                              char *buffer,
                              apr_size_t size,
+                             apr_uint32_t priority,
                              DEBUG_CACHE_MEMBUFFER_TAG_ARG
                              apr_pool_t *scratch_pool)
 {
@@ -1594,6 +1643,7 @@ membuffer_cache_set_internal(svn_membuff
     {
       cache->data_used += size - entry->size;
       entry->size = size;
+      entry->priority = priority;
 
 #ifdef SVN_DEBUG_CACHE_MEMBUFFER
 
@@ -1624,6 +1674,7 @@ membuffer_cache_set_internal(svn_membuff
       entry = find_entry(cache, group_index, to_find, TRUE);
       entry->size = size;
       entry->offset = cache->l1.current_data;
+      entry->priority = priority;
 
 #ifdef SVN_DEBUG_CACHE_MEMBUFFER
 
@@ -1673,6 +1724,7 @@ membuffer_cache_set(svn_membuffer_t *cac
                     entry_key_t key,
                     void *item,
                     svn_cache__serialize_func_t serializer,
+                    apr_uint32_t priority,
                     DEBUG_CACHE_MEMBUFFER_TAG_ARG
                     apr_pool_t *scratch_pool)
 {
@@ -1697,6 +1749,7 @@ membuffer_cache_set(svn_membuffer_t *cac
                                                group_index,
                                                buffer,
                                                size,
+                                               priority,
                                                DEBUG_CACHE_MEMBUFFER_TAG
                                                scratch_pool));
   return SVN_NO_ERROR;
@@ -1808,6 +1861,43 @@ membuffer_cache_get(svn_membuffer_t *cac
 }
 
 /* Look for the cache entry in group GROUP_INDEX of CACHE, identified
+ * by the hash value TO_FIND.  If no item has been stored for KEY, *FOUND
+ * will be FALSE and TRUE otherwise.
+ */
+static svn_error_t *
+membuffer_cache_has_key_internal(svn_membuffer_t *cache,
+                                 apr_uint32_t group_index,
+                                 entry_key_t to_find,
+                                 svn_boolean_t *found)
+{
+  *found = find_entry(cache, group_index, to_find, FALSE) != NULL;
+
+  return SVN_NO_ERROR;
+}
+
+/* Look for an entry identified by KEY.  If no item has been stored
+ * for KEY, *FOUND will be set to FALSE and TRUE otherwise.
+ */
+/* Implements svn_cache__has_key for membuffer caches.
+ */
+static svn_error_t *
+membuffer_cache_has_key(svn_membuffer_t *cache,
+                        entry_key_t key,
+                        svn_boolean_t *found)
+{
+  /* find the entry group that will hold the key.
+   */
+  apr_uint32_t group_index = get_group_index(&cache, key);
+  WITH_READ_LOCK(cache,
+                 membuffer_cache_has_key_internal(cache,
+                                                  group_index,
+                                                  key,
+                                                  found));
+
+  return SVN_NO_ERROR;
+}
+
+/* Look for the cache entry in group GROUP_INDEX of CACHE, identified
  * by the hash value TO_FIND. FOUND indicates whether that entry exists.
  * If not found, *ITEM will be NULL.
  *
@@ -2097,6 +2187,9 @@ typedef struct svn_membuffer_cache_t
    */
   apr_ssize_t key_len;
 
+  /* priority class for all items written through this interface */
+  apr_uint32_t priority;
+  
   /* Temporary buffer containing the hash key for the current access
    */
   entry_key_t combined_key;
@@ -2291,6 +2384,39 @@ svn_membuffer_cache_get(void **value_p,
 
   /* return result */
   *found = *value_p != NULL;
+
+  return SVN_NO_ERROR;
+}
+
+/* Implement svn_cache__vtable_t.has_key (not thread-safe)
+ */
+static svn_error_t *
+svn_membuffer_cache_has_key(svn_boolean_t *found,
+                            void *cache_void,
+                            const void *key,
+                            apr_pool_t *scratch_pool)
+{
+  svn_membuffer_cache_t *cache = cache_void;
+
+  /* special case */
+  if (key == NULL)
+    {
+      *found = FALSE;
+
+      return SVN_NO_ERROR;
+    }
+
+  /* construct the full, i.e. globally unique, key by adding
+   * this cache instances' prefix
+   */
+  combine_key(cache, key, cache->key_len);
+
+  /* Look the item up. */
+  SVN_ERR(membuffer_cache_has_key(cache->membuffer,
+                                  cache->combined_key,
+                                  found));
+
+  /* return result */
   return SVN_NO_ERROR;
 }
 
@@ -2332,6 +2458,7 @@ svn_membuffer_cache_set(void *cache_void
                              cache->combined_key,
                              value,
                              cache->serializer,
+                             cache->priority,
                              DEBUG_CACHE_MEMBUFFER_TAG
                              cache->pool);
 }
@@ -2488,6 +2615,7 @@ svn_membuffer_cache_get_info(void *cache
  */
 static svn_cache__vtable_t membuffer_cache_vtable = {
   svn_membuffer_cache_get,
+  svn_membuffer_cache_has_key,
   svn_membuffer_cache_set,
   svn_membuffer_cache_iter,
   svn_membuffer_cache_is_cachable,
@@ -2516,6 +2644,24 @@ svn_membuffer_cache_get_synced(void **va
   return SVN_NO_ERROR;
 }
 
+/* Implement svn_cache__vtable_t.has_key and serialize all cache access.
+ */
+static svn_error_t *
+svn_membuffer_cache_has_key_synced(svn_boolean_t *found,
+                                   void *cache_void,
+                                   const void *key,
+                                   apr_pool_t *result_pool)
+{
+  svn_membuffer_cache_t *cache = cache_void;
+  SVN_MUTEX__WITH_LOCK(cache->mutex,
+                       svn_membuffer_cache_has_key(found,
+                                                   cache_void,
+                                                   key,
+                                                   result_pool));
+
+  return SVN_NO_ERROR;
+}
+
 /* Implement svn_cache__vtable_t.set and serialize all cache access.
  */
 static svn_error_t *
@@ -2582,6 +2728,7 @@ svn_membuffer_cache_set_partial_synced(v
  */
 static svn_cache__vtable_t membuffer_cache_synced_vtable = {
   svn_membuffer_cache_get_synced,
+  svn_membuffer_cache_has_key_synced,
   svn_membuffer_cache_set_synced,
   svn_membuffer_cache_iter,               /* no sync required */
   svn_membuffer_cache_is_cachable,        /* no sync required */
@@ -2636,6 +2783,7 @@ svn_cache__create_membuffer_cache(svn_ca
                                   svn_cache__deserialize_func_t deserializer,
                                   apr_ssize_t klen,
                                   const char *prefix,
+                                  apr_uint32_t priority,
                                   svn_boolean_t thread_safe,
                                   apr_pool_t *pool)
 {
@@ -2656,6 +2804,7 @@ svn_cache__create_membuffer_cache(svn_ca
                       ? deserializer
                       : deserialize_svn_stringbuf;
   cache->full_prefix = apr_pstrdup(pool, prefix);
+  cache->priority = priority;
   cache->key_len = klen;
   cache->pool = svn_pool_create(pool);
   cache->alloc_counter = 0;

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-memcache.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-memcache.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-memcache.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-memcache.c Mon Aug 19 12:07:51 2013
@@ -213,6 +213,26 @@ memcache_get(void **value_p,
   return SVN_NO_ERROR;
 }
 
+/* Implement vtable.has_key in terms of the getter.
+ */
+static svn_error_t *
+memcache_has_key(svn_boolean_t *found,
+                 void *cache_void,
+                 const void *key,
+                 apr_pool_t *scratch_pool)
+{
+  char *data;
+  apr_size_t data_len;
+  SVN_ERR(memcache_internal_get(&data,
+                                &data_len,
+                                found,
+                                cache_void,
+                                key,
+                                scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
 /* Core functionality of our setter functions: store LENGH bytes of DATA
  * to be identified by KEY in the memcached given by CACHE_VOID. Use POOL
  * for temporary allocations.
@@ -371,6 +391,7 @@ memcache_get_info(void *cache_void,
 
 static svn_cache__vtable_t memcache_vtable = {
   memcache_get,
+  memcache_has_key,
   memcache_set,
   memcache_iter,
   memcache_is_cachable,

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/cache.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/cache.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/cache.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/cache.c Mon Aug 19 12:07:51 2013
@@ -96,6 +96,21 @@ svn_cache__get(void **value_p,
 }
 
 svn_error_t *
+svn_cache__has_key(svn_boolean_t *found,
+                   svn_cache__t *cache,
+                   const void *key,
+                   apr_pool_t *scratch_pool)
+{
+  *found = FALSE;
+  return handle_error(cache,
+                      (cache->vtable->has_key)(found,
+                                               cache->cache_internal,
+                                               key,
+                                               scratch_pool),
+                      scratch_pool);
+}
+
+svn_error_t *
 svn_cache__set(svn_cache__t *cache,
                const void *key,
                void *value,

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/cache.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/cache.h?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/cache.h (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/cache.h Mon Aug 19 12:07:51 2013
@@ -38,6 +38,12 @@ typedef struct svn_cache__vtable_t {
                       const void *key,
                       apr_pool_t *result_pool);
 
+  /* See svn_cache__has_key(). */
+  svn_error_t *(*has_key)(svn_boolean_t *found,
+                          void *cache_implementation,
+                          const void *key,
+                          apr_pool_t *scratch_pool);
+
   /* See svn_cache__set(). */
   svn_error_t *(*set)(void *cache_implementation,
                       const void *key,

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/cmdline.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/cmdline.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/cmdline.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/cmdline.c Mon Aug 19 12:07:51 2013
@@ -42,6 +42,7 @@
 #include <apr_strings.h>        /* for apr_snprintf */
 #include <apr_pools.h>
 
+#include "svn_private_config.h"
 #include "svn_cmdline.h"
 #include "svn_ctype.h"
 #include "svn_dso.h"
@@ -64,8 +65,6 @@
 #include "private/svn_utf_private.h"
 #include "private/svn_string_private.h"
 
-#include "svn_private_config.h"
-
 #include "win32_crashrpt.h"
 
 /* The stdin encoding. If null, it's the same as the native encoding. */
@@ -131,30 +130,32 @@ svn_cmdline_init(const char *progname, F
 #endif /* _MSC_VER < 1400 */
 
 #ifdef SVN_USE_WIN32_CRASHHANDLER
-  /* Attach (but don't load) the crash handler */
-  SetUnhandledExceptionFilter(svn__unhandled_exception_filter);
+  if (!getenv("SVN_CMDLINE_DISABLE_CRASH_HANDLER"))
+    {
+      /* Attach (but don't load) the crash handler */
+      SetUnhandledExceptionFilter(svn__unhandled_exception_filter);
 
 #if _MSC_VER >= 1400
-  /* ### This should work for VC++ 2002 (=1300) and later */
-  /* Show the abort message on STDERR instead of a dialog to allow
-     scripts (e.g. our testsuite) to continue after an abort without
-     user intervention. Allow overriding for easier debugging. */
-  if (!getenv("SVN_CMDLINE_USE_DIALOG_FOR_ABORT"))
-    {
-      /* In release mode: Redirect abort() errors to stderr */
-      _set_error_mode(_OUT_TO_STDERR);
-
-      /* In _DEBUG mode: Redirect all debug output (E.g. assert() to stderr.
-         (Ignored in release builds) */
-      _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR);
-      _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDERR);
-      _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDERR);
-      _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
-      _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
-      _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
-    }
-#endif /* _MSC_VER >= 1400 */
+      /* ### This should work for VC++ 2002 (=1300) and later */
+      /* Show the abort message on STDERR instead of a dialog to allow
+         scripts (e.g. our testsuite) to continue after an abort without
+         user intervention. Allow overriding for easier debugging. */
+      if (!getenv("SVN_CMDLINE_USE_DIALOG_FOR_ABORT"))
+        {
+          /* In release mode: Redirect abort() errors to stderr */
+          _set_error_mode(_OUT_TO_STDERR);
 
+          /* In _DEBUG mode: Redirect all debug output (E.g. assert() to stderr.
+             (Ignored in release builds) */
+          _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR);
+          _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDERR);
+          _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDERR);
+          _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
+          _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
+          _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
+        }
+#endif /* _MSC_VER >= 1400 */
+    }
 #endif /* SVN_USE_WIN32_CRASHHANDLER */
 
 #endif /* WIN32 */

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/compat.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/compat.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/compat.c Mon Aug 19 12:07:51 2013
@@ -24,6 +24,7 @@
 #include <apr_pools.h>
 #include <apr_strings.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_types.h"
 #include "svn_error.h"

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/config.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/config.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/config.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/config.c Mon Aug 19 12:07:51 2013
@@ -29,12 +29,13 @@
 
 #include <apr_general.h>
 #include <apr_lib.h>
+
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_error.h"
 #include "svn_pools.h"
 #include "config_impl.h"
 
-#include "svn_private_config.h"
 #include "private/svn_dep_compat.h"
 
 

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/config_auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/config_auth.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/config_auth.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/config_auth.c Mon Aug 19 12:07:51 2013
@@ -23,6 +23,7 @@
 
 
 
+#include "svn_private_config.h"
 #include "svn_dirent_uri.h"
 #include "svn_hash.h"
 #include "svn_io.h"
@@ -31,14 +32,8 @@
 
 #include "auth.h"
 
-#include "svn_private_config.h"
-
 #include "private/svn_auth_private.h"
 
-/* Helper for svn_config_{read|write}_auth_data.  Return a path to a
-   file within ~/.subversion/auth/ that holds CRED_KIND credentials
-   within REALMSTRING.  If no path is available *PATH will be set to
-   NULL. */
 svn_error_t *
 svn_auth__file_path(const char **path,
                     const char *cred_kind,
@@ -173,12 +168,6 @@ svn_config_walk_auth_data(const char *co
       NULL
     };
 
-  if (! config_dir)
-    {
-      /* Can't locate the cache to clear */
-      return SVN_NO_ERROR;
-    }
-
   iterpool = svn_pool_create(scratch_pool);
   for (i = 0; cred_kinds[i]; i++)
     {

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/config_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/config_file.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/config_file.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/config_file.c Mon Aug 19 12:07:51 2013
@@ -838,9 +838,8 @@ svn_config_ensure(const char *config_dir
         "###   http-max-connections       Maximum number of parallel server" NL
         "###                              connections to use for any given"  NL
         "###                              HTTP operation."                   NL
-        "###   busted-proxy               The proxy may have some protocol"  NL
-        "###                              issues that Subversion needs to"   NL
-        "###                              detect and work around."           NL
+        "###   http-chunked-requests      Whether to use chunked transfer"   NL
+        "###                              encoding for HTTP requests body."  NL
         "###   neon-debug-mask            Debug mask for Neon HTTP library"  NL
         "###   ssl-authority-files        List of files, each of a trusted CA"
                                                                              NL

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/deprecated.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/deprecated.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/deprecated.c Mon Aug 19 12:07:51 2013
@@ -32,6 +32,7 @@
    deprecated functions in this file. */
 #define SVN_DEPRECATED
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_subst.h"
 #include "svn_path.h"
@@ -48,9 +49,6 @@
 #include "private/svn_opt_private.h"
 #include "private/svn_mergeinfo_private.h"
 
-#include "svn_private_config.h"
-
-
 
 
 /*** Code. ***/
@@ -1301,4 +1299,10 @@ svn_subst_build_keywords(svn_subst_keywo
   return SVN_NO_ERROR;
 }
 
-
+/*** From version.c ***/
+svn_error_t *
+svn_ver_check_list(const svn_version_t *my_version,
+                   const svn_version_checklist_t *checklist)
+{
+  return svn_ver_check_list2(my_version, checklist, svn_ver_compatible);
+}

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/dso.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/dso.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/dso.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/dso.c Mon Aug 19 12:07:51 2013
@@ -22,10 +22,10 @@
 #include <apr_thread_mutex.h>
 #include <apr_hash.h>
 
+#include "svn_private_config.h"
 #include "svn_hash.h"
 #include "svn_dso.h"
 #include "svn_pools.h"
-#include "svn_private_config.h"
 
 #include "private/svn_mutex.h"
 

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/error.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/error.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/error.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/error.c Mon Aug 19 12:07:51 2013
@@ -110,7 +110,8 @@ make_error_internal(apr_status_t apr_err
     pool = child->pool;
   else
     {
-      if (apr_pool_create(&pool, NULL))
+      pool = svn_pool_create(NULL);
+      if (!pool)
         abort();
     }
 
@@ -339,7 +340,8 @@ svn_error_dup(svn_error_t *err)
   apr_pool_t *pool;
   svn_error_t *new_err = NULL, *tmp_err = NULL;
 
-  if (apr_pool_create(&pool, NULL))
+  pool = svn_pool_create(NULL);
+  if (!pool)
     abort();
 
   for (; err; err = err->child)
@@ -559,7 +561,7 @@ svn_handle_error2(svn_error_t *err,
      preferring apr_pool_*() instead.  I can't remember why -- it may
      be an artifact of r843793, or it may be for some deeper reason --
      but I'm playing it safe and using apr_pool_*() here too. */
-  apr_pool_create(&subpool, err->pool);
+  subpool = svn_pool_create(err->pool);
   empties = apr_array_make(subpool, 0, sizeof(apr_status_t));
 
   tmp_err = err;

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/gpg_agent.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/gpg_agent.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/gpg_agent.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/gpg_agent.c Mon Aug 19 12:07:51 2013
@@ -156,42 +156,28 @@ send_option(int sd, char *buf, size_t n,
   return (strncmp(buf, "OK", 2) == 0);
 }
 
-/* Implementation of svn_auth__password_get_t that retrieves the password
-   from gpg-agent */
+
+/* Locate a running GPG Agent, and return an open file descriptor
+ * for communication with the agent in *NEW_SD. If no running agent
+ * can be found, set *NEW_SD to -1. */
 static svn_error_t *
-password_get_gpg_agent(svn_boolean_t *done,
-                       const char **password,
-                       apr_hash_t *creds,
-                       const char *realmstring,
-                       const char *username,
-                       apr_hash_t *parameters,
-                       svn_boolean_t non_interactive,
-                       apr_pool_t *pool)
+find_running_gpg_agent(int *new_sd, apr_pool_t *pool)
 {
-  int sd;
+  char *buffer;
   char *gpg_agent_info = NULL;
+  const char *socket_name = NULL;
+  const char *request = NULL;
   const char *p = NULL;
   char *ep = NULL;
-  char *buffer;
-
-  apr_array_header_t *socket_details;
-  const char *request = NULL;
-  const char *cache_id = NULL;
-  struct sockaddr_un addr;
-  const char *tty_name;
-  const char *tty_type;
-  const char *lc_ctype;
-  const char *display;
-  const char *socket_name = NULL;
-  svn_checksum_t *digest = NULL;
-  char *password_prompt;
-  char *realm_prompt;
+  int sd;
 
-  *done = FALSE;
+  *new_sd = -1;
 
   gpg_agent_info = getenv("GPG_AGENT_INFO");
   if (gpg_agent_info != NULL)
     {
+      apr_array_header_t *socket_details;
+
       socket_details = svn_cstring_split(gpg_agent_info, ":", TRUE,
                                          pool);
       socket_name = APR_ARRAY_IDX(socket_details, 0, const char *);
@@ -201,6 +187,8 @@ password_get_gpg_agent(svn_boolean_t *do
 
   if (socket_name != NULL)
     {
+      struct sockaddr_un addr;
+
       addr.sun_family = AF_UNIX;
       strncpy(addr.sun_path, socket_name, sizeof(addr.sun_path) - 1);
       addr.sun_path[sizeof(addr.sun_path) - 1] = '\0';
@@ -273,6 +261,44 @@ password_get_gpg_agent(svn_boolean_t *do
       return SVN_NO_ERROR;
     }
 
+  *new_sd = sd;
+  return SVN_NO_ERROR;
+}
+
+/* Implementation of svn_auth__password_get_t that retrieves the password
+   from gpg-agent */
+static svn_error_t *
+password_get_gpg_agent(svn_boolean_t *done,
+                       const char **password,
+                       apr_hash_t *creds,
+                       const char *realmstring,
+                       const char *username,
+                       apr_hash_t *parameters,
+                       svn_boolean_t non_interactive,
+                       apr_pool_t *pool)
+{
+  int sd;
+  const char *p = NULL;
+  char *ep = NULL;
+  char *buffer;
+  const char *request = NULL;
+  const char *cache_id = NULL;
+  const char *tty_name;
+  const char *tty_type;
+  const char *lc_ctype;
+  const char *display;
+  svn_checksum_t *digest = NULL;
+  char *password_prompt;
+  char *realm_prompt;
+
+  *done = FALSE;
+
+  SVN_ERR(find_running_gpg_agent(&sd, pool));
+  if (sd == -1)
+    return SVN_NO_ERROR;
+
+  buffer = apr_palloc(pool, BUFFER_SIZE);
+
   /* Send TTY_NAME to the gpg-agent daemon. */
   tty_name = getenv("GPG_TTY");
   if (tty_name != NULL)
@@ -283,11 +309,6 @@ password_get_gpg_agent(svn_boolean_t *do
           return SVN_NO_ERROR;
         }
     }
-  else
-    {
-      close(sd);
-      return SVN_NO_ERROR;
-    }
 
   /* Send TTY_TYPE to the gpg-agent daemon. */
   tty_type = getenv("TERM");
@@ -299,11 +320,6 @@ password_get_gpg_agent(svn_boolean_t *do
           return SVN_NO_ERROR;
         }
     }
-  else
-    {
-      close(sd);
-      return SVN_NO_ERROR;
-    }
 
   /* Compute LC_CTYPE. */
   lc_ctype = getenv("LC_ALL");
@@ -388,8 +404,8 @@ password_get_gpg_agent(svn_boolean_t *do
    password in GPG Agent if that's how this particular integration
    worked.  But it isn't.  GPG Agent stores the password provided by
    the user via the pinentry program immediately upon its provision
-   (and regardless of its accuracy as passwords go), so there's
-   nothing really to do here.  */
+   (and regardless of its accuracy as passwords go), so we just need
+   to check if a running GPG Agent exists. */
 static svn_error_t *
 password_set_gpg_agent(svn_boolean_t *done,
                        apr_hash_t *creds,
@@ -400,6 +416,15 @@ password_set_gpg_agent(svn_boolean_t *do
                        svn_boolean_t non_interactive,
                        apr_pool_t *pool)
 {
+  int sd;
+
+  *done = FALSE;
+
+  SVN_ERR(find_running_gpg_agent(&sd, pool));
+  if (sd == -1)
+    return SVN_NO_ERROR;
+
+  close(sd);
   *done = TRUE;
 
   return SVN_NO_ERROR;

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/hash.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/hash.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/hash.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/hash.c Mon Aug 19 12:07:51 2013
@@ -31,6 +31,7 @@
 #include <apr_hash.h>
 #include <apr_file_io.h>
 
+#include "svn_private_config.h"
 #include "svn_types.h"
 #include "svn_string.h"
 #include "svn_error.h"
@@ -42,8 +43,6 @@
 #include "private/svn_dep_compat.h"
 #include "private/svn_subr_private.h"
 
-#include "svn_private_config.h"
-
 
 
 



Mime
View raw message