You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2015/09/18 03:38:50 UTC

svn commit: r1703735 [4/8] - in /subversion/branches/patch-exec: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ contrib/hook-scripts/ notes/ subversion/ subversion/bindings/swig/include/ subversion/include/ subversion/include/pr...

Modified: subversion/branches/patch-exec/subversion/libsvn_ra_svn/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_ra_svn/deprecated.c?rev=1703735&r1=1703734&r2=1703735&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_ra_svn/deprecated.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_ra_svn/deprecated.c Fri Sep 18 01:38:47 2015
@@ -110,7 +110,12 @@ svn_ra_svn_read_item(svn_ra_svn_conn_t *
                      apr_pool_t *pool,
                      svn_ra_svn_item_t **item)
 {
-  return svn_error_trace(svn_ra_svn__read_item(conn, pool, item));
+  svn_ra_svn__item_t *temp;
+  SVN_ERR(svn_ra_svn__read_item(conn, pool, &temp));
+  *item  = apr_pcalloc(pool, sizeof(**item));
+  svn_ra_svn__to_public_item(*item, temp, pool);
+
+  return SVN_NO_ERROR;
 }
 
 svn_error_t *
@@ -127,9 +132,10 @@ svn_ra_svn_parse_tuple(const apr_array_h
 {
   va_list va;
   svn_error_t *err;
+  svn_ra_svn__list_t *internal = svn_ra_svn__to_private_array(list, pool);
 
   va_start(va, fmt);
-  err = svn_ra_svn__parse_tuple(list, pool, fmt, va);
+  err = svn_ra_svn__parse_tuple(internal, pool, fmt, va);
   va_end(va);
 
   return svn_error_trace(err);
@@ -155,7 +161,9 @@ svn_ra_svn_parse_proplist(const apr_arra
                           apr_pool_t *pool,
                           apr_hash_t **props)
 {
-  return svn_error_trace(svn_ra_svn__parse_proplist(list, pool, props));
+  svn_ra_svn__list_t *internal
+    = svn_ra_svn__to_private_array(list, pool);
+  return svn_error_trace(svn_ra_svn__parse_proplist(internal, pool, props));
 }
 
 svn_error_t *
@@ -180,8 +188,23 @@ svn_ra_svn_handle_commands2(svn_ra_svn_c
                             void *baton,
                             svn_boolean_t error_on_disconnect)
 {
+  apr_size_t i, count = 0;
+  svn_ra_svn__cmd_entry_t *internal;
+
+  while (commands[count].cmdname)
+    count++;
+
+  internal = apr_pcalloc(pool, count * sizeof(*internal));
+  for (i = 0; i < count; ++i)
+    {
+      internal[i].cmdname = commands[i].cmdname;
+      internal[i].handler = NULL;
+      internal[i].deprecated_handler = commands[i].handler;
+      internal[i].terminate = commands[i].terminate;
+    }
+
   return svn_error_trace(svn_ra_svn__handle_commands2(conn, pool,
-                                                      commands, baton,
+                                                      internal, baton,
                                                       error_on_disconnect));
 }
 
@@ -191,9 +214,9 @@ svn_ra_svn_handle_commands(svn_ra_svn_co
                            const svn_ra_svn_cmd_entry_t *commands,
                            void *baton)
 {
-  return svn_error_trace(svn_ra_svn__handle_commands2(conn, pool,
-                                                      commands, baton,
-                                                      FALSE));
+  return svn_error_trace(svn_ra_svn_handle_commands2(conn, pool,
+                                                     commands, baton,
+                                                     FALSE));
 }
 
 svn_error_t *

Modified: subversion/branches/patch-exec/subversion/libsvn_ra_svn/editorp.c
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_ra_svn/editorp.c?rev=1703735&r1=1703734&r2=1703735&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_ra_svn/editorp.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_ra_svn/editorp.c Fri Sep 18 01:38:47 2015
@@ -534,10 +534,11 @@ static void remove_token(ra_svn_driver_s
   ds->last_token = NULL;
 }
 
-static svn_error_t *ra_svn_handle_target_rev(svn_ra_svn_conn_t *conn,
-                                             apr_pool_t *pool,
-                                             const apr_array_header_t *params,
-                                             ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_target_rev(svn_ra_svn_conn_t *conn,
+                         apr_pool_t *pool,
+                         const svn_ra_svn__list_t *params,
+                         ra_svn_driver_state_t *ds)
 {
   svn_revnum_t rev;
 
@@ -546,10 +547,11 @@ static svn_error_t *ra_svn_handle_target
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *ra_svn_handle_open_root(svn_ra_svn_conn_t *conn,
-                                            apr_pool_t *pool,
-                                            const apr_array_header_t *params,
-                                            ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_open_root(svn_ra_svn_conn_t *conn,
+                        apr_pool_t *pool,
+                        const svn_ra_svn__list_t *params,
+                        ra_svn_driver_state_t *ds)
 {
   svn_revnum_t rev;
   apr_pool_t *subpool;
@@ -564,10 +566,11 @@ static svn_error_t *ra_svn_handle_open_r
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *ra_svn_handle_delete_entry(svn_ra_svn_conn_t *conn,
-                                               apr_pool_t *pool,
-                                               const apr_array_header_t *params,
-                                               ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_delete_entry(svn_ra_svn_conn_t *conn,
+                           apr_pool_t *pool,
+                           const svn_ra_svn__list_t *params,
+                           ra_svn_driver_state_t *ds)
 {
   const char *path;
   svn_string_t *token;
@@ -582,10 +585,11 @@ static svn_error_t *ra_svn_handle_delete
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *ra_svn_handle_add_dir(svn_ra_svn_conn_t *conn,
-                                          apr_pool_t *pool,
-                                          const apr_array_header_t *params,
-                                          ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_add_dir(svn_ra_svn_conn_t *conn,
+                      apr_pool_t *pool,
+                      const svn_ra_svn__list_t *params,
+                      ra_svn_driver_state_t *ds)
 {
   const char *path, *copy_path;
   svn_string_t *token, *child_token;
@@ -616,10 +620,11 @@ static svn_error_t *ra_svn_handle_add_di
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *ra_svn_handle_open_dir(svn_ra_svn_conn_t *conn,
-                                           apr_pool_t *pool,
-                                           const apr_array_header_t *params,
-                                           ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_open_dir(svn_ra_svn_conn_t *conn,
+                       apr_pool_t *pool,
+                       const svn_ra_svn__list_t *params,
+                       ra_svn_driver_state_t *ds)
 {
   const char *path;
   svn_string_t *token, *child_token;
@@ -639,10 +644,11 @@ static svn_error_t *ra_svn_handle_open_d
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *ra_svn_handle_change_dir_prop(svn_ra_svn_conn_t *conn,
-                                                  apr_pool_t *pool,
-                                                  const apr_array_header_t *params,
-                                                  ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_change_dir_prop(svn_ra_svn_conn_t *conn,
+                              apr_pool_t *pool,
+                              const svn_ra_svn__list_t *params,
+                              ra_svn_driver_state_t *ds)
 {
   svn_string_t *token;
   const char *name;
@@ -657,10 +663,11 @@ static svn_error_t *ra_svn_handle_change
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *ra_svn_handle_close_dir(svn_ra_svn_conn_t *conn,
-                                            apr_pool_t *pool,
-                                            const apr_array_header_t *params,
-                                            ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_close_dir(svn_ra_svn_conn_t *conn,
+                        apr_pool_t *pool,
+                        const svn_ra_svn__list_t *params,
+                        ra_svn_driver_state_t *ds)
 {
   svn_string_t *token;
   ra_svn_token_entry_t *entry;
@@ -676,10 +683,11 @@ static svn_error_t *ra_svn_handle_close_
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *ra_svn_handle_absent_dir(svn_ra_svn_conn_t *conn,
-                                             apr_pool_t *pool,
-                                             const apr_array_header_t *params,
-                                             ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_absent_dir(svn_ra_svn_conn_t *conn,
+                         apr_pool_t *pool,
+                         const svn_ra_svn__list_t *params,
+                         ra_svn_driver_state_t *ds)
 {
   const char *path;
   svn_string_t *token;
@@ -694,10 +702,11 @@ static svn_error_t *ra_svn_handle_absent
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *ra_svn_handle_add_file(svn_ra_svn_conn_t *conn,
-                                           apr_pool_t *pool,
-                                           const apr_array_header_t *params,
-                                           ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_add_file(svn_ra_svn_conn_t *conn,
+                       apr_pool_t *pool,
+                       const svn_ra_svn__list_t *params,
+                       ra_svn_driver_state_t *ds)
 {
   const char *path, *copy_path;
   svn_string_t *token, *file_token;
@@ -729,10 +738,11 @@ static svn_error_t *ra_svn_handle_add_fi
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *ra_svn_handle_open_file(svn_ra_svn_conn_t *conn,
-                                            apr_pool_t *pool,
-                                            const apr_array_header_t *params,
-                                            ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_open_file(svn_ra_svn_conn_t *conn,
+                        apr_pool_t *pool,
+                        const svn_ra_svn__list_t *params,
+                        ra_svn_driver_state_t *ds)
 {
   const char *path;
   svn_string_t *token, *file_token;
@@ -754,10 +764,11 @@ static svn_error_t *ra_svn_handle_open_f
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *ra_svn_handle_apply_textdelta(svn_ra_svn_conn_t *conn,
-                                                  apr_pool_t *pool,
-                                                  const apr_array_header_t *params,
-                                                  ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_apply_textdelta(svn_ra_svn_conn_t *conn,
+                              apr_pool_t *pool,
+                              const svn_ra_svn__list_t *params,
+                              ra_svn_driver_state_t *ds)
 {
   svn_string_t *token;
   ra_svn_token_entry_t *entry;
@@ -779,10 +790,11 @@ static svn_error_t *ra_svn_handle_apply_
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *ra_svn_handle_textdelta_chunk(svn_ra_svn_conn_t *conn,
-                                                  apr_pool_t *pool,
-                                                  const apr_array_header_t *params,
-                                                  ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_textdelta_chunk(svn_ra_svn_conn_t *conn,
+                              apr_pool_t *pool,
+                              const svn_ra_svn__list_t *params,
+                              ra_svn_driver_state_t *ds)
 {
   svn_string_t *token;
   ra_svn_token_entry_t *entry;
@@ -798,10 +810,11 @@ static svn_error_t *ra_svn_handle_textde
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *ra_svn_handle_textdelta_end(svn_ra_svn_conn_t *conn,
-                                                apr_pool_t *pool,
-                                                const apr_array_header_t *params,
-                                                ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_textdelta_end(svn_ra_svn_conn_t *conn,
+                            apr_pool_t *pool,
+                            const svn_ra_svn__list_t *params,
+                            ra_svn_driver_state_t *ds)
 {
   svn_string_t *token;
   ra_svn_token_entry_t *entry;
@@ -818,10 +831,11 @@ static svn_error_t *ra_svn_handle_textde
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *ra_svn_handle_change_file_prop(svn_ra_svn_conn_t *conn,
-                                                   apr_pool_t *pool,
-                                                   const apr_array_header_t *params,
-                                                   ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_change_file_prop(svn_ra_svn_conn_t *conn,
+                               apr_pool_t *pool,
+                               const svn_ra_svn__list_t *params,
+                               ra_svn_driver_state_t *ds)
 {
   const char *name;
   svn_string_t *token, *value;
@@ -834,10 +848,11 @@ static svn_error_t *ra_svn_handle_change
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *ra_svn_handle_close_file(svn_ra_svn_conn_t *conn,
-                                             apr_pool_t *pool,
-                                             const apr_array_header_t *params,
-                                             ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_close_file(svn_ra_svn_conn_t *conn,
+                         apr_pool_t *pool,
+                         const svn_ra_svn__list_t *params,
+                         ra_svn_driver_state_t *ds)
 {
   svn_string_t *token;
   ra_svn_token_entry_t *entry;
@@ -856,10 +871,11 @@ static svn_error_t *ra_svn_handle_close_
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *ra_svn_handle_absent_file(svn_ra_svn_conn_t *conn,
-                                              apr_pool_t *pool,
-                                              const apr_array_header_t *params,
-                                              ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_absent_file(svn_ra_svn_conn_t *conn,
+                          apr_pool_t *pool,
+                          const svn_ra_svn__list_t *params,
+                          ra_svn_driver_state_t *ds)
 {
   const char *path;
   svn_string_t *token;
@@ -874,10 +890,11 @@ static svn_error_t *ra_svn_handle_absent
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *ra_svn_handle_close_edit(svn_ra_svn_conn_t *conn,
-                                             apr_pool_t *pool,
-                                             const apr_array_header_t *params,
-                                             ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_close_edit(svn_ra_svn_conn_t *conn,
+                         apr_pool_t *pool,
+                         const svn_ra_svn__list_t *params,
+                         ra_svn_driver_state_t *ds)
 {
   SVN_CMD_ERR(ds->editor->close_edit(ds->edit_baton, pool));
   ds->done = TRUE;
@@ -894,10 +911,11 @@ static svn_error_t *ra_svn_handle_close_
   return svn_ra_svn__write_cmd_response(conn, pool, "");
 }
 
-static svn_error_t *ra_svn_handle_abort_edit(svn_ra_svn_conn_t *conn,
-                                             apr_pool_t *pool,
-                                             const apr_array_header_t *params,
-                                             ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_abort_edit(svn_ra_svn_conn_t *conn,
+                         apr_pool_t *pool,
+                         const svn_ra_svn__list_t *params,
+                         ra_svn_driver_state_t *ds)
 {
   ds->done = TRUE;
   if (ds->aborted)
@@ -906,10 +924,11 @@ static svn_error_t *ra_svn_handle_abort_
   return svn_ra_svn__write_cmd_response(conn, pool, "");
 }
 
-static svn_error_t *ra_svn_handle_finish_replay(svn_ra_svn_conn_t *conn,
-                                                apr_pool_t *pool,
-                                                const apr_array_header_t *params,
-                                                ra_svn_driver_state_t *ds)
+static svn_error_t *
+ra_svn_handle_finish_replay(svn_ra_svn_conn_t *conn,
+                            apr_pool_t *pool,
+                            const svn_ra_svn__list_t *params,
+                            ra_svn_driver_state_t *ds)
 {
   if (!ds->for_replay)
     return svn_error_createf
@@ -924,7 +943,7 @@ static svn_error_t *ra_svn_handle_finish
 /* Common function signature for all editor command handlers. */
 typedef svn_error_t *(*cmd_handler_t)(svn_ra_svn_conn_t *conn,
                                       apr_pool_t *pool,
-                                      const apr_array_header_t *params,
+                                      const svn_ra_svn__list_t *params,
                                       ra_svn_driver_state_t *ds);
 
 static const struct {
@@ -1044,7 +1063,7 @@ static svn_error_t *blocked_write(svn_ra
 {
   ra_svn_driver_state_t *ds = baton;
   const char *cmd;
-  apr_array_header_t *params;
+  svn_ra_svn__list_t *params;
 
   /* We blocked trying to send an error.  Read and discard an editing
    * command in order to avoid deadlock. */
@@ -1068,7 +1087,7 @@ svn_error_t *svn_ra_svn_drive_editor2(sv
   apr_pool_t *subpool = svn_pool_create(pool);
   const char *cmd;
   svn_error_t *err, *write_err;
-  apr_array_header_t *params;
+  svn_ra_svn__list_t *params;
 
   SVN_ERR(svn_atomic__init_once(&cmd_hash_initialized, init_cmd_hash, NULL,
                                 pool));

Modified: subversion/branches/patch-exec/subversion/libsvn_ra_svn/internal_auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_ra_svn/internal_auth.c?rev=1703735&r1=1703734&r2=1703735&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_ra_svn/internal_auth.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_ra_svn/internal_auth.c Fri Sep 18 01:38:47 2015
@@ -37,15 +37,15 @@
 
 #include "ra_svn.h"
 
-svn_boolean_t svn_ra_svn__find_mech(const apr_array_header_t *mechlist,
+svn_boolean_t svn_ra_svn__find_mech(const svn_ra_svn__list_t *mechlist,
                                     const char *mech)
 {
   int i;
-  svn_ra_svn_item_t *elt;
+  svn_ra_svn__item_t *elt;
 
   for (i = 0; i < mechlist->nelts; i++)
     {
-      elt = &APR_ARRAY_IDX(mechlist, i, svn_ra_svn_item_t);
+      elt = &SVN_RA_SVN__LIST_ITEM(mechlist, i);
       if (elt->kind == SVN_RA_SVN_WORD && strcmp(elt->u.word, mech) == 0)
         return TRUE;
     }
@@ -69,7 +69,7 @@ static svn_error_t *read_success(svn_ra_
 
 svn_error_t *
 svn_ra_svn__do_internal_auth(svn_ra_svn__session_baton_t *sess,
-                             const apr_array_header_t *mechlist,
+                             const svn_ra_svn__list_t *mechlist,
                              const char *realm, apr_pool_t *pool)
 {
   svn_ra_svn_conn_t *conn = sess->conn;

Modified: subversion/branches/patch-exec/subversion/libsvn_ra_svn/marshal.c
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_ra_svn/marshal.c?rev=1703735&r1=1703734&r2=1703735&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_ra_svn/marshal.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_ra_svn/marshal.c Fri Sep 18 01:38:47 2015
@@ -80,6 +80,98 @@ get_timeout(svn_ra_svn_conn_t *conn)
   return conn->block_handler ? 0 : -1;
 }
 
+/* --- Public / private API data conversion --- */
+
+void
+svn_ra_svn__to_public_item(svn_ra_svn_item_t *target,
+                           const svn_ra_svn__item_t *source,
+                           apr_pool_t *result_pool)
+{
+  target->kind = source->kind;
+  switch (source->kind)
+    {
+      case SVN_RA_SVN_STRING:
+        target->u.string = svn_string_dup(&source->u.string, result_pool);
+        break;
+      case SVN_RA_SVN_NUMBER:
+        target->u.number = source->u.number;
+        break;
+      case SVN_RA_SVN_WORD:
+        target->u.word = source->u.word;
+        break;
+      case SVN_RA_SVN_LIST:
+        target->u.list = svn_ra_svn__to_public_array(&source->u.list,
+                                                     result_pool);
+        break;
+    }
+}
+
+apr_array_header_t *
+svn_ra_svn__to_public_array(const svn_ra_svn__list_t *source,
+                            apr_pool_t *result_pool)
+{
+  apr_array_header_t *result = apr_array_make(result_pool, source->nelts,
+                                              sizeof(svn_ra_svn_item_t));
+
+  int i;
+  for (i = 0; i < source->nelts; ++i)
+    {
+      svn_ra_svn_item_t *sub_target = apr_array_push(result);
+      svn_ra_svn__item_t *sub_source = &SVN_RA_SVN__LIST_ITEM(source, i);
+
+      svn_ra_svn__to_public_item(sub_target, sub_source, result_pool);
+    }
+
+  return result;
+}
+
+void
+svn_ra_svn__to_private_item(svn_ra_svn__item_t *target,
+                            const svn_ra_svn_item_t *source,
+                            apr_pool_t *result_pool)
+{
+  target->kind = source->kind;
+  switch (source->kind)
+    {
+      case SVN_RA_SVN_STRING:
+        target->u.string = *source->u.string;
+        break;
+      case SVN_RA_SVN_NUMBER:
+        target->u.number = source->u.number;
+        break;
+      case SVN_RA_SVN_WORD:
+        target->u.word = source->u.word;
+        break;
+      case SVN_RA_SVN_LIST:
+        target->u.list = *svn_ra_svn__to_private_array(source->u.list,
+                                                       result_pool);
+        break;
+    }
+}
+
+svn_ra_svn__list_t *
+svn_ra_svn__to_private_array(const apr_array_header_t *source,
+                             apr_pool_t *result_pool)
+{
+  int i;
+
+  svn_ra_svn__list_t *result = apr_pcalloc(result_pool, sizeof(*result));
+  result->nelts = source->nelts;
+  result->items = apr_palloc(result_pool,
+                             source->nelts * sizeof(*result->items));
+
+  for (i = 0; i < source->nelts; ++i)
+    {
+      svn_ra_svn__item_t *sub_target = &result->items[i];
+      svn_ra_svn_item_t *sub_source = &APR_ARRAY_IDX(source, i,
+                                                     svn_ra_svn_item_t);
+
+      svn_ra_svn__to_private_item(sub_target, sub_source, result_pool);
+    }
+
+  return result;
+}
+
 /* --- CONNECTION INITIALIZATION --- */
 
 svn_ra_svn_conn_t *svn_ra_svn_create_conn4(apr_socket_t *sock,
@@ -133,16 +225,26 @@ svn_ra_svn_conn_t *svn_ra_svn_create_con
   return conn;
 }
 
-svn_error_t *svn_ra_svn_set_capabilities(svn_ra_svn_conn_t *conn,
-                                         const apr_array_header_t *list)
+svn_error_t *
+svn_ra_svn_set_capabilities(svn_ra_svn_conn_t *conn,
+                            const apr_array_header_t *list)
+{
+  svn_ra_svn__list_t *internal
+    = svn_ra_svn__to_private_array(list, list->pool);
+  return svn_error_trace(svn_ra_svn__set_capabilities(conn, internal));
+}
+
+svn_error_t *
+svn_ra_svn__set_capabilities(svn_ra_svn_conn_t *conn,
+                             const svn_ra_svn__list_t *list)
 {
   int i;
-  svn_ra_svn_item_t *item;
+  svn_ra_svn__item_t *item;
   const char *word;
 
   for (i = 0; i < list->nelts; i++)
     {
-      item = &APR_ARRAY_IDX(list, i, svn_ra_svn_item_t);
+      item = &SVN_RA_SVN__LIST_ITEM(list, i);
       if (item->kind != SVN_RA_SVN_WORD)
         return svn_error_create(SVN_ERR_RA_SVN_MALFORMED_DATA, NULL,
                                 _("Capability entry is not a word"));
@@ -1027,7 +1129,7 @@ svn_ra_svn__write_tuple(svn_ra_svn_conn_
  * Afterwards, *ITEM is of type 'SVN_RA_SVN_STRING', and its string
  * data is allocated in POOL. */
 static svn_error_t *read_string(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
-                                svn_ra_svn_item_t *item, apr_uint64_t len64)
+                                svn_ra_svn__item_t *item, apr_uint64_t len64)
 {
   apr_size_t len = (apr_size_t)len64;
   apr_size_t readbuf_len;
@@ -1043,7 +1145,8 @@ static svn_error_t *read_string(svn_ra_s
   if (conn->read_ptr + len <= conn->read_end)
     {
       item->kind = SVN_RA_SVN_STRING;
-      item->u.string = svn_string_ncreate(conn->read_ptr, len, pool);
+      item->u.string.data = apr_pstrmemdup(pool, conn->read_ptr, len);
+      item->u.string.len = len;
       conn->read_ptr += len;
     }
   else
@@ -1084,7 +1187,8 @@ static svn_error_t *read_string(svn_ra_s
 
       /* Return the string properly wrapped into an RA_SVN item. */
       item->kind = SVN_RA_SVN_STRING;
-      item->u.string = svn_stringbuf__morph_into_string(stringbuf);
+      item->u.string.data = stringbuf->data;
+      item->u.string.len = stringbuf->len;
     }
 
   return SVN_NO_ERROR;
@@ -1095,12 +1199,12 @@ static svn_error_t *read_string(svn_ra_s
  * to 0 for the first call and is used to enforce a recursion limit
  * on the parser. */
 static svn_error_t *read_item(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
-                              svn_ra_svn_item_t *item, char first_char,
+                              svn_ra_svn__item_t *item, char first_char,
                               int level)
 {
   char c = first_char;
   apr_uint64_t val;
-  svn_ra_svn_item_t *listitem;
+  svn_ra_svn__item_t *listitem;
 
   if (++level >= ITEM_NESTING_LIMIT)
     return svn_error_create(SVN_ERR_RA_SVN_MALFORMED_DATA, NULL,
@@ -1190,54 +1294,64 @@ static svn_error_t *read_item(svn_ra_svn
     }
   else if (c == '(')
     {
-      /* On machines with 32 bit pointers, array headers are only 20 bytes
-       * which is not enough for our standard 64 bit alignment.
-       * So, determine a suitable block size for the APR array header that
-       * keeps proper alignment for following structs. */
-      const apr_size_t header_size
-        = APR_ALIGN_DEFAULT(sizeof(apr_array_header_t));
-
-      /* Allocate an APR array with room for (initially) 4 items.
-       * We do this manually because lists are the most frequent protocol
-       * element, often used to frame a single, optional value.  We save
-       * about 20% of total protocol handling time. */
-      char *buffer = apr_palloc(pool,
-                                header_size + 4 * sizeof(svn_ra_svn_item_t));
-      svn_ra_svn_item_t *data = (svn_ra_svn_item_t *)(buffer + header_size);
-
-      item->kind = SVN_RA_SVN_LIST;
-      item->u.list = (apr_array_header_t *)buffer;
-      item->u.list->elts = (char *)data;
-      item->u.list->pool = pool;
-      item->u.list->elt_size = sizeof(*data);
-      item->u.list->nelts = 0;
-      item->u.list->nalloc = 4;
-
-      listitem = data;
+      /* The largest struct that the protocol currently defines has 10
+       * elements (log-entry) and add some headroom for future extensions.
+       * At a maximum nesting level of 64 this use <= 18kB of stack.
+       *
+       * All system-defined data structures will fit into this and will be
+       * copied into ITEM after a single apr_palloc with no over-provision.
+       * Unbounded lists with more than 12 but less than 25 entries will
+       * also see only a single allocation from POOL.  However, there will
+       * be some over-provision.  Longer lists will see log N resizes and
+       * O(N) total cost.
+       */
+      svn_ra_svn__item_t stack_items[12];
+      svn_ra_svn__item_t *items = stack_items;
+      int capacity = sizeof(stack_items) / sizeof(stack_items[0]);
+      int count = 0;
 
       /* Read in the list items. */
+      item->kind = SVN_RA_SVN_LIST;
       while (1)
         {
           SVN_ERR(readbuf_getchar_skip_whitespace(conn, pool, &c));
           if (c == ')')
             break;
 
-          /* increase array capacity if necessary */
-          if (item->u.list->nelts == item->u.list->nalloc)
+          /* Auto-expand the list. */
+          if (count == capacity)
             {
-              data = apr_palloc(pool, 2 * item->u.list->nelts * sizeof(*data));
-              memcpy(data, item->u.list->elts, item->u.list->nelts * sizeof(*data));
-              item->u.list->elts = (char *)data;
-              item->u.list->nalloc *= 2;
-              listitem = data + item->u.list->nelts;
+              svn_ra_svn__item_t *new_items
+                = apr_palloc(pool, 2 * capacity * sizeof(*new_items));
+              memcpy(new_items, items, capacity * sizeof(*new_items));
+              items = new_items;
+              capacity = 2 * capacity;
             }
 
-          /* read next protocol item */
+          listitem = &items[count];
+          ++count;
+
           SVN_ERR(read_item(conn, pool, listitem, c, level));
+        }
+
+      /* Store the list in ITEM - if not empty (= default). */
+      if (count)
+        {
+          item->u.list.nelts = count;
 
-          listitem++;
-          item->u.list->nelts++;
+          /* If we haven't allocated from POOL, yet, do it now. */
+          if (items == stack_items)
+            item->u.list.items = apr_pmemdup(pool, items,
+                                             count * sizeof(*items));
+          else
+            item->u.list.items = items;
         }
+      else
+        {
+          item->u.list.items = NULL;
+          item->u.list.nelts = 0;
+        }
+
       SVN_ERR(readbuf_getchar(conn, pool, &c));
     }
 
@@ -1339,7 +1453,7 @@ read_command_only(svn_ra_svn_conn_t *con
 svn_error_t *
 svn_ra_svn__read_item(svn_ra_svn_conn_t *conn,
                       apr_pool_t *pool,
-                      svn_ra_svn_item_t **item)
+                      svn_ra_svn__item_t **item)
 {
   char c;
 
@@ -1389,29 +1503,32 @@ svn_ra_svn__skip_leading_garbage(svn_ra_
 
 /* --- READING AND PARSING TUPLES --- */
 
-/* Parse a tuple of svn_ra_svn_item_t *'s.  Advance *FMT to the end of the
+/* Parse a tuple of svn_ra_svn__item_t *'s.  Advance *FMT to the end of the
  * tuple specification and advance AP by the corresponding arguments. */
-static svn_error_t *vparse_tuple(const apr_array_header_t *items, apr_pool_t *pool,
-                                 const char **fmt, va_list *ap)
+static svn_error_t *
+vparse_tuple(const svn_ra_svn__list_t *items,
+             apr_pool_t *pool,
+             const char **fmt,
+             va_list *ap)
 {
   int count, nesting_level;
-  svn_ra_svn_item_t *elt;
+  svn_ra_svn__item_t *elt;
 
   for (count = 0; **fmt && count < items->nelts; (*fmt)++, count++)
     {
       /* '?' just means the tuple may stop; skip past it. */
       if (**fmt == '?')
         (*fmt)++;
-      elt = &APR_ARRAY_IDX(items, count, svn_ra_svn_item_t);
+      elt = &SVN_RA_SVN__LIST_ITEM(items, count);
       if (**fmt == '(' && elt->kind == SVN_RA_SVN_LIST)
         {
           (*fmt)++;
-          SVN_ERR(vparse_tuple(elt->u.list, pool, fmt, ap));
+          SVN_ERR(vparse_tuple(&elt->u.list, pool, fmt, ap));
         }
       else if (**fmt == 'c' && elt->kind == SVN_RA_SVN_STRING)
-        *va_arg(*ap, const char **) = elt->u.string->data;
+        *va_arg(*ap, const char **) = elt->u.string.data;
       else if (**fmt == 's' && elt->kind == SVN_RA_SVN_STRING)
-        *va_arg(*ap, svn_string_t **) = elt->u.string;
+        *va_arg(*ap, svn_string_t **) = &elt->u.string;
       else if (**fmt == 'w' && elt->kind == SVN_RA_SVN_WORD)
         *va_arg(*ap, const char **) = elt->u.word;
       else if (**fmt == 'b' && elt->kind == SVN_RA_SVN_WORD)
@@ -1446,7 +1563,7 @@ static svn_error_t *vparse_tuple(const a
             break;
         }
       else if (**fmt == 'l' && elt->kind == SVN_RA_SVN_LIST)
-        *va_arg(*ap, apr_array_header_t **) = elt->u.list;
+        *va_arg(*ap, svn_ra_svn__list_t **) = &elt->u.list;
       else if (**fmt == ')')
         return SVN_NO_ERROR;
       else
@@ -1472,7 +1589,7 @@ static svn_error_t *vparse_tuple(const a
               *va_arg(*ap, const char **) = NULL;
               break;
             case 'l':
-              *va_arg(*ap, apr_array_header_t **) = NULL;
+              *va_arg(*ap, svn_ra_svn__list_t **) = NULL;
               break;
             case 'B':
             case 'n':
@@ -1500,7 +1617,7 @@ static svn_error_t *vparse_tuple(const a
 }
 
 svn_error_t *
-svn_ra_svn__parse_tuple(const apr_array_header_t *list,
+svn_ra_svn__parse_tuple(const svn_ra_svn__list_t *list,
                         apr_pool_t *pool,
                         const char *fmt, ...)
 {
@@ -1519,7 +1636,7 @@ svn_ra_svn__read_tuple(svn_ra_svn_conn_t
                        const char *fmt, ...)
 {
   va_list ap;
-  svn_ra_svn_item_t *item;
+  svn_ra_svn__item_t *item;
   svn_error_t *err;
 
   SVN_ERR(svn_ra_svn__read_item(conn, pool, &item));
@@ -1527,7 +1644,7 @@ svn_ra_svn__read_tuple(svn_ra_svn_conn_t
     return svn_error_create(SVN_ERR_RA_SVN_MALFORMED_DATA, NULL,
                             _("Malformed network data"));
   va_start(ap, fmt);
-  err = vparse_tuple(item->u.list, pool, &fmt, &ap);
+  err = vparse_tuple(&item->u.list, pool, &fmt, &ap);
   va_end(ap);
   return err;
 }
@@ -1546,23 +1663,23 @@ svn_ra_svn__read_command_only(svn_ra_svn
 
 
 svn_error_t *
-svn_ra_svn__parse_proplist(const apr_array_header_t *list,
+svn_ra_svn__parse_proplist(const svn_ra_svn__list_t *list,
                            apr_pool_t *pool,
                            apr_hash_t **props)
 {
   svn_string_t *name;
   svn_string_t *value;
-  svn_ra_svn_item_t *elt;
+  svn_ra_svn__item_t *elt;
   int i;
 
   *props = svn_hash__make(pool);
   for (i = 0; i < list->nelts; i++)
     {
-      elt = &APR_ARRAY_IDX(list, i, svn_ra_svn_item_t);
+      elt = &SVN_RA_SVN__LIST_ITEM(list, i);
       if (elt->kind != SVN_RA_SVN_LIST)
         return svn_error_create(SVN_ERR_RA_SVN_MALFORMED_DATA, NULL,
                                 _("Proplist element not a list"));
-      SVN_ERR(svn_ra_svn__parse_tuple(elt->u.list, pool, "ss",
+      SVN_ERR(svn_ra_svn__parse_tuple(&elt->u.list, pool, "ss",
                                       &name, &value));
       apr_hash_set(*props, name->data, name->len, value);
     }
@@ -1588,12 +1705,13 @@ svn_error_t *svn_ra_svn__locate_real_err
   return this_link;
 }
 
-svn_error_t *svn_ra_svn__handle_failure_status(const apr_array_header_t *params,
-                                               apr_pool_t *pool)
+svn_error_t *
+svn_ra_svn__handle_failure_status(const svn_ra_svn__list_t *params,
+                                  apr_pool_t *pool)
 {
   const char *message, *file;
   svn_error_t *err = NULL;
-  svn_ra_svn_item_t *elt;
+  svn_ra_svn__item_t *elt;
   int i;
   apr_uint64_t apr_err, line;
   apr_pool_t *subpool = svn_pool_create(pool);
@@ -1606,11 +1724,11 @@ svn_error_t *svn_ra_svn__handle_failure_
   for (i = params->nelts - 1; i >= 0; i--)
     {
       svn_pool_clear(subpool);
-      elt = &APR_ARRAY_IDX(params, i, svn_ra_svn_item_t);
+      elt = &SVN_RA_SVN__LIST_ITEM(params, i);
       if (elt->kind != SVN_RA_SVN_LIST)
         return svn_error_create(SVN_ERR_RA_SVN_MALFORMED_DATA, NULL,
                                 _("Malformed error list"));
-      SVN_ERR(svn_ra_svn__parse_tuple(elt->u.list, subpool, "nccn",
+      SVN_ERR(svn_ra_svn__parse_tuple(&elt->u.list, subpool, "nccn",
                                       &apr_err, &message, &file, &line));
       /* The message field should have been optional, but we can't
          easily change that, so "" means a nonexistent message. */
@@ -1647,7 +1765,7 @@ svn_ra_svn__read_cmd_response(svn_ra_svn
 {
   va_list ap;
   const char *status;
-  apr_array_header_t *params;
+  svn_ra_svn__list_t *params;
   svn_error_t *err;
 
   SVN_ERR(svn_ra_svn__read_tuple(conn, pool, "wl", &status, &params));
@@ -1696,8 +1814,8 @@ svn_ra_svn__handle_command(svn_boolean_t
 {
   const char *cmdname;
   svn_error_t *err, *write_err;
-  apr_array_header_t *params;
-  const svn_ra_svn_cmd_entry_t *command;
+  svn_ra_svn__list_t *params;
+  const svn_ra_svn__cmd_entry_t *command;
 
   *terminate = FALSE;
   err = svn_ra_svn__read_tuple(conn, pool, "wl", &cmdname, &params);
@@ -1716,7 +1834,21 @@ svn_ra_svn__handle_command(svn_boolean_t
   command = svn_hash_gets(cmd_hash, cmdname);
   if (command)
     {
-      err = (*command->handler)(conn, pool, params, baton);
+      /* Call the standard command handler.
+       * If that is not set, then this is a lecagy API call and we invoke
+       * the legacy command handler. */
+      if (command->handler)
+        {
+          err = (*command->handler)(conn, pool, params, baton);
+        }
+      else
+        {
+          apr_array_header_t *deprecated_params
+            = svn_ra_svn__to_public_array(params, pool);
+          err = (*command->deprecated_handler)(conn, pool, deprecated_params,
+                                               baton);
+        }
+
       *terminate = command->terminate;
     }
   else
@@ -1741,13 +1873,13 @@ svn_ra_svn__handle_command(svn_boolean_t
 svn_error_t *
 svn_ra_svn__handle_commands2(svn_ra_svn_conn_t *conn,
                              apr_pool_t *pool,
-                             const svn_ra_svn_cmd_entry_t *commands,
+                             const svn_ra_svn__cmd_entry_t *commands,
                              void *baton,
                              svn_boolean_t error_on_disconnect)
 {
   apr_pool_t *subpool = svn_pool_create(pool);
   apr_pool_t *iterpool = svn_pool_create(subpool);
-  const svn_ra_svn_cmd_entry_t *command;
+  const svn_ra_svn__cmd_entry_t *command;
   apr_hash_t *cmd_hash = apr_hash_make(subpool);
 
   for (command = commands; command->cmdname; command++)
@@ -2703,13 +2835,13 @@ svn_ra_svn__write_data_log_entry(svn_ra_
 /* In *RESULT, return the SVN-style string at index IDX in tuple ITEMS.
  */
 static svn_error_t *
-svn_ra_svn__read_string(const apr_array_header_t *items,
+svn_ra_svn__read_string(const svn_ra_svn__list_t *items,
                         int idx,
                         svn_string_t **result)
 {
-  svn_ra_svn_item_t *elt = &APR_ARRAY_IDX(items, idx, svn_ra_svn_item_t);
+  svn_ra_svn__item_t *elt = &SVN_RA_SVN__LIST_ITEM(items, idx);
   CHECK_PROTOCOL_COND(elt->kind == SVN_RA_SVN_STRING);
-  *result = elt->u.string;
+  *result = &elt->u.string;
 
   return SVN_NO_ERROR;
 }
@@ -2717,13 +2849,13 @@ svn_ra_svn__read_string(const apr_array_
 /* In *RESULT, return the C-style string at index IDX in tuple ITEMS.
  */
 static svn_error_t *
-svn_ra_svn__read_cstring(const apr_array_header_t *items,
+svn_ra_svn__read_cstring(const svn_ra_svn__list_t *items,
                          int idx,
                          const char **result)
 {
-  svn_ra_svn_item_t *elt = &APR_ARRAY_IDX(items, idx, svn_ra_svn_item_t);
+  svn_ra_svn__item_t *elt = &SVN_RA_SVN__LIST_ITEM(items, idx);
   CHECK_PROTOCOL_COND(elt->kind == SVN_RA_SVN_STRING);
-  *result = elt->u.string->data;
+  *result = elt->u.string.data;
 
   return SVN_NO_ERROR;
 }
@@ -2731,11 +2863,11 @@ svn_ra_svn__read_cstring(const apr_array
 /* In *RESULT, return the word at index IDX in tuple ITEMS.
  */
 static svn_error_t *
-svn_ra_svn__read_word(const apr_array_header_t *items,
+svn_ra_svn__read_word(const svn_ra_svn__list_t *items,
                       int idx,
                       const char **result)
 {
-  svn_ra_svn_item_t *elt = &APR_ARRAY_IDX(items, idx, svn_ra_svn_item_t);
+  svn_ra_svn__item_t *elt = &SVN_RA_SVN__LIST_ITEM(items, idx);
   CHECK_PROTOCOL_COND(elt->kind == SVN_RA_SVN_WORD);
   *result = elt->u.word;
 
@@ -2745,11 +2877,11 @@ svn_ra_svn__read_word(const apr_array_he
 /* In *RESULT, return the revision at index IDX in tuple ITEMS.
  */
 static svn_error_t *
-svn_ra_svn__read_revision(const apr_array_header_t *items,
+svn_ra_svn__read_revision(const svn_ra_svn__list_t *items,
                           int idx,
                           svn_revnum_t *result)
 {
-  svn_ra_svn_item_t *elt = &APR_ARRAY_IDX(items, idx, svn_ra_svn_item_t);
+  svn_ra_svn__item_t *elt = &SVN_RA_SVN__LIST_ITEM(items, idx);
   CHECK_PROTOCOL_COND(elt->kind == SVN_RA_SVN_NUMBER);
   *result = (svn_revnum_t)elt->u.number;
 
@@ -2759,11 +2891,11 @@ svn_ra_svn__read_revision(const apr_arra
 /* In *RESULT, return the boolean at index IDX in tuple ITEMS.
  */
 static svn_error_t *
-svn_ra_svn__read_boolean(const apr_array_header_t *items,
+svn_ra_svn__read_boolean(const svn_ra_svn__list_t *items,
                          int idx,
                          apr_uint64_t *result)
 {
-  svn_ra_svn_item_t *elt = &APR_ARRAY_IDX(items, idx, svn_ra_svn_item_t);
+  svn_ra_svn__item_t *elt = &SVN_RA_SVN__LIST_ITEM(items, idx);
   CHECK_PROTOCOL_COND(elt->kind == SVN_RA_SVN_WORD);
   if (elt->u.word[0] == 't' && strcmp(elt->u.word, "true") == 0)
     *result = TRUE;
@@ -2778,21 +2910,21 @@ svn_ra_svn__read_boolean(const apr_array
 /* In *RESULT, return the tuple at index IDX in tuple ITEMS.
  */
 static svn_error_t *
-svn_ra_svn__read_list(const apr_array_header_t *items,
+svn_ra_svn__read_list(const svn_ra_svn__list_t *items,
                       int idx,
-                      const apr_array_header_t **result)
+                      const svn_ra_svn__list_t **result)
 {
-  svn_ra_svn_item_t *elt  = &APR_ARRAY_IDX(items, idx, svn_ra_svn_item_t);
+  svn_ra_svn__item_t *elt  = &SVN_RA_SVN__LIST_ITEM(items, idx);
   CHECK_PROTOCOL_COND(elt->kind == SVN_RA_SVN_LIST);
 
-  *result = elt->u.list;
+  *result = &elt->u.list;
   return SVN_NO_ERROR;
 }
 
 /* Verify the tuple ITEMS contains at least MIN and at most MAX elements.
  */
 static svn_error_t *
-svn_ra_svn__read_check_array_size(const apr_array_header_t *items,
+svn_ra_svn__read_check_array_size(const svn_ra_svn__list_t *items,
                                   int min,
                                   int max)
 {
@@ -2801,7 +2933,7 @@ svn_ra_svn__read_check_array_size(const
 }
 
 svn_error_t *
-svn_ra_svn__read_data_log_changed_entry(const apr_array_header_t *items,
+svn_ra_svn__read_data_log_changed_entry(const svn_ra_svn__list_t *items,
                                         svn_string_t **cpath,
                                         const char **action,
                                         const char **copy_path,
@@ -2810,7 +2942,7 @@ svn_ra_svn__read_data_log_changed_entry(
                                         apr_uint64_t *text_mods,
                                         apr_uint64_t *prop_mods)
 {
-  const apr_array_header_t *sub_items;
+  const svn_ra_svn__list_t *sub_items;
 
   /* initialize optional values */
   *copy_path = NULL;

Modified: subversion/branches/patch-exec/subversion/libsvn_ra_svn/ra_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_ra_svn/ra_svn.h?rev=1703735&r1=1703734&r2=1703735&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_ra_svn/ra_svn.h (original)
+++ subversion/branches/patch-exec/subversion/libsvn_ra_svn/ra_svn.h Fri Sep 18 01:38:47 2015
@@ -165,8 +165,9 @@ svn_error_t *svn_ra_svn__locate_real_err
  * command response indicating failure).  The error chain will be
  * in the same order as the errors indicated in @a params.  Use
  * @a pool for temporary allocations. */
-svn_error_t *svn_ra_svn__handle_failure_status(const apr_array_header_t *params,
-                                               apr_pool_t *pool);
+svn_error_t *
+svn_ra_svn__handle_failure_status(const svn_ra_svn__list_t *params,
+                                  apr_pool_t *pool);
 
 /* Returns a stream that reads/writes from/to SOCK. */
 svn_ra_svn__stream_t *svn_ra_svn__stream_from_sock(apr_socket_t *sock,
@@ -220,7 +221,7 @@ svn_ra_svn__stream_data_available(svn_ra
  * tokens. */
 svn_error_t *
 svn_ra_svn__do_cyrus_auth(svn_ra_svn__session_baton_t *sess,
-                          const apr_array_header_t *mechlist,
+                          const svn_ra_svn__list_t *mechlist,
                           const char *realm, apr_pool_t *pool);
 
 /* Same as svn_ra_svn__do_cyrus_auth, but uses the built-in implementation of
@@ -229,7 +230,7 @@ svn_ra_svn__do_cyrus_auth(svn_ra_svn__se
  * mechanism with the server. */
 svn_error_t *
 svn_ra_svn__do_internal_auth(svn_ra_svn__session_baton_t *sess,
-                             const apr_array_header_t *mechlist,
+                             const svn_ra_svn__list_t *mechlist,
                              const char *realm, apr_pool_t *pool);
 
 /* Having picked a mechanism, start authentication by writing out an
@@ -239,8 +240,8 @@ svn_error_t *svn_ra_svn__auth_response(s
                                        apr_pool_t *pool,
                                        const char *mech, const char *mech_arg);
 
-/* Looks for MECH as a word in MECHLIST (an array of svn_ra_svn_item_t). */
-svn_boolean_t svn_ra_svn__find_mech(const apr_array_header_t *mechlist,
+/* Looks for MECH as a word in MECHLIST. */
+svn_boolean_t svn_ra_svn__find_mech(const svn_ra_svn__list_t *mechlist,
                                     const char *mech);
 
 /* Initialize the SASL library. */

Modified: subversion/branches/patch-exec/subversion/libsvn_repos/load-fs-vtable.c
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_repos/load-fs-vtable.c?rev=1703735&r1=1703734&r2=1703735&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_repos/load-fs-vtable.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_repos/load-fs-vtable.c Fri Sep 18 01:38:47 2015
@@ -624,14 +624,6 @@ maybe_add_with_history(struct node_baton
 }
 
 static svn_error_t *
-magic_header_record(int version,
-                    void *parse_baton,
-                    apr_pool_t *pool)
-{
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
 uuid_record(const char *uuid,
             void *parse_baton,
             apr_pool_t *pool)
@@ -1194,7 +1186,7 @@ svn_repos_get_fs_build_parser5(const svn
   if (SVN_IS_VALID_REVNUM(start_rev))
     SVN_ERR_ASSERT(start_rev <= end_rev);
 
-  parser->magic_header_record = magic_header_record;
+  parser->magic_header_record = NULL;
   parser->uuid_record = uuid_record;
   parser->new_revision_record = new_revision_record;
   parser->new_node_record = new_node_record;
@@ -1415,7 +1407,7 @@ build_revprop_parser(const svn_repos_par
   if (SVN_IS_VALID_REVNUM(start_rev))
     SVN_ERR_ASSERT(start_rev <= end_rev);
 
-  parser->magic_header_record = magic_header_record;
+  parser->magic_header_record = NULL;
   parser->uuid_record = uuid_record;
   parser->new_revision_record = revprops_new_revision_record;
   parser->new_node_record = NULL;

Modified: subversion/branches/patch-exec/subversion/libsvn_repos/load.c
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_repos/load.c?rev=1703735&r1=1703734&r2=1703735&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_repos/load.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_repos/load.c Fri Sep 18 01:38:47 2015
@@ -385,7 +385,135 @@ parse_format_version(int *version,
   return SVN_NO_ERROR;
 }
 
+/*----------------------------------------------------------------------*/
+
+/** Dummy callback implementations for functions not provided by the user **/
+
+static svn_error_t *
+dummy_handler_magic_header_record(int version,
+                                  void *parse_baton,
+                                  apr_pool_t *pool)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+dummy_handler_uuid_record(const char *uuid,
+                          void *parse_baton,
+                          apr_pool_t *pool)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+dummy_handler_new_revision_record(void **revision_baton,
+                                  apr_hash_t *headers,
+                                  void *parse_baton,
+                                  apr_pool_t *pool)
+{
+  *revision_baton = NULL;
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+dummy_handler_new_node_record(void **node_baton,
+                              apr_hash_t *headers,
+                              void *revision_baton,
+                              apr_pool_t *pool)
+{
+  *node_baton = NULL;
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+dummy_handler_set_revision_property(void *revision_baton,
+                                    const char *name,
+                                    const svn_string_t *value)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+dummy_handler_set_node_property(void *node_baton,
+                                const char *name,
+                                const svn_string_t *value)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+dummy_handler_delete_node_property(void *node_baton,
+                                   const char *name)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+dummy_handler_remove_node_props(void *node_baton)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+dummy_handler_set_fulltext(svn_stream_t **stream,
+                               void *node_baton)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+dummy_handler_apply_textdelta(svn_txdelta_window_handler_t *handler,
+                              void **handler_baton,
+                              void *node_baton)
+{
+  /* Only called by parse_text_block() and that tests for NULL handlers. */
+  *handler = NULL;
+  *handler_baton = NULL;
+  return SVN_NO_ERROR;
+}
 
+static svn_error_t *
+dummy_handler_close_node(void *node_baton)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+dummy_handler_close_revision(void *revision_baton)
+{
+  return SVN_NO_ERROR;
+}
+
+/* Helper macro to copy the function pointer SOURCE->NAME to DEST->NAME.
+ * If the source pointer is NULL, pick the corresponding dummy handler
+ * instead. */
+#define SET_VTABLE_ENTRY(dest, source, name) \
+  dest->name = provided->name ? provided->name : dummy_handler_##name
+
+/* Return a copy of PROVIDED with all NULL callbacks replaced by a dummy
+ * handler.  Allocate the result in RESULT_POOL. */
+static const svn_repos_parse_fns3_t *
+complete_vtable(const svn_repos_parse_fns3_t *provided,
+                apr_pool_t *result_pool)
+{
+  svn_repos_parse_fns3_t *completed = apr_pcalloc(result_pool,
+                                                  sizeof(*completed));
+
+  SET_VTABLE_ENTRY(completed, provided, magic_header_record);
+  SET_VTABLE_ENTRY(completed, provided, uuid_record);
+  SET_VTABLE_ENTRY(completed, provided, new_revision_record);
+  SET_VTABLE_ENTRY(completed, provided, new_node_record);
+  SET_VTABLE_ENTRY(completed, provided, set_revision_property);
+  SET_VTABLE_ENTRY(completed, provided, set_node_property);
+  SET_VTABLE_ENTRY(completed, provided, delete_node_property);
+  SET_VTABLE_ENTRY(completed, provided, remove_node_props);
+  SET_VTABLE_ENTRY(completed, provided, set_fulltext);
+  SET_VTABLE_ENTRY(completed, provided, apply_textdelta);
+  SET_VTABLE_ENTRY(completed, provided, close_node);
+  SET_VTABLE_ENTRY(completed, provided, close_revision);
+
+  return completed;
+}
 
 /*----------------------------------------------------------------------*/
 
@@ -410,6 +538,10 @@ svn_repos_parse_dumpstream3(svn_stream_t
   apr_pool_t *nodepool = svn_pool_create(pool);
   int version;
 
+  /* Make sure we can blindly invoke callbacks. */
+  parse_fns = complete_vtable(parse_fns, pool);
+
+  /* Start parsing process. */
   SVN_ERR(svn_stream_readline(stream, &linebuf, "\n", &eof, linepool));
   if (eof)
     return stream_ran_dry();

Modified: subversion/branches/patch-exec/subversion/libsvn_repos/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_repos/log.c?rev=1703735&r1=1703734&r2=1703735&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_repos/log.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_repos/log.c Fri Sep 18 01:38:47 2015
@@ -1907,8 +1907,7 @@ store_search(svn_mergeinfo_t processed,
       const char *path = APR_ARRAY_IDX(paths, i, const char *);
       svn_rangelist_t *ranges = apr_array_make(processed_pool, 1,
                                                sizeof(svn_merge_range_t*));
-      svn_merge_range_t *range = apr_palloc(processed_pool,
-                                            sizeof(svn_merge_range_t));
+      svn_merge_range_t *range = apr_palloc(processed_pool, sizeof(*range));
 
       range->start = start;
       range->end = end;

Modified: subversion/branches/patch-exec/subversion/libsvn_repos/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_repos/repos.c?rev=1703735&r1=1703734&r2=1703735&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_repos/repos.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_repos/repos.c Fri Sep 18 01:38:47 2015
@@ -393,15 +393,15 @@ create_hooks(svn_repos_t *repos, apr_poo
 "# e.g.: \"" SVN_RA_CAPABILITY_MERGEINFO ":some-other-capability\" "         \
   "(the order is undefined)."                                                NL
 "#"                                                                          NL
+"# The list is self-reported by the client.  Therefore, you should not"      NL
+"# make security assumptions based on the capabilities list, nor should"     NL
+"# you assume that clients reliably report every capability they have."      NL
+"#"                                                                          NL
 "# Note: The TXN-NAME parameter is new in Subversion 1.8.  Prior to version" NL
 "# 1.8, the start-commit hook was invoked before the commit txn was even"    NL
 "# created, so the ability to inspect the commit txn and its metadata from"  NL
 "# within the start-commit hook was not possible."                           NL
 "# "                                                                         NL
-"# The list is self-reported by the client.  Therefore, you should not"      NL
-"# make security assumptions based on the capabilities list, nor should"     NL
-"# you assume that clients reliably report every capability they have."      NL
-"#"                                                                          NL
 "# If the hook program exits with success, the commit continues; but"        NL
 "# if it exits with failure (non-zero), the commit is stopped before"        NL
 "# a Subversion txn is created, and STDERR is returned to the client."       NL;

Modified: subversion/branches/patch-exec/subversion/libsvn_repos/rev_hunt.c
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_repos/rev_hunt.c?rev=1703735&r1=1703734&r2=1703735&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_repos/rev_hunt.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_repos/rev_hunt.c Fri Sep 18 01:38:47 2015
@@ -44,7 +44,7 @@
 
 /* Note:  this binary search assumes that the datestamp properties on
    each revision are in chronological order.  That is if revision A >
-   revision B, then A's datestamp is younger then B's datestamp.
+   revision B, then A's datestamp is younger than B's datestamp.
 
    If someone comes along and sets a bogus datestamp, this routine
    might not work right.

Modified: subversion/branches/patch-exec/subversion/libsvn_subr/atomic.c
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_subr/atomic.c?rev=1703735&r1=1703734&r2=1703735&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_subr/atomic.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_subr/atomic.c Fri Sep 18 01:38:47 2015
@@ -24,6 +24,7 @@
 #include <apr_time.h>
 #include "private/svn_atomic.h"
 
+
 /* Magic values for atomic initialization */
 #define SVN_ATOMIC_UNINITIALIZED 0
 #define SVN_ATOMIC_START_INIT    1
@@ -31,19 +32,20 @@
 #define SVN_ATOMIC_INITIALIZED   3
 
 
+/* Baton used by init_funct_t and init_once(). */
+typedef struct init_baton_t init_baton_t;
+
+/* Initialization function wrapper. Hides API details from init_once().
+   The implementation must return FALSE on failure. */
+typedef svn_boolean_t (*init_func_t)(init_baton_t *init_baton);
+
 /*
- * This is the actual atomic initialization driver.  The caller must
- * provide either ERR_INIT_FUNC and ERR_P, or STR_INIT_FUNC and
- * ERRSTR_P, but never both.
+ * This is the actual atomic initialization driver.
+ * Returns FALSE on failure.
  */
-static void
-init_once(svn_atomic__err_init_func_t err_init_func,
-          svn_error_t **err_p,
-          svn_atomic__str_init_func_t str_init_func,
-          const char **errstr_p,
-          volatile svn_atomic_t *global_status,
-          void *baton,
-          apr_pool_t* pool)
+static svn_boolean_t
+init_once(volatile svn_atomic_t *global_status,
+          init_func_t init_func, init_baton_t *init_baton)
 {
   /* !! Don't use localizable strings in this function, because these
      !! might cause deadlocks. This function can be used to initialize
@@ -53,44 +55,25 @@ init_once(svn_atomic__err_init_func_t er
      doesn't have statically-initialized mutexes, we implement a poor
      man's spinlock using svn_atomic_cas. */
 
-  svn_error_t *err = SVN_NO_ERROR;
-  const char *errstr = NULL;
   svn_atomic_t status = svn_atomic_cas(global_status,
                                        SVN_ATOMIC_START_INIT,
                                        SVN_ATOMIC_UNINITIALIZED);
 
-#ifdef SVN_DEBUG
-  /* Check that the parameters are valid. */
-  assert(!err_init_func != !str_init_func);
-  assert(!err_init_func == !err_p);
-  assert(!str_init_func == !errstr_p);
-#endif /* SVN_DEBUG */
-
   for (;;)
     {
       switch (status)
         {
         case SVN_ATOMIC_UNINITIALIZED:
-          if (err_init_func)
-            err = err_init_func(baton, pool);
-          else
-            errstr = str_init_func(baton);
-          if (err || errstr)
-            {
-              status = svn_atomic_cas(global_status,
-                                      SVN_ATOMIC_INIT_FAILED,
-                                      SVN_ATOMIC_START_INIT);
-            }
-          else
-            {
-              status = svn_atomic_cas(global_status,
-                                      SVN_ATOMIC_INITIALIZED,
-                                      SVN_ATOMIC_START_INIT);
-            }
-
-          /* Take another spin through the switch to report either
-             failure or success. */
-          continue;
+          {
+            const svn_boolean_t result = init_func(init_baton);
+            const svn_atomic_t init_state = (result
+                                             ? SVN_ATOMIC_INITIALIZED
+                                             : SVN_ATOMIC_INIT_FAILED);
+
+            svn_atomic_cas(global_status, init_state,
+                           SVN_ATOMIC_START_INIT);
+            return result;
+          }
 
         case SVN_ATOMIC_START_INIT:
           /* Wait for the init function to complete. */
@@ -101,19 +84,10 @@ init_once(svn_atomic__err_init_func_t er
           continue;
 
         case SVN_ATOMIC_INIT_FAILED:
-          if (err_init_func)
-            *err_p = svn_error_create(SVN_ERR_ATOMIC_INIT_FAILURE, err,
-                                      "Couldn't perform atomic initialization");
-          else
-            *errstr_p = errstr;
-          return;
+          return FALSE;
 
         case SVN_ATOMIC_INITIALIZED:
-          if (err_init_func)
-            *err_p = SVN_NO_ERROR;
-          else
-            *errstr_p = NULL;
-          return;
+          return TRUE;
 
         default:
           /* Something went seriously wrong with the atomic operations. */
@@ -123,15 +97,61 @@ init_once(svn_atomic__err_init_func_t er
 }
 
 
+/* This baton structure is used by the two flavours of init-once APIs
+   to hide their differences from the init_once() driver. Each private
+   API uses only selected parts of the baton.
+
+   No part of this structure changes unless a wrapped init function is
+   actually invoked by init_once().
+*/
+struct init_baton_t
+{
+  /* Used only by svn_atomic__init_once()/err_init_func_wrapper() */
+  svn_atomic__err_init_func_t err_init_func;
+  svn_error_t *err;
+  apr_pool_t *pool;
+
+  /* Used only by svn_atomic__init_no_error()/str_init_func_wrapper() */
+  svn_atomic__str_init_func_t str_init_func;
+  const char *errstr;
+
+  /* Used by both pairs of functions */
+  void *baton;
+};
+
+/* Wrapper for the svn_atomic__init_once init function. */
+static svn_boolean_t err_init_func_wrapper(init_baton_t *init_baton)
+{
+  init_baton->err = init_baton->err_init_func(init_baton->baton,
+                                              init_baton->pool);
+  return (init_baton->err == SVN_NO_ERROR);
+}
+
 svn_error_t *
 svn_atomic__init_once(volatile svn_atomic_t *global_status,
                       svn_atomic__err_init_func_t err_init_func,
                       void *baton,
                       apr_pool_t* pool)
 {
-  svn_error_t *err;
-  init_once(err_init_func, &err, NULL, NULL, global_status, baton, pool);
-  return err;
+  init_baton_t init_baton;
+  init_baton.err_init_func = err_init_func;
+  init_baton.err = NULL;
+  init_baton.pool = pool;
+  init_baton.baton = baton;
+
+  if (init_once(global_status, err_init_func_wrapper, &init_baton))
+    return SVN_NO_ERROR;
+
+  return svn_error_create(SVN_ERR_ATOMIC_INIT_FAILURE, init_baton.err,
+                          "Couldn't perform atomic initialization");
+}
+
+
+/* Wrapper for the svn_atomic__init_no_error init function. */
+static svn_boolean_t str_init_func_wrapper(init_baton_t *init_baton)
+{
+  init_baton->errstr = init_baton->str_init_func(init_baton->baton);
+  return (init_baton->errstr == NULL);
 }
 
 const char *
@@ -139,7 +159,18 @@ svn_atomic__init_once_no_error(volatile
                                svn_atomic__str_init_func_t str_init_func,
                                void *baton)
 {
-  const char *errstr;
-  init_once(NULL, NULL, str_init_func, &errstr, global_status, baton, NULL);
-  return errstr;
+  init_baton_t init_baton;
+  init_baton.str_init_func = str_init_func;
+  init_baton.errstr = NULL;
+  init_baton.baton = baton;
+
+  if (init_once(global_status, str_init_func_wrapper, &init_baton))
+    return NULL;
+
+  /* Our init function wrapper may not have been called; make sure
+     that we return generic error message in that case. */
+  if (!init_baton.errstr)
+    return "Couldn't perform atomic initialization";
+  else
+    return init_baton.errstr;
 }

Modified: subversion/branches/patch-exec/subversion/libsvn_subr/auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_subr/auth.c?rev=1703735&r1=1703734&r2=1703735&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_subr/auth.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_subr/auth.c Fri Sep 18 01:38:47 2015
@@ -880,3 +880,33 @@ svn_auth__make_session_auth(svn_auth_bat
 
   return SVN_NO_ERROR;
 }
+
+
+static svn_error_t *
+dummy_first_creds(void **credentials,
+                  void **iter_baton,
+                  void *provider_baton,
+                  apr_hash_t *parameters,
+                  const char *realmstring,
+                  apr_pool_t *pool)
+{
+  *credentials = NULL;
+  *iter_baton = NULL;
+  return SVN_NO_ERROR;
+}
+
+void
+svn_auth__get_dummmy_simple_provider(svn_auth_provider_object_t **provider,
+                                     apr_pool_t *pool)
+{
+  static const svn_auth_provider_t vtable = {
+    SVN_AUTH_CRED_SIMPLE,
+    dummy_first_creds,
+    NULL, NULL
+  };
+
+  svn_auth_provider_object_t *po = apr_pcalloc(pool, sizeof(*po));
+
+  po->vtable = &vtable;
+  *provider = po;
+}

Modified: subversion/branches/patch-exec/subversion/libsvn_subr/auth.h
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_subr/auth.h?rev=1703735&r1=1703734&r2=1703735&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_subr/auth.h (original)
+++ subversion/branches/patch-exec/subversion/libsvn_subr/auth.h Fri Sep 18 01:38:47 2015
@@ -157,6 +157,15 @@ svn_auth__get_gpg_agent_simple_provider
      apr_pool_t *pool);
 #endif /* !defined(WIN32) || defined(DOXYGEN) */
 
+/**
+ * Set @a *provider to a dummy provider of type @c
+ * svn_auth_cred_simple_t that never returns or stores any
+ * credentials.
+ */
+void
+svn_auth__get_dummmy_simple_provider(svn_auth_provider_object_t **provider,
+                                     apr_pool_t *pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/patch-exec/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_subr/cache-membuffer.c?rev=1703735&r1=1703734&r2=1703735&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_subr/cache-membuffer.c Fri Sep 18 01:38:47 2015
@@ -339,7 +339,9 @@ prefix_pool_get_internal(apr_uint32_t *p
   value = apr_hash_get(prefix_pool->map, prefix, prefix_len);
   if (value != NULL)
     {
-      *prefix_idx = value - prefix_pool->values;
+      const apr_size_t idx = value - prefix_pool->values;
+      SVN_ERR_ASSERT(idx < prefix_pool->values_used);
+      *prefix_idx = (apr_uint32_t) idx;
       return SVN_NO_ERROR;
     }
 
@@ -1961,7 +1963,7 @@ svn_cache__membuffer_cache_create(svn_me
                  : data_size / 8;
 
   /* to keep the entries small, we use 32 bit indexes only
-   * -> we need to ensure that no more then 4G entries exist.
+   * -> we need to ensure that no more than 4G entries exist.
    *
    * Note, that this limit could only be exceeded in a very
    * theoretical setup with about 1EB of cache.

Modified: subversion/branches/patch-exec/subversion/libsvn_subr/checksum.c
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_subr/checksum.c?rev=1703735&r1=1703734&r2=1703735&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_subr/checksum.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_subr/checksum.c Fri Sep 18 01:38:47 2015
@@ -373,26 +373,42 @@ svn_checksum_parse_hex(svn_checksum_t **
                        apr_pool_t *pool)
 {
   apr_size_t i, len;
-  char is_nonzero = '\0';
-  char *digest;
-  static const char xdigitval[256] =
+  unsigned char is_nonzero = 0;
+  unsigned char *digest;
+  static const unsigned char xdigitval[256] =
     {
-      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-       0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1,   /* 0-9 */
-      -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,   /* A-F */
-      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-      -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,   /* a-f */
-      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,   /* 0-7 */
+      0x08,0x09,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,   /* 8-9 */
+      0xFF,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0xFF,   /* A-F */
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0xFF,   /* a-f */
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+      0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
     };
 
   if (hex == NULL)
@@ -404,18 +420,18 @@ svn_checksum_parse_hex(svn_checksum_t **
   SVN_ERR(validate_kind(kind));
 
   *checksum = svn_checksum_create(kind, pool);
-  digest = (char *)(*checksum)->digest;
+  digest = (unsigned char *)(*checksum)->digest;
   len = DIGESTSIZE(kind);
 
   for (i = 0; i < len; i++)
     {
-      char x1 = xdigitval[(unsigned char)hex[i * 2]];
-      char x2 = xdigitval[(unsigned char)hex[i * 2 + 1]];
-      if (x1 == (char)-1 || x2 == (char)-1)
+      unsigned char x1 = xdigitval[(unsigned char)hex[i * 2]];
+      unsigned char x2 = xdigitval[(unsigned char)hex[i * 2 + 1]];
+      if (x1 == 0xFF || x2 == 0xFF)
         return svn_error_create(SVN_ERR_BAD_CHECKSUM_PARSE, NULL, NULL);
 
-      digest[i] = (char)((x1 << 4) | x2);
-      is_nonzero |= (char)((x1 << 4) | x2);
+      digest[i] = (x1 << 4) | x2;
+      is_nonzero |= digest[i];
     }
 
   if (!is_nonzero)

Modified: subversion/branches/patch-exec/subversion/libsvn_subr/config_auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_subr/config_auth.c?rev=1703735&r1=1703734&r2=1703735&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_subr/config_auth.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_subr/config_auth.c Fri Sep 18 01:38:47 2015
@@ -144,7 +144,7 @@ svn_config_write_auth_data(apr_hash_t *h
             apr_psprintf(pool, _("Error writing hash to '%s'"),
                          svn_dirent_local_style(auth_path, pool)));
   SVN_ERR(svn_stream_close(stream));
-  SVN_ERR(svn_io_file_rename(tmp_path, auth_path, pool));
+  SVN_ERR(svn_io_file_rename2(tmp_path, auth_path, FALSE, pool));
 
   /* To be nice, remove the realmstring from the hash again, just in
      case the caller wants their hash unchanged.

Modified: subversion/branches/patch-exec/subversion/libsvn_subr/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_subr/deprecated.c?rev=1703735&r1=1703734&r2=1703735&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_subr/deprecated.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_subr/deprecated.c Fri Sep 18 01:38:47 2015
@@ -889,6 +889,26 @@ svn_io_stat_dirent(const svn_io_dirent2_
                                 scratch_pool));
 }
 
+svn_error_t *
+svn_io_file_rename(const char *from_path, const char *to_path,
+                   apr_pool_t *pool)
+{
+  return svn_error_trace(svn_io_file_rename2(from_path, to_path,
+                                             FALSE, pool));
+}
+
+svn_error_t *
+svn_io_write_atomic(const char *final_path,
+                    const void *buf,
+                    apr_size_t nbytes,
+                    const char *copy_perms_path,
+                    apr_pool_t *scratch_pool)
+{
+  return svn_error_trace(svn_io_write_atomic2(final_path, buf, nbytes,
+                                              copy_perms_path, TRUE,
+                                              scratch_pool));
+}
+
 /*** From constructors.c ***/
 svn_log_changed_path_t *
 svn_log_changed_path_dup(const svn_log_changed_path_t *changed_path,
@@ -1058,6 +1078,12 @@ svn_stream_from_aprfile(apr_file_t *file
 }
 
 svn_error_t *
+svn_stream_for_stdin(svn_stream_t **in, apr_pool_t *pool)
+{
+  return svn_error_trace(svn_stream_for_stdin2(in, FALSE, pool));
+}
+
+svn_error_t *
 svn_stream_contents_same(svn_boolean_t *same,
                          svn_stream_t *stream1,
                          svn_stream_t *stream2,
@@ -1497,14 +1523,16 @@ svn_auth_get_keychain_ssl_client_cert_pw
 #endif /* DARWIN */
 
 #if !defined(WIN32)
-#ifdef SVN_HAVE_GPG_AGENT
 void
 svn_auth_get_gpg_agent_simple_provider(svn_auth_provider_object_t **provider,
                                        apr_pool_t *pool)
 {
+#ifdef SVN_HAVE_GPG_AGENT
   svn_auth__get_gpg_agent_simple_provider(provider, pool);
-}
+#else
+  svn_auth__get_dummmy_simple_provider(provider, pool);
 #endif /* SVN_HAVE_GPG_AGENT */
+}
 #endif /* !WIN32 */
 
 svn_error_t *