You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2015/05/13 06:51:28 UTC

svn commit: r1679139 [3/7] - in /subversion/branches/1.10-cache-improvements: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ subversion/bindings/javahl/ subversion/bindings/javahl/native/ subversion/bindings/javahl/native/jniwra...

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/dag.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/dag.c Wed May 13 04:51:26 2015
@@ -498,6 +498,40 @@ svn_fs_fs__dag_get_proplist(apr_hash_t *
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_fs_fs__dag_has_props(svn_boolean_t *has_props,
+                         dag_node_t *node,
+                         apr_pool_t *scratch_pool)
+{
+  node_revision_t *noderev;
+
+  SVN_ERR(get_node_revision(&noderev, node));
+
+  if (! noderev->prop_rep)
+    {
+      *has_props = FALSE; /* Easy out */
+      return SVN_NO_ERROR;
+    }
+
+  if (svn_fs_fs__id_txn_used(&noderev->prop_rep->txn_id))
+    {
+      /* We are in a commit or something. Check actual properties */
+      apr_hash_t *proplist;
+
+      SVN_ERR(svn_fs_fs__get_proplist(&proplist, node->fs,
+                                      noderev, scratch_pool));
+
+      *has_props = proplist ? (0 < apr_hash_count(proplist)) : FALSE;
+    }
+  else
+    {
+      /* Properties are stored as a standard hash stream,
+         always ending with "END\n" (4 bytes) */
+      *has_props = noderev->prop_rep->expanded_size > 4;
+    }
+
+  return SVN_NO_ERROR;
+}
 
 svn_error_t *
 svn_fs_fs__dag_set_proplist(dag_node_t *node,

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/dag.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/dag.h?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/dag.h (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/dag.h Wed May 13 04:51:26 2015
@@ -177,6 +177,12 @@ svn_error_t *svn_fs_fs__dag_get_proplist
                                          dag_node_t *node,
                                          apr_pool_t *pool);
 
+/* Set *HAS_PROPS to TRUE if NODE has properties. Use SCRATCH_POOL
+   for temporary allocations */
+svn_error_t *svn_fs_fs__dag_has_props(svn_boolean_t *has_props,
+                                      dag_node_t *node,
+                                      apr_pool_t *scratch_pool);
+
 /* Set the property list of NODE to PROPLIST, allocating from POOL.
    The node being changed must be mutable.
 

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/fs.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/fs.c Wed May 13 04:51:26 2015
@@ -27,7 +27,6 @@
 #include <apr_general.h>
 #include <apr_pools.h>
 #include <apr_file_io.h>
-#include <apr_thread_mutex.h>
 
 #include "svn_fs.h"
 #include "svn_delta.h"

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/fs.h?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/fs.h Wed May 13 04:51:26 2015
@@ -527,7 +527,14 @@ typedef struct representation_t
   svn_filesize_t size;
 
   /* The size of the fulltext of the representation. If this is 0,
-   * the fulltext size is equal to representation size in the rev file, */
+   * for a plain rep, the real fulltext size is equal to the SIZE field.
+   * For a delta rep, this field is always the real fulltext size.
+   *
+   * Note that svn_fs_fs__fixup_expanded_size() checks for these special
+   * cases and ensures that this field contains the actual value.  We call
+   * it early after reading a representation struct, so most code does not
+   * have to worry about it.
+   */
   svn_filesize_t expanded_size;
 
   /* Is this a representation (still) within a transaction? */

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/fs_fs.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/fs_fs.c Wed May 13 04:51:26 2015
@@ -1377,38 +1377,9 @@ svn_fs_fs__file_length(svn_filesize_t *l
       /* Treat "no representation" as "empty file". */
       *length = 0;
     }
-  else if (data_rep->expanded_size)
-    {
-      /* Standard case: a non-empty file. */
-      *length = data_rep->expanded_size;
-    }
   else
     {
-      /* Work around a FSFS format quirk (see issue #4554).
-
-         A plain representation may specify its EXPANDED LENGTH as "0"
-         in which case, the SIZE value is what we want.
-
-         Because EXPANDED_LENGTH will also be 0 for empty files, while
-         SIZE is non-null, we need to check wether the content is
-         actually empty.  We simply compare with the MD5 checksum of
-         empty content (sha-1 is not always available).
-       */
-      svn_checksum_t *empty_md5
-        = svn_checksum_empty_checksum(svn_checksum_md5, pool);
-
-      if (memcmp(empty_md5->digest, data_rep->md5_digest,
-                 sizeof(data_rep->md5_digest)))
-        {
-          /* Contents is not empty, i.e. EXPANDED_LENGTH cannot be the
-             actual file length. */
-          *length = data_rep->size;
-        }
-      else
-        {
-          /* Contents is empty. */
-          *length = 0;
-        }
+      *length = data_rep->expanded_size;
     }
 
   return SVN_NO_ERROR;
@@ -1944,7 +1915,10 @@ get_node_origins_from_file(svn_fs_t *fs,
 
   stream = svn_stream_from_aprfile2(fd, FALSE, pool);
   *node_origins = apr_hash_make(pool);
-  SVN_ERR(svn_hash_read2(*node_origins, stream, SVN_HASH_TERMINATOR, pool));
+  err = svn_hash_read2(*node_origins, stream, SVN_HASH_TERMINATOR, pool);
+  if (err)
+    return svn_error_quick_wrapf(err, _("malformed node origin data in '%s'"),
+                                 node_origins_file);
   return svn_stream_close(stream);
 }
 

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/id.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/id.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/id.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/id.c Wed May 13 04:51:26 2015
@@ -392,7 +392,7 @@ svn_fs_fs__id_compare(const svn_fs_id_t
                       const svn_fs_id_t *b)
 {
   if (svn_fs_fs__id_eq(a, b))
-    return svn_fs_node_same;
+    return svn_fs_node_unchanged;
   return (svn_fs_fs__id_check_related(a, b) ? svn_fs_node_common_ancestor
                                             : svn_fs_node_unrelated);
 }

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/lock.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/lock.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/lock.c Wed May 13 04:51:26 2015
@@ -222,7 +222,7 @@ write_digest_file(apr_hash_t *children,
                                  svn_io_file_del_none, pool, pool));
   if ((err = svn_hash_write2(hash, stream, SVN_HASH_TERMINATOR, pool)))
     {
-      svn_error_clear(svn_stream_close(stream));
+      err = svn_error_compose_create(err, svn_stream_close(stream));
       return svn_error_createf(err->apr_err,
                                err,
                                _("Cannot write lock/entries hashfile '%s'"),
@@ -273,7 +273,7 @@ read_digest_file(apr_hash_t **children_p
   hash = apr_hash_make(pool);
   if ((err = svn_hash_read2(hash, stream, SVN_HASH_TERMINATOR, pool)))
     {
-      svn_error_clear(svn_stream_close(stream));
+      err = svn_error_compose_create(err, svn_stream_close(stream));
       return svn_error_createf(err->apr_err,
                                err,
                                _("Can't parse lock/entries hashfile '%s'"),
@@ -1109,6 +1109,7 @@ svn_fs_fs__lock(svn_fs_t *fs,
   apr_array_header_t *sorted_targets;
   apr_hash_t *canonical_targets = apr_hash_make(scratch_pool);
   apr_hash_index_t *hi;
+  apr_pool_t *iterpool;
   svn_error_t *err, *cb_err = SVN_NO_ERROR;
   int i;
 
@@ -1149,11 +1150,13 @@ svn_fs_fs__lock(svn_fs_t *fs,
   lb.steal_lock = steal_lock;
   lb.result_pool = result_pool;
 
-  err = svn_fs_fs__with_write_lock(fs, lock_body, &lb, scratch_pool);
+  iterpool = svn_pool_create(scratch_pool);
+  err = svn_fs_fs__with_write_lock(fs, lock_body, &lb, iterpool);
   for (i = 0; i < lb.infos->nelts; ++i)
     {
       struct lock_info_t *info = &APR_ARRAY_IDX(lb.infos, i,
                                                 struct lock_info_t);
+      svn_pool_clear(iterpool);
       if (!cb_err && lock_callback)
         {
           if (!info->lock && !info->fs_err)
@@ -1162,10 +1165,11 @@ svn_fs_fs__lock(svn_fs_t *fs,
                                              info->path);
 
           cb_err = lock_callback(lock_baton, info->path, info->lock,
-                                 info->fs_err, scratch_pool);
+                                 info->fs_err, iterpool);
         }
       svn_error_clear(info->fs_err);
     }
+  svn_pool_destroy(iterpool);
 
   if (err && cb_err)
     svn_error_compose(err, cb_err);
@@ -1205,6 +1209,7 @@ svn_fs_fs__unlock(svn_fs_t *fs,
   apr_array_header_t *sorted_targets;
   apr_hash_t *canonical_targets = apr_hash_make(scratch_pool);
   apr_hash_index_t *hi;
+  apr_pool_t *iterpool;
   svn_error_t *err, *cb_err = SVN_NO_ERROR;
   int i;
 
@@ -1239,11 +1244,13 @@ svn_fs_fs__unlock(svn_fs_t *fs,
   ub.break_lock = break_lock;
   ub.result_pool = result_pool;
 
-  err = svn_fs_fs__with_write_lock(fs, unlock_body, &ub, scratch_pool);
+  iterpool = svn_pool_create(scratch_pool);
+  err = svn_fs_fs__with_write_lock(fs, unlock_body, &ub, iterpool);
   for (i = 0; i < ub.infos->nelts; ++i)
     {
       struct unlock_info_t *info = &APR_ARRAY_IDX(ub.infos, i,
                                                   struct unlock_info_t);
+      svn_pool_clear(iterpool);
       if (!cb_err && lock_callback)
         {
           if (!info->done && !info->fs_err)
@@ -1251,10 +1258,11 @@ svn_fs_fs__unlock(svn_fs_t *fs,
                                              0, _("Failed to unlock '%s'"),
                                              info->path);
           cb_err = lock_callback(lock_baton, info->path, NULL, info->fs_err,
-                                 scratch_pool);
+                                 iterpool);
         }
       svn_error_clear(info->fs_err);
     }
+  svn_pool_destroy(iterpool);
 
   if (err && cb_err)
     svn_error_compose(err, cb_err);

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/pack.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/pack.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/pack.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/pack.c Wed May 13 04:51:26 2015
@@ -643,17 +643,18 @@ compare_dir_entries_format6(const svn_so
 apr_array_header_t *
 svn_fs_fs__order_dir_entries(svn_fs_t *fs,
                              apr_hash_t *directory,
-                             apr_pool_t *pool)
+                             apr_pool_t *result_pool,
+                             apr_pool_t *scratch_pool)
 {
   apr_array_header_t *ordered
     = svn_sort__hash(directory,
                      svn_fs_fs__use_log_addressing(fs)
                        ? compare_dir_entries_format7
                        : compare_dir_entries_format6,
-                     pool);
+                     scratch_pool);
 
   apr_array_header_t *result
-    = apr_array_make(pool, ordered->nelts, sizeof(svn_fs_dirent_t *));
+    = apr_array_make(result_pool, ordered->nelts, sizeof(svn_fs_dirent_t *));
 
   int i;
   for (i = 0; i < ordered->nelts; ++i)
@@ -736,9 +737,7 @@ copy_node_to_temp(pack_context_t *contex
     {
       path_order->rep_id.revision = noderev->data_rep->revision;
       path_order->rep_id.number = noderev->data_rep->item_index;
-      path_order->expanded_size = noderev->data_rep->expanded_size
-                                ? noderev->data_rep->expanded_size
-                                : noderev->data_rep->size;
+      path_order->expanded_size = noderev->data_rep->expanded_size;
     }
 
   /* Sort path is the key used for ordering noderevs and associated reps.

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/pack.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/pack.h?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/pack.h (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/pack.h Wed May 13 04:51:26 2015
@@ -51,13 +51,14 @@ svn_fs_fs__get_packed_offset(apr_off_t *
                              apr_pool_t *pool);
 
 /* Return the svn_dir_entry_t* objects of DIRECTORY in an APR array
- * allocated in POOL with entries added in storage (on-disk) order.
- * FS format will be used to pick the optimal ordering strategy.
+ * allocated in RESULT_POOL with entries added in storage (on-disk) order.
+ * FS' format will be used to pick the optimal ordering strategy.  Use
+ * SCRATCH_POOL for temporary allocations.
  */
 apr_array_header_t *
 svn_fs_fs__order_dir_entries(svn_fs_t *fs,
                              apr_hash_t *directory,
-                             apr_pool_t *pool);
-
+                             apr_pool_t *result_pool,
+                             apr_pool_t *scratch_pool);
 
 #endif

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/recovery.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/recovery.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/recovery.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/recovery.c Wed May 13 04:51:26 2015
@@ -160,6 +160,7 @@ recover_find_max_ids(svn_fs_t *fs,
   apr_hash_index_t *hi;
   apr_pool_t *iterpool;
   node_revision_t *noderev;
+  svn_error_t *err;
 
   baton.stream = rev_file->stream;
   SVN_ERR(svn_io_file_seek(rev_file->file, APR_SET, &offset, pool));
@@ -196,16 +197,23 @@ recover_find_max_ids(svn_fs_t *fs,
      stored in the representation.  Note that this is a directory, i.e.
      represented using the hash format on disk and can never have 0 length. */
   baton.pool = pool;
-  baton.remaining = noderev->data_rep->expanded_size
-                  ? noderev->data_rep->expanded_size
-                  : noderev->data_rep->size;
+  baton.remaining = noderev->data_rep->expanded_size;
   stream = svn_stream_create(&baton, pool);
   svn_stream_set_read2(stream, NULL /* only full read support */,
                        read_handler_recover);
 
   /* Now read the entries from that stream. */
   entries = apr_hash_make(pool);
-  SVN_ERR(svn_hash_read2(entries, stream, SVN_HASH_TERMINATOR, pool));
+  err = svn_hash_read2(entries, stream, SVN_HASH_TERMINATOR, pool);
+  if (err)
+    {
+      svn_string_t *id_str = svn_fs_fs__id_unparse(noderev->id, pool);
+
+      err = svn_error_compose_create(err, svn_stream_close(stream));
+      return svn_error_quick_wrapf(err,
+                _("malformed representation for node-revision '%s'"),
+                id_str->data);
+    }
   SVN_ERR(svn_stream_close(stream));
 
   /* Now check each of the entries in our directory to find new node and

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/rep-cache.c Wed May 13 04:51:26 2015
@@ -24,6 +24,7 @@
 
 #include "svn_private_config.h"
 
+#include "cached_data.h"
 #include "fs_fs.h"
 #include "fs.h"
 #include "rep-cache.h"
@@ -273,6 +274,8 @@ svn_fs_fs__get_rep_reference(representat
       (*rep)->item_index = svn_sqlite__column_int64(stmt, 1);
       (*rep)->size = svn_sqlite__column_int64(stmt, 2);
       (*rep)->expanded_size = svn_sqlite__column_int64(stmt, 3);
+
+      SVN_ERR(svn_fs_fs__fixup_expanded_size(fs, *rep, pool));
     }
   else
     *rep = NULL;

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/stats.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/stats.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/stats.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/stats.c Wed May 13 04:51:26 2015
@@ -436,8 +436,7 @@ parse_representation(rep_stats_t **repre
        */
       result = apr_pcalloc(result_pool, sizeof(*result));
       result->revision = rep->revision;
-      result->expanded_size = (rep->expanded_size ? rep->expanded_size
-                                                  : rep->size);
+      result->expanded_size = rep->expanded_size;
       result->offset = (apr_off_t)rep->item_index;
       result->size = rep->size;
 

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/structure
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/structure?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/structure (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/structure Wed May 13 04:51:26 2015
@@ -198,9 +198,9 @@ Shard packing:
     (i.e. same min packed revision)
 
 Addressing:
-  Format 1-6: Physical addressing; uses fixed positions within a rev file
+  Format 1+: Physical addressing; uses fixed positions within a rev file
   Format 7+:  Logical addressing; uses item index that will be translated
-    on-the-fly to the actual rev / pack file location
+    on-the-fly to the actual rev / pack file location (default for 7+ created)
 
 Repository IDs:
   Format 1+:  The first line of db/uuid contains the repository UUID
@@ -578,8 +578,9 @@ defined:
     representations may not be handled correctly by SVN before 1.7.20,
     1.8.12 and 1.9.0, if they have 0 <size> fields for non-empty contents.
     Releases 1.8.0 through 1.8.11 may have falsely created instances of
-    that (see issue #4554).  Finally, 0 <size> fields are NEVER legal for
-    DELTA representations.
+    that (see issue #4554).  Finally, 0 <size> fields are only ever legal
+    for DELTA representations if the reconstructed full-text is actually
+    empty.
 
 The predecessor of a node-rev crosses both soft and true copies;
 together with the count field, it allows efficient determination of

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/transaction.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/transaction.c Wed May 13 04:51:26 2015
@@ -25,6 +25,7 @@
 #include <assert.h>
 #include <apr_sha1.h>
 
+#include "svn_error_codes.h"
 #include "svn_hash.h"
 #include "svn_props.h"
 #include "svn_sorts.h"
@@ -1127,6 +1128,7 @@ get_txn_proplist(apr_hash_t *proplist,
                  apr_pool_t *pool)
 {
   svn_stream_t *stream;
+  svn_error_t *err;
 
   /* Check for issue #3696. (When we find and fix the cause, we can change
    * this to an assertion.) */
@@ -1140,7 +1142,14 @@ get_txn_proplist(apr_hash_t *proplist,
                                    pool, pool));
 
   /* Read in the property list. */
-  SVN_ERR(svn_hash_read2(proplist, stream, SVN_HASH_TERMINATOR, pool));
+  err = svn_hash_read2(proplist, stream, SVN_HASH_TERMINATOR, pool);
+  if (err)
+    {
+      err = svn_error_compose_create(err, svn_stream_close(stream));
+      return svn_error_quick_wrapf(err,
+               _("malformed property list in transaction '%s'"),
+               path_txn_props(fs, txn_id, pool));
+    }
 
   return svn_stream_close(stream);
 }
@@ -1963,9 +1972,7 @@ choose_delta_base(representation_t **rep
 
       /* Very short rep bases are simply not worth it as we are unlikely
        * to re-coup the deltification space overhead of 20+ bytes. */
-      svn_filesize_t rep_size = (*rep)->expanded_size
-                              ? (*rep)->expanded_size
-                              : (*rep)->size;
+      svn_filesize_t rep_size = (*rep)->expanded_size;
       if (rep_size < 64)
         {
           *rep = NULL;
@@ -2118,7 +2125,7 @@ rep_write_get_baton(struct rep_write_bat
 }
 
 /* For REP->SHA1_CHECKSUM, try to find an already existing representation
-   in FS and return it in *OUT_REP.  If no such representation exists or
+   in FS and return it in *OLD_REP.  If no such representation exists or
    if rep sharing has been disabled for FS, NULL will be returned.  Since
    there may be new duplicate representations within the same uncommitted
    revision, those can be passed in REPS_HASH (maps a sha1 digest onto
@@ -2144,7 +2151,7 @@ get_shared_rep(representation_t **old_re
 
   /* Check and see if we already have a representation somewhere that's
      identical to the one we just wrote out.  Start with the hash lookup
-     because it is cheepest. */
+     because it is cheapest. */
   if (reps_hash)
     *old_rep = apr_hash_get(reps_hash,
                             rep->sha1_digest,
@@ -2213,12 +2220,37 @@ get_shared_rep(representation_t **old_re
   if (!*old_rep)
     return SVN_NO_ERROR;
 
-  /* We don't want 0-length PLAIN representations to replace non-0-length
-     ones (see issue #4554).  Also, this doubles as a simple guard against
-     general rep-cache induced corruption. */
-  if (   ((*old_rep)->expanded_size != rep->expanded_size)
-      || ((*old_rep)->size != rep->size))
+  /* A simple guard against general rep-cache induced corruption. */
+  if ((*old_rep)->expanded_size != rep->expanded_size)
     {
+      /* Make the problem show up in the server log.
+
+         Because not sharing reps is always a save option,
+         terminating the request would be inappropriate.
+       */
+      svn_checksum_t checksum;
+      checksum.digest = rep->sha1_digest;
+      checksum.kind = svn_checksum_sha1;
+
+      err = svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
+                              "Rep size %s mismatches rep-cache.db value %s "
+                              "for SHA1 %s.\n"
+                              "You should delete the rep-cache.db and "
+                              "verify the repository. The cached rep will "
+                              "not be shared.",
+                              apr_psprintf(scratch_pool,
+                                           "%" SVN_FILESIZE_T_FMT,
+                                           rep->expanded_size),
+                              apr_psprintf(scratch_pool,
+                                           "%" SVN_FILESIZE_T_FMT,
+                                           (*old_rep)->expanded_size),
+                              svn_checksum_to_cstring_display(&checksum,
+                                                              scratch_pool));
+
+      (fs->warning)(fs->warning_baton, err);
+      svn_error_clear(err);
+
+      /* Ignore the shared rep. */
       *old_rep = NULL;
     }
   else
@@ -2553,6 +2585,7 @@ write_container_rep(representation_t *re
 
   /* Check and see if we already have a representation somewhere that's
      identical to the one we just wrote out. */
+  rep->expanded_size = whb->size;
   SVN_ERR(get_shared_rep(&old_rep, fs, rep, reps_hash, scratch_pool,
                          scratch_pool));
 
@@ -2588,7 +2621,6 @@ write_container_rep(representation_t *re
 
       /* update the representation */
       rep->size = whb->size;
-      rep->expanded_size = whb->size;
     }
 
   return SVN_NO_ERROR;
@@ -2692,6 +2724,7 @@ write_container_delta_rep(representation
 
   /* Check and see if we already have a representation somewhere that's
      identical to the one we just wrote out. */
+  rep->expanded_size = whb->size;
   SVN_ERR(get_shared_rep(&old_rep, fs, rep, reps_hash, scratch_pool,
                          scratch_pool));
 
@@ -2727,7 +2760,6 @@ write_container_delta_rep(representation
       SVN_ERR(store_p2l_index_entry(fs, &rep->txn_id, &entry, scratch_pool));
 
       /* update the representation */
-      rep->expanded_size = whb->size;
       rep->size = rep_end - delta_start;
     }
 

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/tree.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_fs/tree.c Wed May 13 04:51:26 2015
@@ -1357,7 +1357,7 @@ fs_node_relation(svn_fs_node_relation_t
       *relation = (   (root_a->rev == root_b->rev)
                    && (root_a->is_txn_root == root_b->is_txn_root)
                    && !different_txn)
-                ? svn_fs_node_same
+                ? svn_fs_node_unchanged
                 : svn_fs_node_common_ancestor;
       return SVN_NO_ERROR;
     }
@@ -1391,7 +1391,7 @@ fs_node_relation(svn_fs_node_relation_t
 
   /* The noderevs are actually related.  Are they the same? */
   if (svn_fs_fs__id_eq(id_a, id_b))
-    *relation = svn_fs_node_same;
+    *relation = svn_fs_node_unchanged;
   else
     *relation = svn_fs_node_common_ancestor;
 
@@ -1515,6 +1515,19 @@ fs_node_proplist(apr_hash_t **table_p,
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+fs_node_has_props(svn_boolean_t *has_props,
+                  svn_fs_root_t *root,
+                  const char *path,
+                  apr_pool_t *scratch_pool)
+{
+  dag_node_t *node;
+
+  SVN_ERR(get_dag(&node, root, path, scratch_pool));
+
+  return svn_error_trace(svn_fs_fs__dag_has_props(has_props, node,
+                                                  scratch_pool));
+}
 
 static svn_error_t *
 increment_mergeinfo_up_tree(parent_path_t *pp,
@@ -2392,9 +2405,11 @@ static svn_error_t *
 fs_dir_optimal_order(apr_array_header_t **ordered_p,
                      svn_fs_root_t *root,
                      apr_hash_t *entries,
-                     apr_pool_t *pool)
+                     apr_pool_t *result_pool,
+                     apr_pool_t *scratch_pool)
 {
-  *ordered_p = svn_fs_fs__order_dir_entries(root->fs, entries, pool);
+  *ordered_p = svn_fs_fs__order_dir_entries(root->fs, entries, result_pool,
+                                            scratch_pool);
 
   return SVN_NO_ERROR;
 }
@@ -4236,6 +4251,7 @@ static root_vtable_t root_vtable = {
   fs_closest_copy,
   fs_node_prop,
   fs_node_proplist,
+  fs_node_has_props,
   fs_change_node_prop,
   fs_props_changed,
   fs_dir_entries,

Propchange: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 13 04:51:26 2015
@@ -90,4 +90,4 @@
 /subversion/branches/verify-keep-going/subversion/libsvn_fs_x:1439280-1492639,1546002-1546110
 /subversion/branches/wc-collate-path/subversion/libsvn_fs_x:1402685-1480384
 /subversion/trunk/subversion/libsvn_fs_fs:1415133-1596500,1596567,1597414,1597989,1598273,1599140,1600872,1601633,1603485-1603487,1603499,1603605,1604128,1604188,1604413-1604414,1604416-1604417,1604421,1604442,1604700,1604717,1604720,1604726,1604755,1604794,1604802,1604824,1604836,1604844,1604902-1604903,1604911,1604925,1604933,1604947,1605059-1605060,1605064-1605065,1605068,1605071-1605073,1605075,1605123,1605188-1605189,1605191,1605197,1605444,1605633,1606132,1606142,1606144,1606514,1606526,1606528,1606551,1606554,1606564,1606598-1606599,1606656,1606658,1606662,1606744,1606840,1607085,1607572,1612407,1612810,1613339,1613872,1614611,1615348,1615351-1615352,1615356,1616338-1616339,1616613,1617586,1617688,1618138,1618151,1618153,1618226,1618641,1618653,1618662,1619068,1619358,1619413,1619769,1619774,1620602,1620909,1620912,1620928,1620930,1621275,1621635,1622931,1622937,1622942,1622946,1622959-1622960,1622963,1622987,1623007,1623368,1623373,1623377,1623379,1623381,1623398,1623402,162
 4011,1624265,1624512,1626246,1626871,1626873,1626886,1627497-1627498,1627502,1627947-1627949,1627966,1628083,1628093,1628158-1628159,1628161,1628392-1628393,1628415,1628427,1628676,1628738,1628762,1628764,1629854-1629855,1629857,1629865,1629873,1629875,1629879,1630067,1630070,1631049-1631051,1631075,1631115,1631171,1631180,1631185-1631186,1631196-1631197,1631239-1631240,1631548,1631550,1631563,1631567,1631588,1631598,1632646,1632776,1632849,1632851-1632853,1632856-1632857,1632868,1632908,1632926,1633232,1633617-1633618,1634872,1634875,1634879-1634880,1634920,1636478,1636483,1636629,1636644,1637184,1637186,1637330,1637358,1637363,1637393,1639319,1639322,1639335,1639348,1639352,1639355,1639358,1639414,1639419,1639426,1639430,1639436,1639440,1639549,1640061-1640062,1640197,1640915,1640966,1641013,1643139,1643233,1645567,1646021,1646712,1646716,1647537,1647540-1647541,1647820,1647905,1648230,1648238,1648241-1648243,1648253,1648272,1648532,1648537-1648539,1648542,1648591,1648612,1653608,
 1658482
-/subversion/trunk/subversion/libsvn_fs_x:1414756-1509914
+/subversion/trunk/subversion/libsvn_fs_x:1414756-1509914,1669166-1679101

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/fs.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/fs.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/fs.c Wed May 13 04:51:26 2015
@@ -27,7 +27,6 @@
 #include <apr_general.h>
 #include <apr_pools.h>
 #include <apr_file_io.h>
-#include <apr_thread_mutex.h>
 
 #include "svn_fs.h"
 #include "svn_delta.h"

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/fs_id.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/fs_id.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/fs_id.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/fs_id.c Wed May 13 04:51:26 2015
@@ -217,7 +217,7 @@ id_compare(const svn_fs_id_t *a,
 
   /* Quick check: same IDs? */
   if (svn_fs_x__id_eq(&id_a->noderev_id, &id_b->noderev_id))
-    return svn_fs_node_same;
+    return svn_fs_node_unchanged;
 
   /* Fetch the nodesrevs, compare the IDs of the nodes they belong to and
      clean up any temporaries.  If we can't find one of the noderevs, don't

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/lock.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/lock.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/lock.c Wed May 13 04:51:26 2015
@@ -1239,6 +1239,7 @@ svn_fs_x__lock(svn_fs_t *fs,
   apr_array_header_t *sorted_targets;
   apr_hash_t *canonical_targets = apr_hash_make(scratch_pool);
   apr_hash_index_t *hi;
+  apr_pool_t *iterpool;
   svn_error_t *err, *cb_err = SVN_NO_ERROR;
   int i;
 
@@ -1277,11 +1278,13 @@ svn_fs_x__lock(svn_fs_t *fs,
   lb.steal_lock = steal_lock;
   lb.result_pool = result_pool;
 
-  err = svn_fs_x__with_write_lock(fs, lock_body, &lb, scratch_pool);
+  iterpool = svn_pool_create(scratch_pool);
+  err = svn_fs_x__with_write_lock(fs, lock_body, &lb, iterpool);
   for (i = 0; i < lb.infos->nelts; ++i)
     {
       struct lock_info_t *info = &APR_ARRAY_IDX(lb.infos, i,
                                                 struct lock_info_t);
+      svn_pool_clear(iterpool);
       if (!cb_err && lock_callback)
         {
           if (!info->lock && !info->fs_err)
@@ -1290,10 +1293,11 @@ svn_fs_x__lock(svn_fs_t *fs,
                                              info->path);
 
           cb_err = lock_callback(lock_baton, info->path, info->lock,
-                                 info->fs_err, scratch_pool);
+                                 info->fs_err, iterpool);
         }
       svn_error_clear(info->fs_err);
     }
+  svn_pool_destroy(iterpool);
 
   if (err && cb_err)
     svn_error_compose(err, cb_err);
@@ -1333,6 +1337,7 @@ svn_fs_x__unlock(svn_fs_t *fs,
   apr_array_header_t *sorted_targets;
   apr_hash_t *canonical_targets = apr_hash_make(scratch_pool);
   apr_hash_index_t *hi;
+  apr_pool_t *iterpool;
   svn_error_t *err, *cb_err = SVN_NO_ERROR;
   int i;
 
@@ -1365,10 +1370,12 @@ svn_fs_x__unlock(svn_fs_t *fs,
   ub.break_lock = break_lock;
   ub.result_pool = result_pool;
 
-  err = svn_fs_x__with_write_lock(fs, unlock_body, &ub, scratch_pool);
+  iterpool = svn_pool_create(scratch_pool);
+  err = svn_fs_x__with_write_lock(fs, unlock_body, &ub, iterpool);
   for (i = 0; i < ub.infos->nelts; ++i)
     {
       unlock_info_t *info = &APR_ARRAY_IDX(ub.infos, i, unlock_info_t);
+      svn_pool_clear(iterpool);
       if (!cb_err && lock_callback)
         {
           if (!info->done && !info->fs_err)
@@ -1376,10 +1383,11 @@ svn_fs_x__unlock(svn_fs_t *fs,
                                              0, _("Failed to unlock '%s'"),
                                              info->path);
           cb_err = lock_callback(lock_baton, info->path, NULL, info->fs_err,
-                                 scratch_pool);
+                                 iterpool);
         }
       svn_error_clear(info->fs_err);
     }
+  svn_pool_destroy(iterpool);
 
   if (err && cb_err)
     svn_error_compose(err, cb_err);

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/pack.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/pack.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/pack.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/pack.c Wed May 13 04:51:26 2015
@@ -625,13 +625,14 @@ compare_dir_entries(const svn_sort__item
 apr_array_header_t *
 svn_fs_x__order_dir_entries(svn_fs_t *fs,
                             apr_hash_t *directory,
-                            apr_pool_t *pool)
+                            apr_pool_t *result_pool,
+                            apr_pool_t *scratch_pool)
 {
   apr_array_header_t *ordered
-    = svn_sort__hash(directory, compare_dir_entries, pool);
+    = svn_sort__hash(directory, compare_dir_entries, scratch_pool);
 
   apr_array_header_t *result
-    = apr_array_make(pool, ordered->nelts, sizeof(svn_fs_dirent_t *));
+    = apr_array_make(result_pool, ordered->nelts, sizeof(svn_fs_dirent_t *));
 
   int i;
   for (i = 0; i < ordered->nelts; ++i)

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/pack.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/pack.h?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/pack.h (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/pack.h Wed May 13 04:51:26 2015
@@ -51,13 +51,15 @@ svn_fs_x__get_packed_offset(apr_off_t *r
                             apr_pool_t *scratch_pool);
 
 /* Return the svn_dir_entry_t* objects of DIRECTORY in an APR array
- * allocated in POOL with entries added in storage (on-disk) order.
- * FS format will be used to pick the optimal ordering strategy.
+ * allocated in RESULT_POOL with entries added in storage (on-disk) order.
+ * FS' format will be used to pick the optimal ordering strategy.  Use
+ * SCRATCH_POOL for temporary allocations.
  */
 apr_array_header_t *
 svn_fs_x__order_dir_entries(svn_fs_t *fs,
                             apr_hash_t *directory,
-                            apr_pool_t *pool);
+                            apr_pool_t *result_pool,
+                            apr_pool_t *scratch_pool);
 
 
 #endif

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/tree.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_fs_x/tree.c Wed May 13 04:51:26 2015
@@ -1354,7 +1354,7 @@ x_node_relation(svn_fs_node_relation_t *
       *relation = (   (root_a->rev == root_b->rev)
                    && (root_a->is_txn_root == root_b->is_txn_root)
                    && !different_txn)
-                ? svn_fs_node_same
+                ? svn_fs_node_unchanged
                 : svn_fs_node_common_ancestor;
       return SVN_NO_ERROR;
     }
@@ -1372,7 +1372,7 @@ x_node_relation(svn_fs_node_relation_t *
   /* In FSX, even in-txn IDs are globally unique.
    * So, we can simply compare them. */
   if (svn_fs_x__id_eq(&noderev_id_a, &noderev_id_b))
-    *relation = svn_fs_node_same;
+    *relation = svn_fs_node_unchanged;
   else if (svn_fs_x__id_eq(&node_id_a, &node_id_b))
     *relation = svn_fs_node_common_ancestor;
   else
@@ -1500,6 +1500,20 @@ x_node_proplist(apr_hash_t **table_p,
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+x_node_has_props(svn_boolean_t *has_props,
+                 svn_fs_root_t *root,
+                 const char *path,
+                 apr_pool_t *scratch_pool)
+{
+  apr_hash_t *props;
+
+  SVN_ERR(x_node_proplist(&props, root, path, scratch_pool));
+
+  *has_props = (0 < apr_hash_count(props));
+
+  return SVN_NO_ERROR;
+}
 
 static svn_error_t *
 increment_mergeinfo_up_tree(parent_path_t *pp,
@@ -2411,9 +2425,11 @@ static svn_error_t *
 x_dir_optimal_order(apr_array_header_t **ordered_p,
                     svn_fs_root_t *root,
                     apr_hash_t *entries,
-                    apr_pool_t *pool)
+                    apr_pool_t *result_pool,
+                    apr_pool_t *scratch_pool)
 {
-  *ordered_p = svn_fs_x__order_dir_entries(root->fs, entries, pool);
+  *ordered_p = svn_fs_x__order_dir_entries(root->fs, entries, result_pool,
+                                           scratch_pool);
 
   return SVN_NO_ERROR;
 }
@@ -4206,6 +4222,7 @@ static root_vtable_t root_vtable = {
   x_closest_copy,
   x_node_prop,
   x_node_proplist,
+  x_node_has_props,
   x_change_node_prop,
   x_props_changed,
   x_dir_entries,

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_ra/ra_loader.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_ra/ra_loader.c Wed May 13 04:51:26 2015
@@ -143,7 +143,7 @@ load_ra_module(svn_ra__init_func_t *func
     const char *compat_funcname;
     apr_status_t status;
 
-    libname = apr_psprintf(pool, "libsvn_ra_%s-%d.so.%d",
+    libname = apr_psprintf(pool, "libsvn_ra_%s-" SVN_DSO_SUFFIX_FMT,
                            ra_name, SVN_VER_MAJOR, SVN_SOVERSION);
     funcname = apr_psprintf(pool, "svn_ra_%s__init", ra_name);
     compat_funcname = apr_psprintf(pool, "svn_ra_%s_init", ra_name);

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_ra_local/ra_plugin.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_ra_local/ra_plugin.c Wed May 13 04:51:26 2015
@@ -41,6 +41,7 @@
 #include "private/svn_repos_private.h"
 #include "private/svn_fspath.h"
 #include "private/svn_atomic.h"
+#include "private/svn_subr_private.h"
 
 #define APR_WANT_STRFUNC
 #include <apr_want.h>
@@ -1309,7 +1310,6 @@ svn_ra_local__get_dir(svn_ra_session_t *
   apr_hash_t *entries;
   apr_hash_index_t *hi;
   svn_ra_local__session_baton_t *sess = session->priv;
-  apr_pool_t *subpool;
   const char *abs_path = svn_fspath__join(sess->fs_path->data, path, pool);
 
   /* Open the revision's root. */
@@ -1325,29 +1325,28 @@ svn_ra_local__get_dir(svn_ra_session_t *
 
   if (dirents)
     {
+      apr_pool_t *iterpool = svn_pool_create(pool);
       /* Get the dir's entries. */
       SVN_ERR(svn_fs_dir_entries(&entries, root, abs_path, pool));
 
       /* Loop over the fs dirents, and build a hash of general
          svn_dirent_t's. */
       *dirents = apr_hash_make(pool);
-      subpool = svn_pool_create(pool);
       for (hi = apr_hash_first(pool, entries); hi; hi = apr_hash_next(hi))
         {
           const void *key;
           void *val;
-          apr_hash_t *prophash;
           const char *datestring, *entryname, *fullpath;
           svn_fs_dirent_t *fs_entry;
           svn_dirent_t *entry = svn_dirent_create(pool);
 
-          svn_pool_clear(subpool);
+          svn_pool_clear(iterpool);
 
           apr_hash_this(hi, &key, NULL, &val);
           entryname = (const char *) key;
           fs_entry = (svn_fs_dirent_t *) val;
 
-          fullpath = svn_dirent_join(abs_path, entryname, subpool);
+          fullpath = svn_dirent_join(abs_path, entryname, iterpool);
 
           if (dirent_fields & SVN_DIRENT_KIND)
             {
@@ -1362,15 +1361,15 @@ svn_ra_local__get_dir(svn_ra_session_t *
                 entry->size = 0;
               else
                 SVN_ERR(svn_fs_file_length(&(entry->size), root,
-                                           fullpath, subpool));
+                                           fullpath, iterpool));
             }
 
           if (dirent_fields & SVN_DIRENT_HAS_PROPS)
             {
               /* has_props? */
-              SVN_ERR(svn_fs_node_proplist(&prophash, root, fullpath,
-                                           subpool));
-              entry->has_props = (apr_hash_count(prophash) != 0);
+              SVN_ERR(svn_fs_node_has_props(&entry->has_props,
+                                            root, fullpath,
+                                            iterpool));
             }
 
           if ((dirent_fields & SVN_DIRENT_TIME)
@@ -1381,7 +1380,7 @@ svn_ra_local__get_dir(svn_ra_session_t *
               SVN_ERR(svn_repos_get_committed_info(&(entry->created_rev),
                                                    &datestring,
                                                    &(entry->last_author),
-                                                   root, fullpath, subpool));
+                                                   root, fullpath, iterpool));
               if (datestring)
                 SVN_ERR(svn_time_from_cstring(&(entry->time), datestring,
                                               pool));
@@ -1392,7 +1391,7 @@ svn_ra_local__get_dir(svn_ra_session_t *
           /* Store. */
           svn_hash_sets(*dirents, entryname, entry);
         }
-      svn_pool_destroy(subpool);
+      svn_pool_destroy(iterpool);
     }
 
   /* Handle props if requested. */
@@ -1870,8 +1869,8 @@ svn_ra_local__init(const svn_version_t *
   SVN_ERR(svn_ver_check_list2(ra_local_version(), checklist, svn_ver_equal));
 
 #ifndef SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL
-  /* This assumes that POOL was the pool used to load the dso. */
-  SVN_ERR(svn_fs_initialize(pool));
+  /* This means the library was loaded as a DSO, so use the DSO pool. */
+  SVN_ERR(svn_fs_initialize(svn_dso__pool()));
 #endif
 
   *vtable = &ra_local_vtable;

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_ra_serf/serf.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_ra_serf/serf.c Wed May 13 04:51:26 2015
@@ -336,7 +336,7 @@ load_config(svn_ra_serf__session_t *sess
                                                  (apr_uint32_t)log_components,
                                                  SERF_LOG_DEFAULT_LAYOUT,
                                                  stderr,
-                                                 pool);
+                                                 result_pool);
 
       if (!status)
           serf_logging_add_output(session->context, output);

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_ra_serf/stat.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_ra_serf/stat.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_ra_serf/stat.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_ra_serf/stat.c Wed May 13 04:51:26 2015
@@ -193,6 +193,9 @@ fill_dirent_propfunc(void *baton,
         {
           if (*val->data)
             {
+              /* Note: 1.8.x and earlier servers send the count proper; 1.9.0
+               * and newer send "1" if there are properties and "0" otherwise.
+               */
               apr_int64_t deadprop_count;
               SVN_ERR(svn_cstring_atoi64(&deadprop_count, val->data));
               fdb->entry->has_props = deadprop_count > 0;

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_ra_serf/util.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_ra_serf/util.c Wed May 13 04:51:26 2015
@@ -1107,7 +1107,9 @@ svn_ra_serf__expect_empty_body(serf_requ
 
   hdrs = serf_bucket_response_get_headers(response);
   val = serf_bucket_headers_get(hdrs, "Content-Type");
-  if (val && strncasecmp(val, "text/xml", sizeof("text/xml") - 1) == 0)
+  if (val
+      && (handler->sline.code < 200 || handler->sline.code >= 300)
+      && strncasecmp(val, "text/xml", sizeof("text/xml") - 1) == 0)
     {
       svn_ra_serf__server_error_t *server_err;
 
@@ -1120,7 +1122,7 @@ svn_ra_serf__expect_empty_body(serf_requ
     }
   else
     {
-      /* The body was not text/xml, so we don't know what to do with it.
+      /* The body was not text/xml, or we got a success code.
          Toss anything that arrives.  */
       handler->discard_body = TRUE;
     }

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_repos/delta.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_repos/delta.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_repos/delta.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_repos/delta.c Wed May 13 04:51:26 2015
@@ -321,7 +321,7 @@ svn_repos_dir_delta2(svn_fs_root_t *src_
   SVN_ERR(svn_fs_node_relation(&relation, tgt_root, tgt_fullpath,
                                src_root, src_fullpath, pool));
 
-  if (relation == svn_fs_node_same)
+  if (relation == svn_fs_node_unchanged)
     {
       /* They are the same node!  No-op (you gotta love those). */
       goto cleanup;

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_repos/reporter.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_repos/reporter.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_repos/reporter.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_repos/reporter.c Wed May 13 04:51:26 2015
@@ -1282,7 +1282,7 @@ delta_dirs(report_baton_t *b, svn_revnum
 
       /* Loop over the dirents in the target. */
       SVN_ERR(svn_fs_dir_optimal_order(&t_ordered_entries, b->t_root,
-                                       t_entries, subpool));
+                                       t_entries, subpool, iterpool));
       for (i = 0; i < t_ordered_entries->nelts; ++i)
         {
           const svn_fs_dirent_t *t_entry

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_repos/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_repos/repos.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_repos/repos.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_repos/repos.c Wed May 13 04:51:26 2015
@@ -2067,7 +2067,6 @@ svn_repos_stat(svn_dirent_t **dirent,
   svn_node_kind_t kind;
   svn_dirent_t *ent;
   const char *datestring;
-  apr_hash_t *prophash;
 
   SVN_ERR(svn_fs_check_path(&kind, root, path, pool));
 
@@ -2083,9 +2082,7 @@ svn_repos_stat(svn_dirent_t **dirent,
   if (kind == svn_node_file)
     SVN_ERR(svn_fs_file_length(&(ent->size), root, path, pool));
 
-  SVN_ERR(svn_fs_node_proplist(&prophash, root, path, pool));
-  if (apr_hash_count(prophash) > 0)
-    ent->has_props = TRUE;
+  SVN_ERR(svn_fs_node_has_props(&ent->has_props, root, path, pool));
 
   SVN_ERR(svn_repos_get_committed_info(&(ent->created_rev),
                                        &datestring,

Propchange: subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed May 13 04:51:26 2015
@@ -12,3 +12,4 @@ internal_statements.h
 errorcode.inc
 libsvn_subr.pc.in
 libsvn_subr.pc
+config_keys.inc

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-inprocess.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-inprocess.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-inprocess.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-inprocess.c Wed May 13 04:51:26 2015
@@ -23,8 +23,6 @@
 
 #include <assert.h>
 
-#include <apr_thread_mutex.h>
-
 #include "svn_pools.h"
 
 #include "svn_private_config.h"

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-membuffer.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-membuffer.c Wed May 13 04:51:26 2015
@@ -2790,11 +2790,6 @@ typedef struct svn_membuffer_cache_t
   svn_mutex__t *mutex;
 } svn_membuffer_cache_t;
 
-/* After an estimated ALLOCATIONS_PER_POOL_CLEAR allocations, we should
- * clear the svn_membuffer_cache_t.pool to keep memory consumption in check.
- */
-#define ALLOCATIONS_PER_POOL_CLEAR 10
-
 /* Basically calculate a hash value for KEY of length KEY_LEN, combine it
  * with the CACHE->PREFIX and write the result in CACHE->COMBINED_KEY.
  * This could replace combine_key() entirely but we actually use it only

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/checksum.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/checksum.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/checksum.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/checksum.c Wed May 13 04:51:26 2015
@@ -80,6 +80,14 @@ static const apr_size_t digest_sizes[] =
   sizeof(apr_uint32_t)
 };
 
+/* Checksum type prefixes used in serialized checksums. */
+static const char *ckind_str[] = {
+  "$md5 $",
+  "$sha1$",
+  "$fnv1$",
+  "$fnvm$",
+};
+
 /* Returns the digest size of it's argument. */
 #define DIGESTSIZE(k) \
   (((k) < svn_checksum_md5 || (k) > svn_checksum_fnv1a_32x4) ? 0 : digest_sizes[k])
@@ -317,13 +325,10 @@ svn_checksum_serialize(const svn_checksu
                        apr_pool_t *result_pool,
                        apr_pool_t *scratch_pool)
 {
-  const char *ckind_str;
-
   SVN_ERR_ASSERT_NO_RETURN(checksum->kind >= svn_checksum_md5
                            || checksum->kind <= svn_checksum_fnv1a_32x4);
-  ckind_str = (checksum->kind == svn_checksum_md5 ? "$md5 $" : "$sha1$");
   return apr_pstrcat(result_pool,
-                     ckind_str,
+                     ckind_str[checksum->kind],
                      svn_checksum_to_cstring(checksum, scratch_pool),
                      SVN_VA_NULL);
 }
@@ -335,18 +340,29 @@ svn_checksum_deserialize(const svn_check
                          apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool)
 {
-  svn_checksum_kind_t ckind;
+  svn_checksum_kind_t kind;
   svn_checksum_t *parsed_checksum;
 
-  /* "$md5 $..." or "$sha1$..." */
-  SVN_ERR_ASSERT(strlen(data) > 6);
+  /* All prefixes have the same length. */
+  apr_size_t prefix_len = strlen(ckind_str[0]);
 
-  ckind = (data[1] == 'm' ? svn_checksum_md5 : svn_checksum_sha1);
-  SVN_ERR(svn_checksum_parse_hex(&parsed_checksum, ckind,
-                                 data + 6, result_pool));
-  *checksum = parsed_checksum;
+  /* "$md5 $...", "$sha1$..." or ... */
+  if (strlen(data) <= prefix_len)
+    return svn_error_createf(SVN_ERR_BAD_CHECKSUM_PARSE, NULL,
+                             _("Invalid prefix in checksum '%s'"),
+                             data);
+
+  for (kind = svn_checksum_md5; kind <= svn_checksum_fnv1a_32x4; ++kind)
+    if (strncmp(ckind_str[kind], data, prefix_len) == 0)
+      {
+        SVN_ERR(svn_checksum_parse_hex(&parsed_checksum, kind,
+                                       data + prefix_len, result_pool));
+        *checksum = parsed_checksum;
+        return SVN_NO_ERROR;
+      }
 
-  return SVN_NO_ERROR;
+  return svn_error_createf(SVN_ERR_BAD_CHECKSUM_KIND, NULL,
+                           "Unknown checksum kind in '%s'", data);
 }
 
 

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cmdline.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cmdline.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cmdline.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cmdline.c Wed May 13 04:51:26 2015
@@ -538,19 +538,20 @@ trust_server_cert_non_interactive(svn_au
                                   apr_pool_t *pool)
 {
   struct trust_server_cert_non_interactive_baton *b = baton;
+  apr_uint32_t non_ignored_failures;
   *cred_p = NULL;
 
-  if (failures == 0 ||
-      (b->trust_server_cert_unknown_ca &&
-       (failures & SVN_AUTH_SSL_UNKNOWNCA)) ||
-      (b->trust_server_cert_cn_mismatch &&
-       (failures & SVN_AUTH_SSL_CNMISMATCH)) ||
-      (b->trust_server_cert_expired &&
-       (failures & SVN_AUTH_SSL_EXPIRED)) ||
-      (b->trust_server_cert_not_yet_valid &&
-        (failures & SVN_AUTH_SSL_NOTYETVALID)) ||
-      (b->trust_server_cert_other_failure &&
-        (failures & SVN_AUTH_SSL_OTHER)))
+  /* Mask away bits we are instructed to ignore. */
+  non_ignored_failures = failures & ~(
+        (b->trust_server_cert_unknown_ca ? SVN_AUTH_SSL_UNKNOWNCA : 0)
+      | (b->trust_server_cert_cn_mismatch ? SVN_AUTH_SSL_CNMISMATCH : 0)
+      | (b->trust_server_cert_expired ? SVN_AUTH_SSL_EXPIRED : 0)
+      | (b->trust_server_cert_not_yet_valid ? SVN_AUTH_SSL_NOTYETVALID : 0)
+      | (b->trust_server_cert_other_failure ? SVN_AUTH_SSL_OTHER : 0)
+  );
+
+  /* If no failures remain, accept the certificate. */
+  if (non_ignored_failures == 0)
     {
       *cred_p = apr_pcalloc(pool, sizeof(**cred_p));
       (*cred_p)->may_save = FALSE;
@@ -810,9 +811,124 @@ svn_cmdline__print_xml_prop(svn_stringbu
   return;
 }
 
+/* Return the most similar string to NEEDLE in HAYSTACK, which contains
+ * HAYSTACK_LEN elements.  Return NULL if no string is sufficiently similar.
+ */
+/* See svn_cl__similarity_check() for a more general solution. */
+static const char *
+most_similar(const char *needle_cstr,
+             const char **haystack,
+             apr_size_t haystack_len,
+             apr_pool_t *scratch_pool)
+{
+  const char *max_similar;
+  apr_size_t max_score = 0;
+  apr_size_t i;
+  svn_membuf_t membuf;
+  svn_string_t *needle_str = svn_string_create(needle_cstr, scratch_pool);
+
+  svn_membuf__create(&membuf, 64, scratch_pool);
+
+  for (i = 0; i < haystack_len; i++)
+    {
+      apr_size_t score;
+      svn_string_t *hay = svn_string_create(haystack[i], scratch_pool);
+
+      score = svn_string__similarity(needle_str, hay, &membuf, NULL);
+
+      /* If you update this factor, consider updating
+       * svn_cl__similarity_check(). */
+      if (score >= (2 * SVN_STRING__SIM_RANGE_MAX + 1) / 3
+          && score > max_score)
+        {
+          max_score = score;
+          max_similar = haystack[i];
+        }
+    }
+
+  if (max_score)
+    return max_similar;
+  else
+    return NULL;
+}
+
+/* Verify that NEEDLE is in HAYSTACK, which contains HAYSTACK_LEN elements. */
+static svn_error_t *
+string_in_array(const char *needle,
+                const char **haystack,
+                apr_size_t haystack_len,
+                apr_pool_t *scratch_pool)
+{
+  const char *next_of_kin;
+  apr_size_t i;
+  for (i = 0; i < haystack_len; i++)
+    {
+      if (!strcmp(needle, haystack[i]))
+        return SVN_NO_ERROR;
+    }
+
+  /* Error. */
+  next_of_kin = most_similar(needle, haystack, haystack_len, scratch_pool);
+  if (next_of_kin)
+    return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                             _("Ignoring unknown value '%s'; "
+                               "did you mean '%s'?"),
+                             needle, next_of_kin);
+  else
+    return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                             _("Ignoring unknown value '%s'"),
+                             needle);
+}
+
+#include "config_keys.inc"
+
+/* Validate the FILE, SECTION, and OPTION components of CONFIG_OPTION are
+ * known.  Return an error if not.  (An unknown value may be either a typo
+ * or added in a newer minor version of Subversion.) */
+static svn_error_t *
+validate_config_option(svn_cmdline__config_argument_t *config_option,
+                       apr_pool_t *scratch_pool)
+{
+  svn_boolean_t arbitrary_keys = FALSE;
+
+  /* TODO: some day, we could also verify that OPTION is valid for SECTION;
+     i.e., forbid invalid combinations such as config:auth:diff-extensions. */
+
+#define ARRAYLEN(x) ( sizeof((x)) / sizeof((x)[0]) )
+
+  SVN_ERR(string_in_array(config_option->file, svn__valid_config_files,
+                          ARRAYLEN(svn__valid_config_files),
+                          scratch_pool));
+  SVN_ERR(string_in_array(config_option->section, svn__valid_config_sections,
+                          ARRAYLEN(svn__valid_config_sections),
+                          scratch_pool));
+
+  /* Don't validate option names for sections such as servers[group],
+   * config[tunnels], and config[auto-props] that permit arbitrary options. */
+    {
+      int i;
+
+      for (i = 0; i < ARRAYLEN(svn__empty_config_sections); i++)
+        {
+        if (!strcmp(config_option->section, svn__empty_config_sections[i]))
+          arbitrary_keys = TRUE;
+        }
+    }
+
+  if (! arbitrary_keys)
+    SVN_ERR(string_in_array(config_option->option, svn__valid_config_options,
+                            ARRAYLEN(svn__valid_config_options),
+                            scratch_pool));
+
+#undef ARRAYLEN
+
+  return SVN_NO_ERROR;
+}
+
 svn_error_t *
 svn_cmdline__parse_config_option(apr_array_header_t *config_options,
                                  const char *opt_arg,
+                                 const char *prefix,
                                  apr_pool_t *pool)
 {
   svn_cmdline__config_argument_t *config_option;
@@ -826,6 +942,8 @@ svn_cmdline__parse_config_option(apr_arr
           if ((equals_sign = strchr(second_colon + 1, '=')) &&
               (equals_sign != second_colon + 1))
             {
+              svn_error_t *warning;
+
               config_option = apr_pcalloc(pool, sizeof(*config_option));
               config_option->file = apr_pstrndup(pool, opt_arg,
                                                  first_colon - opt_arg);
@@ -834,6 +952,13 @@ svn_cmdline__parse_config_option(apr_arr
               config_option->option = apr_pstrndup(pool, second_colon + 1,
                                                    equals_sign - second_colon - 1);
 
+              warning = validate_config_option(config_option, pool);
+              if (warning)
+                {
+                  svn_handle_warning2(stderr, warning, prefix);
+                  svn_error_clear(warning);
+                }
+
               if (! (strchr(config_option->option, ':')))
                 {
                   config_option->value = apr_pstrndup(pool, equals_sign + 1,
@@ -1404,3 +1529,50 @@ svn_cmdline__edit_string_externally(svn_
 
   return svn_error_trace(err);
 }
+
+svn_error_t *
+svn_cmdline__parse_trust_options(
+                        svn_boolean_t *trust_server_cert_unknown_ca,
+                        svn_boolean_t *trust_server_cert_cn_mismatch,
+                        svn_boolean_t *trust_server_cert_expired,
+                        svn_boolean_t *trust_server_cert_not_yet_valid,
+                        svn_boolean_t *trust_server_cert_other_failure,
+                        const char *opt_arg,
+                        apr_pool_t *scratch_pool)
+{
+  apr_array_header_t *failures;
+  int i;
+
+  *trust_server_cert_unknown_ca = FALSE;
+  *trust_server_cert_cn_mismatch = FALSE;
+  *trust_server_cert_expired = FALSE;
+  *trust_server_cert_not_yet_valid = FALSE;
+  *trust_server_cert_other_failure = FALSE;
+
+  failures = svn_cstring_split(opt_arg, ", \n\r\t\v", TRUE, scratch_pool);
+
+  for (i = 0; i < failures->nelts; i++)
+    {
+      const char *value = APR_ARRAY_IDX(failures, i, const char *);
+      if (!strcmp(value, "unknown-ca"))
+        *trust_server_cert_unknown_ca = TRUE;
+      else if (!strcmp(value, "cn-mismatch"))
+        *trust_server_cert_cn_mismatch = TRUE;
+      else if (!strcmp(value, "expired"))
+        *trust_server_cert_expired = TRUE;
+      else if (!strcmp(value, "not-yet-valid"))
+        *trust_server_cert_not_yet_valid = TRUE;
+      else if (!strcmp(value, "other"))
+        *trust_server_cert_other_failure = TRUE;
+      else
+        return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                  _("Unknown value '%s' for %s.\n"
+                                    "Supported values: %s"),
+                                  value,
+                                  "--trust-server-cert-failures",
+                                  "unknown-ca, cn-mismatch, expired, "
+                                  "not-yet-valid, other");
+    }
+
+  return SVN_NO_ERROR;
+}

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/config_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/config_file.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/config_file.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/config_file.c Wed May 13 04:51:26 2015
@@ -940,7 +940,6 @@ svn_config_ensure(const char *config_dir
         "###                              HTTP operation."                   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
         "###   ssl-trust-default-ca       Trust the system 'default' CAs"    NL
@@ -1033,7 +1032,6 @@ svn_config_ensure(const char *config_dir
         "### Most users will not need to explicitly set the http-library"    NL
         "### option, but valid values for the option include:"               NL
         "###    'serf': Serf-based module (Subversion 1.5 - present)"        NL
-        "###    'neon': Neon-based module (Subversion 1.0 - 1.7)"            NL
         "### Availability of these modules may depend on your specific"      NL
         "### Subversion distribution."                                       NL
         "###"                                                                NL
@@ -1058,7 +1056,6 @@ svn_config_ensure(const char *config_dir
         "# http-proxy-username = blah"                                       NL
         "# http-proxy-password = doubleblah"                                 NL
         "# http-timeout = 60"                                                NL
-        "# neon-debug-mask = 130"                                            NL
 #ifndef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
         "# store-plaintext-passwords = no"                                   NL
 #endif
@@ -1099,7 +1096,6 @@ svn_config_ensure(const char *config_dir
         "# http-proxy-password = defaultpassword"                            NL
         "# http-compression = no"                                            NL
         "# No http-timeout, so just use the builtin default."                NL
-        "# No neon-debug-mask, so neon debugging is disabled."               NL
         "# ssl-authority-files = /path/to/CAcert.pem;/path/to/CAcert2.pem"   NL
         "#"                                                                  NL
         "# Password / passphrase caching parameters:"                        NL

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/config_win.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/config_win.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/config_win.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/config_win.c Wed May 13 04:51:26 2015
@@ -201,10 +201,14 @@ svn_config__parse_registry(svn_config_t
       svn_boolean_t is_enoent = APR_STATUS_IS_ENOENT(apr_err)
                                 || (err == ERROR_INVALID_HANDLE);
 
-      if (must_exist || !is_enoent)
+      if (!is_enoent)
         return svn_error_createf(SVN_ERR_BAD_FILENAME,
-                                 is_enoent ? NULL
-                                           : svn_error_wrap_apr(apr_err, NULL),
+                                 svn_error_wrap_apr(apr_err, NULL),
+                                 _("Can't open registry key '%s'"),
+                                 svn_dirent_local_style(file, pool));
+      else if (must_exist)
+        return svn_error_createf(SVN_ERR_BAD_FILENAME,
+                                 NULL,
                                  _("Can't open registry key '%s'"),
                                  svn_dirent_local_style(file, pool));
       else

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/dirent_uri.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/dirent_uri.c Wed May 13 04:51:26 2015
@@ -1295,9 +1295,9 @@ svn_relpath_split(const char **dirpath,
 }
 
 const char *
-svn_relpath_limit(const char *relpath,
-                  int max_components,
-                  apr_pool_t *result_pool)
+svn_relpath_prefix(const char *relpath,
+                   int max_components,
+                   apr_pool_t *result_pool)
 {
   const char *end;
   assert(relpath_is_canonical(relpath));

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/dso.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/dso.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/dso.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/dso.c Wed May 13 04:51:26 2015
@@ -19,7 +19,6 @@
  * ====================================================================
  */
 
-#include <apr_thread_mutex.h>
 #include <apr_hash.h>
 
 #include "svn_hash.h"
@@ -29,6 +28,7 @@
 
 #include "private/svn_mutex.h"
 #include "private/svn_atomic.h"
+#include "private/svn_subr_private.h"
 
 /* A mutex to protect our global pool and cache. */
 static svn_mutex__t *dso_mutex = NULL;
@@ -123,4 +123,11 @@ svn_dso_load(apr_dso_handle_t **dso, con
 
   return SVN_NO_ERROR;
 }
+
+apr_pool_t *
+svn_dso__pool(void)
+{
+  return dso_pool;
+}
+
 #endif /* APR_HAS_DSO */

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/hash.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/hash.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/hash.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/hash.c Wed May 13 04:51:26 2015
@@ -135,7 +135,7 @@ svn_hash__read_entry(svn_hash__entry_t *
                                   0, APR_SIZE_MAX, 10);
       if (err)
         return svn_error_create(SVN_ERR_MALFORMED_FILE, err,
-                                _("Serialized hash malformed"));
+                                _("Serialized hash malformed key length"));
       entry->keylen = (apr_size_t)ui64;
 
       /* Now read that much into a buffer. */
@@ -148,19 +148,19 @@ svn_hash__read_entry(svn_hash__entry_t *
       SVN_ERR(svn_stream_read_full(stream, &c, &len));
       if (c != '\n')
         return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
-                                _("Serialized hash malformed"));
+                                _("Serialized hash malformed key data"));
 
       /* Read a val length line */
       SVN_ERR(svn_stream_readline(stream, &buf, "\n", &eof, pool));
 
       if ((buf->data[0] == 'V') && (buf->data[1] == ' '))
         {
-          /* Get the length of the key */
+          /* Get the length of the val */
           err = svn_cstring_strtoui64(&ui64, buf->data + 2,
                                       0, APR_SIZE_MAX, 10);
           if (err)
             return svn_error_create(SVN_ERR_MALFORMED_FILE, err,
-                                    _("Serialized hash malformed"));
+                                    _("Serialized hash malformed value length"));
           entry->vallen = (apr_size_t)ui64;
 
           entry->val = apr_palloc(pool, entry->vallen + 1);
@@ -172,7 +172,7 @@ svn_hash__read_entry(svn_hash__entry_t *
           SVN_ERR(svn_stream_read_full(stream, &c, &len));
           if (c != '\n')
             return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
-                                    _("Serialized hash malformed"));
+                                    _("Serialized hash malformed value data"));
         }
       else
         return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
@@ -186,7 +186,7 @@ svn_hash__read_entry(svn_hash__entry_t *
                                   0, APR_SIZE_MAX, 10);
       if (err)
         return svn_error_create(SVN_ERR_MALFORMED_FILE, err,
-                                _("Serialized hash malformed"));
+                                _("Serialized hash malformed key length"));
       entry->keylen = (apr_size_t)ui64;
 
       /* Now read that much into a buffer. */
@@ -199,7 +199,7 @@ svn_hash__read_entry(svn_hash__entry_t *
       SVN_ERR(svn_stream_read_full(stream, &c, &len));
       if (c != '\n')
         return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
-                                _("Serialized hash malformed"));
+                                _("Serialized hash malformed key data"));
 
       /* Remove this hash entry. */
       entry->vallen = 0;

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/io.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/io.c Wed May 13 04:51:26 2015
@@ -1856,7 +1856,7 @@ io_win_file_attrs_set(const char *fname,
                                   _("Can't set attributes of file '%s'"),
                                   svn_dirent_local_style(fname, pool));
 
-    return SVN_NO_ERROR;;
+    return SVN_NO_ERROR;
 }
 
 static svn_error_t *win_init_dynamic_imports(void *baton, apr_pool_t *pool)
@@ -4046,7 +4046,8 @@ svn_error_t *
 svn_io_file_move(const char *from_path, const char *to_path,
                  apr_pool_t *pool)
 {
-  svn_error_t *err = svn_io_file_rename(from_path, to_path, pool);
+  svn_error_t *err = svn_error_trace(svn_io_file_rename(from_path, to_path,
+                                                        pool));
 
   if (err && APR_STATUS_IS_EXDEV(err->apr_err))
     {
@@ -4059,24 +4060,27 @@ svn_io_file_move(const char *from_path,
                                        svn_io_file_del_none,
                                        pool, pool));
 
-      err = svn_io_copy_file(from_path, tmp_to_path, TRUE, pool);
+      err = svn_error_trace(svn_io_copy_file(from_path, tmp_to_path, TRUE,
+                                             pool));
       if (err)
         goto failed_tmp;
 
-      err = svn_io_file_rename(tmp_to_path, to_path, pool);
+      err = svn_error_trace(svn_io_file_rename(tmp_to_path, to_path, pool));
       if (err)
         goto failed_tmp;
 
-      err = svn_io_remove_file2(from_path, FALSE, pool);
+      err = svn_error_trace(svn_io_remove_file2(from_path, FALSE, pool));
       if (! err)
         return SVN_NO_ERROR;
 
-      svn_error_clear(svn_io_remove_file2(to_path, FALSE, pool));
-
-      return err;
+      return svn_error_compose_create(
+                  err,
+                  svn_error_trace(svn_io_remove_file2(to_path, FALSE, pool)));
 
     failed_tmp:
-      svn_error_clear(svn_io_remove_file2(tmp_to_path, FALSE, pool));
+      err = svn_error_compose_create(
+              err,
+              svn_error_trace(svn_io_remove_file2(tmp_to_path, FALSE, pool)));
     }
 
   return err;

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/pool.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/pool.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/pool.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/pool.c Wed May 13 04:51:26 2015
@@ -30,7 +30,6 @@
 #include <apr_version.h>
 #include <apr_general.h>
 #include <apr_pools.h>
-#include <apr_thread_mutex.h>
 
 #include "svn_pools.h"
 

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/stream.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/stream.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/stream.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/stream.c Wed May 13 04:51:26 2015
@@ -2200,11 +2200,11 @@ svn_stream__install_stream(svn_stream_t
 
       apr_os_file_get(&hFile, ib->baton_apr.file);
 
-      SVN_ERR(svn_utf__win32_utf8_to_utf16(&w_final_abspath,
-                                           svn_dirent_local_style(
+      SVN_ERR(svn_io__utf8_to_unicode_longpath(&w_final_abspath,
+                                               svn_dirent_local_style(
                                                           final_abspath,
                                                           scratch_pool),
-                                           NULL, scratch_pool));
+                                               scratch_pool));
       path_len = wcslen(w_final_abspath);
       rename_size = sizeof(*rename_info) + sizeof(WCHAR) * path_len;
 

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/x509parse.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/x509parse.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/x509parse.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/x509parse.c Wed May 13 04:51:26 2015
@@ -685,6 +685,8 @@ x509_get_ext(apr_array_header_t *dnsname
                   *p += len;
                   continue;
                 }
+
+              return svn_error_trace(err);
             }
           else
             {
@@ -1052,7 +1054,7 @@ svn_x509_parse_cert(svn_x509_certinfo_t
    */
   err = asn1_get_tag(&p, end, &len, ASN1_CONSTRUCTED | ASN1_SEQUENCE);
   if (err)
-    return svn_error_create(SVN_ERR_X509_CERT_INVALID_FORMAT, NULL, NULL);
+    return svn_error_create(SVN_ERR_X509_CERT_INVALID_FORMAT, err, NULL);
 
   if (len != (end - p))
     {

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_wc/deprecated.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_wc/deprecated.c Wed May 13 04:51:26 2015
@@ -948,12 +948,12 @@ svn_wc_delete(const char *path,
 svn_error_t *
 svn_wc_add_from_disk2(svn_wc_context_t *wc_ctx,
                      const char *local_abspath,
-                      const apr_hash_t *props,
+                     const apr_hash_t *props,
                      svn_wc_notify_func2_t notify_func,
                      void *notify_baton,
                      apr_pool_t *scratch_pool)
 {
-  SVN_ERR(svn_wc_add_from_disk3(wc_ctx, local_abspath, NULL, FALSE,
+  SVN_ERR(svn_wc_add_from_disk3(wc_ctx, local_abspath, props, FALSE,
                                  notify_func, notify_baton, scratch_pool));
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_wc/diff_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_wc/diff_editor.c?rev=1679139&r1=1679138&r2=1679139&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_wc/diff_editor.c Wed May 13 04:51:26 2015
@@ -145,6 +145,9 @@ struct dir_baton_t
   /* TRUE if the node is to be compared with an unrelated node*/
   svn_boolean_t ignoring_ancestry;
 
+  /* TRUE if the directory was reported incomplete to the repository */
+  svn_boolean_t is_incomplete;
+
   /* Processor state */
   void *pdb;
   svn_boolean_t skip;
@@ -1220,10 +1223,8 @@ handle_local_only(struct dir_baton_t *pb
 
   switch (info->status)
     {
-      case svn_wc__db_status_incomplete:
-        return SVN_NO_ERROR; /* Not local only */
-
       case svn_wc__db_status_normal:
+      case svn_wc__db_status_incomplete:
         if (!repos_delete)
           return SVN_NO_ERROR; /* Local and remote */
         svn_hash_sets(pb->deletes, name, NULL);
@@ -1608,25 +1609,47 @@ open_directory(const char *path,
         db->repos_only = TRUE;
 
       if (!db->repos_only)
-        switch (info->status)
-          {
-            case svn_wc__db_status_normal:
-              break;
-            case svn_wc__db_status_deleted:
-              db->repos_only = TRUE;
-
-              if (!info->have_more_work)
-                svn_hash_sets(pb->compared,
-                              apr_pstrdup(pb->pool, db->name), "");
-              break;
-            case svn_wc__db_status_added:
-              if (eb->ignore_ancestry)
-                db->ignoring_ancestry = TRUE;
-              else
+        {
+          switch (info->status)
+            {
+              case svn_wc__db_status_normal:
+              case svn_wc__db_status_incomplete:
+                db->is_incomplete = (info->status ==
+                                     svn_wc__db_status_incomplete);
+                break;
+              case svn_wc__db_status_deleted:
                 db->repos_only = TRUE;
-              break;
-            default:
-              SVN_ERR_MALFUNCTION();
+
+                if (!info->have_more_work)
+                  svn_hash_sets(pb->compared,
+                                apr_pstrdup(pb->pool, db->name), "");
+                break;
+              case svn_wc__db_status_added:
+                if (eb->ignore_ancestry)
+                  db->ignoring_ancestry = TRUE;
+                else
+                  db->repos_only = TRUE;
+                break;
+              default:
+                SVN_ERR_MALFUNCTION();
+          }
+
+          if (info->status == svn_wc__db_status_added
+              || info->status == svn_wc__db_status_deleted)
+            {
+              svn_wc__db_status_t base_status;
+
+              /* Node is shadowed; check BASE */
+              SVN_ERR(svn_wc__db_base_get_info(&base_status, NULL, NULL,
+                                               NULL, NULL, NULL, NULL, NULL,
+                                               NULL, NULL, NULL, NULL, NULL,
+                                               NULL, NULL, NULL,
+                                               eb->db, db->local_abspath,
+                                               dir_pool, dir_pool));
+
+              if (base_status == svn_wc__db_status_incomplete)
+                db->is_incomplete = TRUE;
+            }
         }
 
       if (!db->repos_only)
@@ -1714,7 +1737,7 @@ close_directory(void *dir_baton,
     {
       apr_hash_t *repos_props;
 
-      if (db->added)
+      if (db->added || db->is_incomplete)
         {
           repos_props = apr_hash_make(scratch_pool);
         }
@@ -1891,6 +1914,7 @@ open_file(const char *path,
         switch (info->status)
           {
             case svn_wc__db_status_normal:
+            case svn_wc__db_status_incomplete:
               break;
             case svn_wc__db_status_deleted:
               fb->repos_only = TRUE;