Modified: subversion/branches/pin-externals/subversion/libsvn_fs_x/fs_x.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_fs_x/fs_x.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_fs_x/fs_x.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_fs_x/fs_x.c Sun Feb  8 
03:10:25 2015
@@ -690,17 +690,6 @@ svn_fs_x__ensure_revision_exists(svn_rev
                            _("No such revision %ld"), rev);
 }
 
-svn_error_t *
-svn_fs_x__revision_proplist(apr_hash_t **proplist_p,
-                            svn_fs_t *fs,
-                            svn_revnum_t rev,
-                            apr_pool_t *pool)
-{
-  SVN_ERR(svn_fs_x__get_revision_proplist(proplist_p, fs, rev, FALSE, pool));
-
-  return SVN_NO_ERROR;
-}
-
 
 svn_error_t *
 svn_fs_x__file_length(svn_filesize_t *length,
@@ -1108,17 +1097,19 @@ svn_fs_x__ensure_dir_exists(const char *
 
 svn_error_t *
 svn_fs_x__revision_prop(svn_string_t **value_p,
-                         svn_fs_t *fs,
-                         svn_revnum_t rev,
-                         const char *propname,
-                         apr_pool_t *pool)
+                        svn_fs_t *fs,
+                        svn_revnum_t rev,
+                        const char *propname,
+                        apr_pool_t *result_pool,
+                        apr_pool_t *scratch_pool)
 {
   apr_hash_t *table;
 
   SVN_ERR(svn_fs__check_fs(fs, TRUE));
-  SVN_ERR(svn_fs_x__revision_proplist(&table, fs, rev, pool));
+  SVN_ERR(svn_fs_x__get_revision_proplist(&table, fs, rev, FALSE,
+                                          scratch_pool, scratch_pool));
 
-  *value_p = svn_hash_gets(table, propname);
+  *value_p = svn_string_dup(svn_hash_gets(table, propname), result_pool);
 
   return SVN_NO_ERROR;
 }
@@ -1143,7 +1134,11 @@ change_rev_prop_body(void *baton,
   change_rev_prop_baton_t *cb = baton;
   apr_hash_t *table;
 
-  SVN_ERR(svn_fs_x__revision_proplist(&table, cb->fs, cb->rev, scratch_pool));
+  /* Read current revprop values from disk (never from cache).
+     Even if somehow the cache got out of sync, we want to make sure that
+     we read, update and write up-to-date data. */
+  SVN_ERR(svn_fs_x__get_revision_proplist(&table, cb->fs, cb->rev, TRUE,
+                                          scratch_pool, scratch_pool));
 
   if (cb->old_value_p)
     {

Modified: subversion/branches/pin-externals/subversion/libsvn_fs_x/fs_x.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_fs_x/fs_x.h?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_fs_x/fs_x.h (original)
+++ subversion/branches/pin-externals/subversion/libsvn_fs_x/fs_x.h Sun Feb  8 
03:10:25 2015
@@ -69,15 +69,6 @@ svn_fs_x__ensure_revision_exists(svn_rev
                                  svn_fs_t *fs,
                                  apr_pool_t *scratch_pool);
 
-/* Set *PROPLIST to be an apr_hash_t containing the property list of
-   revision REV as seen in filesystem FS.  Use POOL for temporary
-   allocations. */
-svn_error_t *
-svn_fs_x__revision_proplist(apr_hash_t **proplist,
-                            svn_fs_t *fs,
-                            svn_revnum_t rev,
-                            apr_pool_t *pool);
-
 /* Set *LENGTH to the be fulltext length of the node revision
    specified by NODEREV. */
 svn_error_t *
@@ -167,15 +158,16 @@ svn_fs_x__write_format(svn_fs_t *fs,
                        svn_boolean_t overwrite,
                        apr_pool_t *scratch_pool);
 
-/* Find the value of the property named PROPNAME in transaction TXN.
-   Return the contents in *VALUE_P.  The contents will be allocated
-   from POOL. */
+/* Find the value of the property named PROPNAME in transaction REV.
+   Return the contents in *VALUE_P, allocated from RESULT_POOL.
+   Use SCRATCH_POOL for temporary allocations. */
 svn_error_t *
 svn_fs_x__revision_prop(svn_string_t **value_p,
                         svn_fs_t *fs,
                         svn_revnum_t rev,
                         const char *propname,
-                        apr_pool_t *pool);
+                        apr_pool_t *result_pool,
+                        apr_pool_t *scratch_pool);
 
 /* Change, add, or delete a property on a revision REV in filesystem
    FS.  NAME gives the name of the property, and value, if non-NULL,

Modified: subversion/branches/pin-externals/subversion/libsvn_fs_x/hotcopy.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_fs_x/hotcopy.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_fs_x/hotcopy.c 
(original)
+++ subversion/branches/pin-externals/subversion/libsvn_fs_x/hotcopy.c Sun Feb  
8 03:10:25 2015
@@ -99,15 +99,15 @@ static svn_error_t *
 entry_name_to_utf8(const char **name_p,
                    const char *name,
                    const char *parent,
-                   apr_pool_t *pool)
+                   apr_pool_t *result_pool)
 {
-  svn_error_t *err = svn_path_cstring_to_utf8(name_p, name, pool);
+  svn_error_t *err = svn_path_cstring_to_utf8(name_p, name, result_pool);
   if (err && err->apr_err == APR_EINVAL)
     {
       return svn_error_createf(err->apr_err, err,
                                _("Error converting entry "
                                  "in directory '%s' to UTF-8"),
-                               svn_dirent_local_style(parent, pool));
+                               svn_dirent_local_style(parent, result_pool));
     }
   return err;
 }

Modified: subversion/branches/pin-externals/subversion/libsvn_fs_x/noderevs.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_fs_x/noderevs.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_fs_x/noderevs.c 
(original)
+++ subversion/branches/pin-externals/subversion/libsvn_fs_x/noderevs.c Sun Feb 
 8 03:10:25 2015
@@ -49,28 +49,6 @@
 /* the noderev has copy-root path and revision */
 #define NODEREV_HAS_CPATH    0x00040
 
-/* Our internal representation of an representation.
- */
-typedef struct binary_representation_t
-{
-  /* Checksums digests for the contents produced by this representation.
-     If has_sha1 is FALSE, sha1_digest is not being used. */
-  svn_boolean_t has_sha1;
-  unsigned char sha1_digest[APR_SHA1_DIGESTSIZE];
-  unsigned char md5_digest[APR_MD5_DIGESTSIZE];
-
-  /* Location of this representation. */
-  svn_fs_x__id_t id;
-
-  /* The size of the representation in bytes as seen in the revision
-     file. */
-  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, */
-  svn_filesize_t expanded_size;
-} binary_representation_t;
-
 /* Our internal representation of a svn_fs_x__noderev_t.
  * 
  * We will store path strings in a string container and reference them
@@ -181,7 +159,7 @@ svn_fs_x__noderevs_create(int initial_co
     = apr_array_make(result_pool, 2 * initial_count, sizeof(svn_fs_x__id_t));
   noderevs->reps
     = apr_array_make(result_pool, 2 * initial_count,
-                     sizeof(binary_representation_t));
+                     sizeof(svn_fs_x__representation_t));
   noderevs->noderevs
     = apr_array_make(result_pool, initial_count, sizeof(binary_noderev_t));
 
@@ -223,25 +201,17 @@ store_representation(apr_array_header_t
                      apr_hash_t *dict,
                      const svn_fs_x__representation_t *rep)
 {
-  binary_representation_t binary_rep = { 0 };
   int idx;
   void *idx_void;
 
   if (rep == NULL)
     return 0;
 
-  binary_rep.has_sha1 = rep->has_sha1;
-  memcpy(binary_rep.sha1_digest, rep->sha1_digest, sizeof(rep->sha1_digest));
-  memcpy(binary_rep.md5_digest, rep->md5_digest, sizeof(rep->md5_digest));
-  binary_rep.id = rep->id;
-  binary_rep.size = rep->size;
-  binary_rep.expanded_size = rep->expanded_size;
-
-  idx_void = apr_hash_get(dict, &binary_rep, sizeof(binary_rep));
+  idx_void = apr_hash_get(dict, rep, sizeof(*rep));
   idx = (int)(apr_uintptr_t)idx_void;
   if (idx == 0)
     {
-      APR_ARRAY_PUSH(reps, binary_representation_t) = binary_rep;
+      APR_ARRAY_PUSH(reps, svn_fs_x__representation_t) = *rep;
       idx = reps->nelts;
       apr_hash_set(dict, reps->elts + (idx-1) * reps->elt_size,
                    reps->elt_size, (void*)(apr_uintptr_t)idx);
@@ -365,8 +335,6 @@ get_representation(svn_fs_x__representat
                    int idx,
                    apr_pool_t *pool)
 {
-  binary_representation_t *binary_rep;
-
   /* handle NULL representations  */
   if (idx == 0)
     {
@@ -382,17 +350,9 @@ get_representation(svn_fs_x__representat
                              idx, reps->nelts);
 
   /* no translation required. Just duplicate the info */
-  binary_rep = &APR_ARRAY_IDX(reps, idx - 1, binary_representation_t);
-
-  *rep = apr_pcalloc(pool, sizeof(**rep));
-  (*rep)->has_sha1 = binary_rep->has_sha1;
-  memcpy((*rep)->sha1_digest, binary_rep->sha1_digest,
-         sizeof((*rep)->sha1_digest));
-  memcpy((*rep)->md5_digest, binary_rep->md5_digest,
-         sizeof((*rep)->md5_digest));
-  (*rep)->id = binary_rep->id;
-  (*rep)->size = binary_rep->size;
-  (*rep)->expanded_size = binary_rep->expanded_size;
+  *rep = apr_pmemdup(pool,
+                     &APR_ARRAY_IDX(reps, idx - 1, svn_fs_x__representation_t),
+                     sizeof(**rep));
 
   return SVN_NO_ERROR;
 }
@@ -517,8 +477,8 @@ write_reps(svn_packed__int_stream_t *rep
   int i;
   for (i = 0; i < reps->nelts; ++i)
     {
-      binary_representation_t *rep
-        = &APR_ARRAY_IDX(reps, i, binary_representation_t);
+      svn_fs_x__representation_t *rep
+        = &APR_ARRAY_IDX(reps, i, svn_fs_x__representation_t);
 
       svn_packed__add_uint(rep_stream, rep->has_sha1);
 
@@ -635,11 +595,11 @@ read_reps(apr_array_header_t **reps_p,
   apr_size_t count
     = svn_packed__int_count(svn_packed__first_int_substream(rep_stream));
   apr_array_header_t *reps
-    = apr_array_make(pool, (int)count, sizeof(binary_representation_t));
+    = apr_array_make(pool, (int)count, sizeof(svn_fs_x__representation_t));
 
   for (i = 0; i < count; ++i)
     {
-      binary_representation_t rep;
+      svn_fs_x__representation_t rep;
 
       rep.has_sha1 = (svn_boolean_t)svn_packed__get_uint(rep_stream);
 
@@ -674,7 +634,7 @@ read_reps(apr_array_header_t **reps_p,
           memcpy(rep.sha1_digest, bytes, sizeof(rep.sha1_digest));
         }
 
-      APR_ARRAY_PUSH(reps, binary_representation_t) = rep;
+      APR_ARRAY_PUSH(reps, svn_fs_x__representation_t) = rep;
     }
 
   *reps_p = reps;

Modified: subversion/branches/pin-externals/subversion/libsvn_fs_x/revprops.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_fs_x/revprops.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_fs_x/revprops.c 
(original)
+++ subversion/branches/pin-externals/subversion/libsvn_fs_x/revprops.c Sun Feb 
 8 03:10:25 2015
@@ -698,17 +698,18 @@ parse_revprop(apr_hash_t **properties,
  * If the data could not be read due to an otherwise recoverable error,
  * leave *PROPERTIES unchanged. No error will be returned in that case.
  *
- * Allocations will be done in POOL.
+ * Allocate *PROPERTIES in RESULT_POOL and temporaries in SCRATCH_POOL.
  */
 static svn_error_t *
 read_non_packed_revprop(apr_hash_t **properties,
                         svn_fs_t *fs,
                         svn_revnum_t rev,
                         apr_int64_t generation,
-                        apr_pool_t *pool)
+                        apr_pool_t *result_pool,
+                        apr_pool_t *scratch_pool)
 {
   svn_stringbuf_t *content = NULL;
-  apr_pool_t *iterpool = svn_pool_create(pool);
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   svn_boolean_t missing = FALSE;
   int i;
 
@@ -727,7 +728,7 @@ read_non_packed_revprop(apr_hash_t **pro
   if (content)
     SVN_ERR(parse_revprop(properties, fs, rev, generation,
                           svn_stringbuf__morph_into_string(content),
-                          pool, iterpool));
+                          result_pool, iterpool));
 
   svn_pool_clear(iterpool);
 
@@ -1006,7 +1007,8 @@ parse_packed_revprops(svn_fs_t *fs,
  * *REVPROPS.  Use GENERATION to populate the revprop cache, if enabled.
  * If you want to modify revprop contents / update REVPROPS, READ_ALL
  * must be set.  Otherwise, only the properties of REV are being provided.
- * Allocate data in POOL.
+ *
+ * Allocate *PROPERTIES in RESULT_POOL and temporaries in SCRATCH_POOL.
  */
 static svn_error_t *
 read_pack_revprop(packed_revprops_t **revprops,
@@ -1014,9 +1016,10 @@ read_pack_revprop(packed_revprops_t **re
                   svn_revnum_t rev,
                   apr_int64_t generation,
                   svn_boolean_t read_all,
-                  apr_pool_t *pool)
+                  apr_pool_t *result_pool,
+                  apr_pool_t *scratch_pool)
 {
-  apr_pool_t *iterpool = svn_pool_create(pool);
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   svn_boolean_t missing = FALSE;
   svn_error_t *err;
   packed_revprops_t *result;
@@ -1031,7 +1034,7 @@ read_pack_revprop(packed_revprops_t **re
                               _("No such packed revision %ld"), rev);
 
   /* initialize the result data structure */
-  result = apr_pcalloc(pool, sizeof(*result));
+  result = apr_pcalloc(result_pool, sizeof(*result));
   result->revision = rev;
   result->generation = generation;
 
@@ -1047,7 +1050,7 @@ read_pack_revprop(packed_revprops_t **re
       /* there might have been concurrent writes.
        * Re-read the manifest and the pack file.
        */
-      SVN_ERR(get_revprop_packname(fs, result, pool, iterpool));
+      SVN_ERR(get_revprop_packname(fs, result, result_pool, iterpool));
       file_path  = svn_dirent_join(result->folder,
                                    result->filename,
                                    iterpool);
@@ -1055,15 +1058,15 @@ read_pack_revprop(packed_revprops_t **re
                                 &missing,
                                 file_path,
                                 i + 1 < SVN_FS_X__RECOVERABLE_RETRY_COUNT,
-                                pool));
+                                result_pool));
 
       /* If we could not find the file, there was a write.
        * So, we should refresh our revprop generation info as well such
        * that others may find data we will put into the cache.  They would
        * consider it outdated, otherwise.
        */
-      if (missing && has_revprop_cache(fs, pool))
-        SVN_ERR(read_revprop_generation(&result->generation, fs, pool));
+      if (missing && has_revprop_cache(fs, iterpool))
+        SVN_ERR(read_revprop_generation(&result->generation, fs, iterpool));
     }
 
   /* the file content should be available now */
@@ -1072,7 +1075,7 @@ read_pack_revprop(packed_revprops_t **re
                   _("Failed to read revprop pack file for r%ld"), rev);
 
   /* parse it. RESULT will be complete afterwards. */
-  err = parse_packed_revprops(fs, result, read_all, pool, iterpool);
+  err = parse_packed_revprops(fs, result, read_all, result_pool, iterpool);
   svn_pool_destroy(iterpool);
   if (err)
     return svn_error_createf(SVN_ERR_FS_CORRUPT, err,
@@ -1092,7 +1095,8 @@ svn_fs_x__get_revision_proplist(apr_hash
                                 svn_fs_t *fs,
                                 svn_revnum_t rev,
                                 svn_boolean_t bypass_cache,
-                                apr_pool_t *pool)
+                                apr_pool_t *result_pool,
+                                apr_pool_t *scratch_pool)
 {
   svn_fs_x__data_t *ffd = fs->fsap_data;
   apr_int64_t generation = 0;
@@ -1101,20 +1105,20 @@ svn_fs_x__get_revision_proplist(apr_hash
   *proplist_p = NULL;
 
   /* should they be available at all? */
-  SVN_ERR(svn_fs_x__ensure_revision_exists(rev, fs, pool));
+  SVN_ERR(svn_fs_x__ensure_revision_exists(rev, fs, scratch_pool));
 
   /* Try cache lookup first. */
-  if (!bypass_cache && has_revprop_cache(fs, pool))
+  if (!bypass_cache && has_revprop_cache(fs, scratch_pool))
     {
       svn_boolean_t is_cached;
       svn_fs_x__pair_cache_key_t key = { 0 };
 
-      SVN_ERR(read_revprop_generation(&generation, fs, pool));
+      SVN_ERR(read_revprop_generation(&generation, fs, scratch_pool));
 
       key.revision = rev;
       key.second = generation;
       SVN_ERR(svn_cache__get((void **) proplist_p, &is_cached,
-                             ffd->revprop_cache, &key, pool));
+                             ffd->revprop_cache, &key, result_pool));
       if (is_cached)
         return SVN_NO_ERROR;
     }
@@ -1125,7 +1129,8 @@ svn_fs_x__get_revision_proplist(apr_hash
   if (!svn_fs_x__is_packed_revprop(fs, rev))
     {
       svn_error_t *err = read_non_packed_revprop(proplist_p, fs, rev,
-                                                 generation, pool);
+                                                 generation, result_pool,
+                                                 scratch_pool);
       if (err)
         {
           if (!APR_STATUS_IS_ENOENT(err->apr_err))
@@ -1142,7 +1147,8 @@ svn_fs_x__get_revision_proplist(apr_hash
   if (!*proplist_p)
     {
       packed_revprops_t *revprops;
-      SVN_ERR(read_pack_revprop(&revprops, fs, rev, generation, FALSE, pool));
+      SVN_ERR(read_pack_revprop(&revprops, fs, rev, generation, FALSE,
+                                result_pool, scratch_pool));
       *proplist_p = revprops->properties;
     }
 
@@ -1160,7 +1166,8 @@ svn_fs_x__get_revision_proplist(apr_hash
  * file in *TMP_PATH and the file path that it must be moved to in
  * *FINAL_PATH.
  *
- * Use POOL for allocations.
+ * Allocate *FINAL_PATH and *TMP_PATH in RESULT_POOL.  Use SCRATCH_POOL
+ * for temporary allocations.
  */
 static svn_error_t *
 write_non_packed_revprop(const char **final_path,
@@ -1168,17 +1175,21 @@ write_non_packed_revprop(const char **fi
                          svn_fs_t *fs,
                          svn_revnum_t rev,
                          apr_hash_t *proplist,
-                         apr_pool_t *pool)
+                         apr_pool_t *result_pool,
+                         apr_pool_t *scratch_pool)
 {
   svn_stream_t *stream;
-  *final_path = svn_fs_x__path_revprops(fs, rev, pool);
+  *final_path = svn_fs_x__path_revprops(fs, rev, result_pool);
 
   /* ### do we have a directory sitting around already? we really shouldn't
      ### have to get the dirname here. */
   SVN_ERR(svn_stream_open_unique(&stream, tmp_path,
-                                 svn_dirent_dirname(*final_path, pool),
-                                 svn_io_file_del_none, pool, pool));
-  SVN_ERR(svn_hash_write2(proplist, stream, SVN_HASH_TERMINATOR, pool));
+                                 svn_dirent_dirname(*final_path,
+                                                    scratch_pool),
+                                 svn_io_file_del_none,
+                                 result_pool, scratch_pool));
+  SVN_ERR(svn_hash_write2(proplist, stream, SVN_HASH_TERMINATOR,
+                          scratch_pool));
   SVN_ERR(svn_stream_close(stream));
 
   return SVN_NO_ERROR;
@@ -1354,7 +1365,10 @@ repack_revprops(svn_fs_t *fs,
  *     [REVPROPS->START_REVISION + START, REVPROPS->START_REVISION + END - 1]
  * of REVPROPS->MANIFEST.  Add the name of old file to FILES_TO_DELETE,
  * auto-create that array if necessary.  Return an open file stream to
- * the new file in *STREAM allocated in POOL.
+ * the new file in *STREAM allocated in RESULT_POOL.  Allocate the paths
+ * in *FILES_TO_DELETE from the same pool that contains the array itself.
+ *
+ * Use SCRATCH_POOL for temporary allocations.
  */
 static svn_error_t *
 repack_stream_open(svn_stream_t **stream,
@@ -1363,7 +1377,8 @@ repack_stream_open(svn_stream_t **stream
                    int start,
                    int end,
                    apr_array_header_t **files_to_delete,
-                   apr_pool_t *pool)
+                   apr_pool_t *result_pool,
+                   apr_pool_t *scratch_pool)
 {
   apr_int64_t tag;
   const char *tag_string;
@@ -1379,10 +1394,11 @@ repack_stream_open(svn_stream_t **stream
                                            const char*);
 
   if (*files_to_delete == NULL)
-    *files_to_delete = apr_array_make(pool, 3, sizeof(const char*));
+    *files_to_delete = apr_array_make(result_pool, 3, sizeof(const char*));
 
   APR_ARRAY_PUSH(*files_to_delete, const char*)
-    = svn_dirent_join(revprops->folder, old_filename, pool);
+    = svn_dirent_join(revprops->folder, old_filename,
+                      (*files_to_delete)->pool);
 
   /* increase the tag part, i.e. the counter after the dot */
   tag_string = strchr(old_filename, '.');
@@ -1392,7 +1408,8 @@ repack_stream_open(svn_stream_t **stream
                              old_filename);
 
   SVN_ERR(svn_cstring_atoi64(&tag, tag_string + 1));
-  new_filename = svn_string_createf(pool, "%ld.%" APR_INT64_T_FMT,
+  new_filename = svn_string_createf((*files_to_delete)->pool,
+                                    "%ld.%" APR_INT64_T_FMT,
                                     revprops->start_revision + start,
                                     ++tag);
 
@@ -1404,9 +1421,10 @@ repack_stream_open(svn_stream_t **stream
   /* create a file stream for the new file */
   SVN_ERR(svn_io_file_open(&file, svn_dirent_join(revprops->folder,
                                                   new_filename->data,
-                                                  pool),
-                           APR_WRITE | APR_CREATE, APR_OS_DEFAULT, pool));
-  *stream = svn_stream_from_aprfile2(file, FALSE, pool);
+                                                  scratch_pool),
+                           APR_WRITE | APR_CREATE, APR_OS_DEFAULT,
+                           result_pool));
+  *stream = svn_stream_from_aprfile2(file, FALSE, result_pool);
 
   return SVN_NO_ERROR;
 }
@@ -1415,7 +1433,8 @@ repack_stream_open(svn_stream_t **stream
  * PROPLIST.  Return a new file in *TMP_PATH that the caller shall move
  * to *FINAL_PATH to make the change visible.  Files to be deleted will
  * be listed in *FILES_TO_DELETE which may remain unchanged / unallocated.
- * Use POOL for allocations.
+ *
+ * Allocate output values in RESULT_POOL and temporaries from SCRATCH_POOL.
  */
 static svn_error_t *
 write_packed_revprop(const char **final_path,
@@ -1424,7 +1443,8 @@ write_packed_revprop(const char **final_
                      svn_fs_t *fs,
                      svn_revnum_t rev,
                      apr_hash_t *proplist,
-                     apr_pool_t *pool)
+                     apr_pool_t *result_pool,
+                     apr_pool_t *scratch_pool)
 {
   svn_fs_x__data_t *ffd = fs->fsap_data;
   packed_revprops_t *revprops;
@@ -1436,16 +1456,18 @@ write_packed_revprop(const char **final_
 
   /* read the current revprop generation. This value will not change
    * while we hold the global write lock to this FS. */
-  if (has_revprop_cache(fs, pool))
-    SVN_ERR(read_revprop_generation(&generation, fs, pool));
+  if (has_revprop_cache(fs, scratch_pool))
+    SVN_ERR(read_revprop_generation(&generation, fs, scratch_pool));
 
   /* read contents of the current pack file */
-  SVN_ERR(read_pack_revprop(&revprops, fs, rev, generation, TRUE, pool));
+  SVN_ERR(read_pack_revprop(&revprops, fs, rev, generation, TRUE,
+                            scratch_pool, scratch_pool));
 
   /* serialize the new revprops */
-  serialized = svn_stringbuf_create_empty(pool);
-  stream = svn_stream_from_stringbuf(serialized, pool);
-  SVN_ERR(svn_hash_write2(proplist, stream, SVN_HASH_TERMINATOR, pool));
+  serialized = svn_stringbuf_create_empty(scratch_pool);
+  stream = svn_stream_from_stringbuf(serialized, scratch_pool);
+  SVN_ERR(svn_hash_write2(proplist, stream, SVN_HASH_TERMINATOR,
+                          scratch_pool));
   SVN_ERR(svn_stream_close(stream));
 
   /* calculate the size of the new data */
@@ -1464,12 +1486,13 @@ write_packed_revprop(const char **final_
        * in the non-packed case */
 
       *final_path = svn_dirent_join(revprops->folder, revprops->filename,
-                                    pool);
+                                    result_pool);
       SVN_ERR(svn_stream_open_unique(&stream, tmp_path, revprops->folder,
-                                     svn_io_file_del_none, pool, pool));
+                                     svn_io_file_del_none, result_pool,
+                                     scratch_pool));
       SVN_ERR(repack_revprops(fs, revprops, 0, revprops->sizes->nelts,
                               changed_index, serialized, new_total_size,
-                              stream, pool));
+                              stream, scratch_pool));
     }
   else
     {
@@ -1512,25 +1535,32 @@ write_packed_revprop(const char **final_
           right_count = revprops->sizes->nelts - left_count - 1;
         }
 
+      /* Allocate this here such that we can call the repack functions with
+       * the scratch pool alone. */
+      if (*files_to_delete == NULL)
+        *files_to_delete = apr_array_make(result_pool, 3,
+                                          sizeof(const char*));
+
       /* write the new, split files */
       if (left_count)
         {
           SVN_ERR(repack_stream_open(&stream, fs, revprops, 0,
-                                     left_count, files_to_delete, pool));
+                                     left_count, files_to_delete,
+                                     scratch_pool, scratch_pool));
           SVN_ERR(repack_revprops(fs, revprops, 0, left_count,
                                   changed_index, serialized, new_total_size,
-                                  stream, pool));
+                                  stream, scratch_pool));
         }
 
       if (left_count + right_count < revprops->sizes->nelts)
         {
           SVN_ERR(repack_stream_open(&stream, fs, revprops, changed_index,
                                      changed_index + 1, files_to_delete,
-                                     pool));
+                                     scratch_pool, scratch_pool));
           SVN_ERR(repack_revprops(fs, revprops, changed_index,
                                   changed_index + 1,
                                   changed_index, serialized, new_total_size,
-                                  stream, pool));
+                                  stream, scratch_pool));
         }
 
       if (right_count)
@@ -1538,24 +1568,27 @@ write_packed_revprop(const char **final_
           SVN_ERR(repack_stream_open(&stream, fs, revprops,
                                      revprops->sizes->nelts - right_count,
                                      revprops->sizes->nelts,
-                                     files_to_delete, pool));
+                                     files_to_delete, scratch_pool,
+                                     scratch_pool));
           SVN_ERR(repack_revprops(fs, revprops,
                                   revprops->sizes->nelts - right_count,
                                   revprops->sizes->nelts, changed_index,
                                   serialized, new_total_size, stream,
-                                  pool));
+                                  scratch_pool));
         }
 
       /* write the new manifest */
-      *final_path = svn_dirent_join(revprops->folder, PATH_MANIFEST, pool);
+      *final_path = svn_dirent_join(revprops->folder, PATH_MANIFEST,
+                                    result_pool);
       SVN_ERR(svn_stream_open_unique(&stream, tmp_path, revprops->folder,
-                                     svn_io_file_del_none, pool, pool));
+                                     svn_io_file_del_none, result_pool,
+                                     scratch_pool));
 
       for (i = 0; i < revprops->manifest->nelts; ++i)
         {
           const char *filename = APR_ARRAY_IDX(revprops->manifest, i,
                                                const char*);
-          SVN_ERR(svn_stream_printf(stream, pool, "%s\n", filename));
+          SVN_ERR(svn_stream_printf(stream, scratch_pool, "%s\n", filename));
         }
 
       SVN_ERR(svn_stream_close(stream));
@@ -1603,10 +1636,12 @@ svn_fs_x__set_revision_proplist(svn_fs_t
   /* Serialize the new revprop data */
   if (is_packed)
     SVN_ERR(write_packed_revprop(&final_path, &tmp_path, &files_to_delete,
-                                 fs, rev, proplist, scratch_pool));
+                                 fs, rev, proplist, scratch_pool,
+                                 scratch_pool));
   else
     SVN_ERR(write_non_packed_revprop(&final_path, &tmp_path,
-                                     fs, rev, proplist, scratch_pool));
+                                     fs, rev, proplist, scratch_pool,
+                                     scratch_pool));
 
   /* We use the rev file of this revision as the perms reference,
    * because when setting revprops for the first time, the revprop

Modified: subversion/branches/pin-externals/subversion/libsvn_fs_x/revprops.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_fs_x/revprops.h?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_fs_x/revprops.h 
(original)
+++ subversion/branches/pin-externals/subversion/libsvn_fs_x/revprops.h Sun Feb 
 8 03:10:25 2015
@@ -75,17 +75,19 @@ svn_fs_x__upgrade_cleanup_pack_revprops(
                                         void *cancel_baton,
                                         apr_pool_t *scratch_pool);
 
-/* Read the revprops for revision REV in FS and return them in *PROPERTIES_P.
+/* Read the revprops for revision REV in FS and return them in *PROPLIST_P.
  * If BYPASS_CACHE is set, don't consult the disks but always read from disk.
  *
- * Allocations will be done in POOL.
+ * Allocate the *PROPLIST_P in RESULT_POOL and use SCRATCH_POOL for temporary
+ * allocations.
  */
 svn_error_t *
 svn_fs_x__get_revision_proplist(apr_hash_t **proplist_p,
                                 svn_fs_t *fs,
                                 svn_revnum_t rev,
                                 svn_boolean_t bypass_cache,
-                                apr_pool_t *pool);
+                                apr_pool_t *result_pool,
+                                apr_pool_t *scratch_pool);
 
 /* Set the revision property list of revision REV in filesystem FS to
    PROPLIST.  Use SCRATCH_POOL for temporary allocations. */

Modified: subversion/branches/pin-externals/subversion/libsvn_fs_x/tree.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_fs_x/tree.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_fs_x/tree.c Sun Feb  8 
03:10:25 2015
@@ -564,42 +564,45 @@ root_txn_id(svn_fs_root_t *root)
 }
 
 /* Set *NODE_P to a freshly opened dag node referring to the root
-   directory of ROOT, allocating from RESULT_POOL.  */
+   directory of ROOT, allocating from RESULT_POOL.  Use SCRATCH_POOL
+   for temporary allocations.  */
 static svn_error_t *
 root_node(dag_node_t **node_p,
           svn_fs_root_t *root,
-          apr_pool_t *result_pool)
+          apr_pool_t *result_pool,
+          apr_pool_t *scratch_pool)
 {
   if (root->is_txn_root)
     {
       /* It's a transaction root.  Open a fresh copy.  */
       return svn_fs_x__dag_txn_root(node_p, root->fs, root_txn_id(root),
-                                    result_pool);
+                                    result_pool, scratch_pool);
     }
   else
     {
       /* It's a revision root, so we already have its root directory
          opened.  */
       return svn_fs_x__dag_revision_root(node_p, root->fs, root->rev,
-                                         result_pool);
+                                         result_pool, scratch_pool);
     }
 }
 
 
 /* Set *NODE_P to a mutable root directory for ROOT, cloning if
    necessary, allocating in RESULT_POOL.  ROOT must be a transaction root.
-   Use ERROR_PATH in error messages.  */
+   Use ERROR_PATH in error messages.  Use SCRATCH_POOL for temporaries.*/
 static svn_error_t *
 mutable_root_node(dag_node_t **node_p,
                   svn_fs_root_t *root,
                   const char *error_path,
-                  apr_pool_t *result_pool)
+                  apr_pool_t *result_pool,
+                  apr_pool_t *scratch_pool)
 {
   if (root->is_txn_root)
     {
       /* It's a transaction root.  Open a fresh copy.  */
-      return svn_fs_x__dag_clone_root(node_p, root->fs, root_txn_id(root),
-                                      result_pool);
+      return svn_fs_x__dag_txn_root(node_p, root->fs, root_txn_id(root),
+                                    result_pool, scratch_pool);
     }
   else
     /* If it's not a transaction root, we can't change its contents.  */
@@ -969,7 +972,7 @@ open_path(parent_path_t **parent_path_p,
     {
       /* Make a parent_path item for the root node, using its own current
          copy id.  */
-      SVN_ERR(root_node(&here, root, pool));
+      SVN_ERR(root_node(&here, root, pool, iterpool));
       rest = path + 1; /* skip the leading '/', it saves in iteration */
     }
 
@@ -1186,7 +1189,8 @@ make_path_mutable(svn_fs_root_t *root,
   else
     {
       /* We're trying to clone the root directory.  */
-      SVN_ERR(mutable_root_node(&clone, root, error_path, result_pool));
+      SVN_ERR(mutable_root_node(&clone, root, error_path, result_pool,
+                                scratch_pool));
     }
 
   /* Update the PARENT_PATH link to refer to the clone.  */
@@ -1698,9 +1702,9 @@ compare_dir_structure(svn_boolean_t *cha
 
           /* Modified but not copied / replaced or anything? */
           SVN_ERR(svn_fs_x__dag_get_node(&lhs_node, fs, &lhs_entry->id, 
-                                         iterpool));
+                                         iterpool, iterpool));
           SVN_ERR(svn_fs_x__dag_get_node(&rhs_node, fs, &rhs_entry->id, 
-                                         iterpool));
+                                         iterpool, iterpool));
           SVN_ERR(svn_fs_x__dag_same_line_of_history(&same_history,
                                                      lhs_node, rhs_node));
           if (same_history)
@@ -1949,7 +1953,7 @@ merge(svn_stringbuf_t *conflict_p,
 
           dag_node_t *t_ent_node;
           SVN_ERR(svn_fs_x__dag_get_node(&t_ent_node, fs, &t_entry->id,
-                                         iterpool));
+                                         iterpool, iterpool));
           SVN_ERR(svn_fs_x__dag_get_mergeinfo_count(&mergeinfo_start,
                                                     t_ent_node));
           mergeinfo_increment -= mergeinfo_start;
@@ -1958,7 +1962,7 @@ merge(svn_stringbuf_t *conflict_p,
             {
               dag_node_t *s_ent_node;
               SVN_ERR(svn_fs_x__dag_get_node(&s_ent_node, fs, &s_entry->id,
-                                             iterpool));
+                                             iterpool, iterpool));
 
               SVN_ERR(svn_fs_x__dag_get_mergeinfo_count(&mergeinfo_end,
                                                         s_ent_node));
@@ -2007,11 +2011,11 @@ merge(svn_stringbuf_t *conflict_p,
 
           /* Fetch DAG nodes to efficiently access ID parts. */
           SVN_ERR(svn_fs_x__dag_get_node(&s_ent_node, fs, &s_entry->id,
-                                         iterpool));
+                                         iterpool, iterpool));
           SVN_ERR(svn_fs_x__dag_get_node(&t_ent_node, fs, &t_entry->id,
-                                         iterpool));
+                                         iterpool, iterpool));
           SVN_ERR(svn_fs_x__dag_get_node(&a_ent_node, fs, &a_entry->id,
-                                         iterpool));
+                                         iterpool, iterpool));
 
           /* If either SOURCE-ENTRY or TARGET-ENTRY is not a direct
              modification of ANCESTOR-ENTRY, declare a conflict. */
@@ -2063,7 +2067,7 @@ merge(svn_stringbuf_t *conflict_p,
                                              iterpool));
 
       SVN_ERR(svn_fs_x__dag_get_node(&s_ent_node, fs, &s_entry->id,
-                                     iterpool));
+                                     iterpool, iterpool));
       SVN_ERR(svn_fs_x__dag_get_mergeinfo_count(&mergeinfo_s, s_ent_node));
       mergeinfo_increment += mergeinfo_s;
 
@@ -2107,11 +2111,14 @@ merge_changes(dag_node_t *ancestor_node,
   svn_fs_x__txn_id_t txn_id = svn_fs_x__txn_get_id(txn);
   svn_boolean_t related;
   
-  SVN_ERR(svn_fs_x__dag_txn_root(&txn_root_node, fs, txn_id, scratch_pool));
+  SVN_ERR(svn_fs_x__dag_txn_root(&txn_root_node, fs, txn_id, scratch_pool,
+                                 scratch_pool));
 
   if (ancestor_node == NULL)
     {
-      SVN_ERR(svn_fs_x__dag_txn_base_root(&ancestor_node, fs, txn_id,
+      svn_revnum_t base_rev;
+      SVN_ERR(svn_fs_x__get_base_rev(&base_rev, fs, txn_id, scratch_pool));
+      SVN_ERR(svn_fs_x__dag_revision_root(&ancestor_node, fs, base_rev,
                                           scratch_pool, scratch_pool));
     }
 
@@ -3625,7 +3632,8 @@ history_prev(svn_fs_history_t **prev_his
 
           /* Replace NODE and friends with the information from its
              predecessor. */
-          SVN_ERR(svn_fs_x__dag_get_node(&node, fs, &pred_id, scratch_pool));
+          SVN_ERR(svn_fs_x__dag_get_node(&node, fs, &pred_id, scratch_pool,
+                                         scratch_pool));
           commit_path = svn_fs_x__dag_get_created_path(node);
           commit_rev = svn_fs_x__dag_get_revision(node);
         }
@@ -4351,7 +4359,8 @@ verify_node(dag_node_t *node,
     {
       dag_node_t *pred;
       int pred_pred_count;
-      SVN_ERR(svn_fs_x__dag_get_node(&pred, fs, &pred_id, iterpool));
+      SVN_ERR(svn_fs_x__dag_get_node(&pred, fs, &pred_id, iterpool,
+                                     iterpool));
       SVN_ERR(svn_fs_x__dag_get_predecessor_count(&pred_pred_count, pred));
       if (pred_pred_count+1 != pred_count)
         return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
@@ -4402,7 +4411,7 @@ verify_node(dag_node_t *node,
           if (svn_fs_x__get_revnum(dirent->id.change_set) == rev)
             {
               SVN_ERR(svn_fs_x__dag_get_node(&child, fs, &dirent->id,
-                                             iterpool));
+                                             iterpool, iterpool));
               SVN_ERR(verify_node(child, rev, parent_nodes, iterpool));
               SVN_ERR(svn_fs_x__dag_get_mergeinfo_count(&child_mergeinfo,
                                                         child));
@@ -4452,7 +4461,7 @@ svn_fs_x__verify_root(svn_fs_root_t *roo
      When this code is called in the library, we want to ensure we
      use the on-disk data --- rather than some data that was read
      in the possibly-distance past and cached since. */
-  SVN_ERR(root_node(&root_dir, root, scratch_pool));
+  SVN_ERR(root_node(&root_dir, root, scratch_pool, scratch_pool));
 
   /* Recursively verify ROOT_DIR. */
   parent_nodes = apr_array_make(scratch_pool, 16, sizeof(dag_node_t *));

Modified: subversion/branches/pin-externals/subversion/libsvn_fs_x/verify.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_fs_x/verify.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_fs_x/verify.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_fs_x/verify.c Sun Feb  
8 03:10:25 2015
@@ -713,7 +713,8 @@ verify_revprops(svn_fs_t *fs,
       /* Access the svn:date revprop.
        * This implies parsing all revprops for that revision. */
       SVN_ERR(svn_fs_x__revision_prop(&date, fs, revision,
-                                      SVN_PROP_REVISION_DATE, iterpool));
+                                      SVN_PROP_REVISION_DATE,
+                                      iterpool, iterpool));
 
       /* The time stamp is the only revprop that, if given, needs to
        * have a valid content. */

Modified: subversion/branches/pin-externals/subversion/libsvn_ra/ra_loader.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra/ra_loader.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra/ra_loader.c 
(original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra/ra_loader.c Sun Feb  
8 03:10:25 2015
@@ -52,6 +52,7 @@
 #include "ra_loader.h"
 #include "deprecated.h"
 
+#include "private/svn_auth_private.h"
 #include "private/svn_ra_private.h"
 #include "svn_private_config.h"
 
@@ -263,22 +264,12 @@ svn_error_t *svn_ra_open4(svn_ra_session
   svn_ra_session_t *session;
   const struct ra_lib_defn *defn;
   const svn_ra__vtable_t *vtable = NULL;
-  svn_config_t *servers = NULL;
-  const char *server_group = NULL;
   apr_uri_t repos_URI;
   apr_status_t apr_err;
   svn_error_t *err;
 #ifdef CHOOSABLE_DAV_MODULE
   const char *http_library = DEFAULT_HTTP_LIBRARY;
 #endif
-  /* Auth caching parameters. */
-  svn_boolean_t store_passwords = SVN_CONFIG_DEFAULT_OPTION_STORE_PASSWORDS;
-  svn_boolean_t store_auth_creds = SVN_CONFIG_DEFAULT_OPTION_STORE_AUTH_CREDS;
-  const char *store_plaintext_passwords
-    = SVN_CONFIG_DEFAULT_OPTION_STORE_PLAINTEXT_PASSWORDS;
-  svn_boolean_t store_pp = SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP;
-  const char *store_pp_plaintext
-    = SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT;
 
   /* Initialize the return variable. */
   *session_p = NULL;
@@ -294,100 +285,27 @@ svn_error_t *svn_ra_open4(svn_ra_session
                              repos_URL);
 
   if (callbacks->auth_baton)
-    {
-      /* The 'store-passwords' and 'store-auth-creds' parameters used to
-       * live in SVN_CONFIG_CATEGORY_CONFIG. For backward compatibility,
-       * if values for these parameters have already been set by our
-       * callers, we use those values as defaults.
-       *
-       * Note that we can only catch the case where users explicitly set
-       * "store-passwords = no" or 'store-auth-creds = no".
-       *
-       * However, since the default value for both these options is
-       * currently (and has always been) "yes", users won't know
-       * the difference if they set "store-passwords = yes" or
-       * "store-auth-creds = yes" -- they'll get the expected behaviour.
-       */
-
-      if (svn_auth_get_parameter(callbacks->auth_baton,
-                                 SVN_AUTH_PARAM_DONT_STORE_PASSWORDS) != NULL)
-        store_passwords = FALSE;
-
-      if (svn_auth_get_parameter(callbacks->auth_baton,
-                                 SVN_AUTH_PARAM_NO_AUTH_CACHE) != NULL)
-        store_auth_creds = FALSE;
-    }
+    SVN_ERR(svn_auth__apply_config_for_server(callbacks->auth_baton, config,
+                                              repos_URI.hostname, sesspool));
 
+#ifdef CHOOSABLE_DAV_MODULE
   if (config)
     {
+      svn_config_t *servers = NULL;
+      const char *server_group = NULL;
+
       /* Grab the 'servers' config. */
       servers = svn_hash_gets(config, SVN_CONFIG_CATEGORY_SERVERS);
       if (servers)
         {
           /* First, look in the global section. */
 
-          SVN_ERR(svn_config_get_bool
-            (servers, &store_passwords, SVN_CONFIG_SECTION_GLOBAL,
-             SVN_CONFIG_OPTION_STORE_PASSWORDS,
-             store_passwords));
-
-          SVN_ERR(svn_config_get_yes_no_ask
-            (servers, &store_plaintext_passwords, SVN_CONFIG_SECTION_GLOBAL,
-             SVN_CONFIG_OPTION_STORE_PLAINTEXT_PASSWORDS,
-             SVN_CONFIG_DEFAULT_OPTION_STORE_PLAINTEXT_PASSWORDS));
-
-          SVN_ERR(svn_config_get_bool
-            (servers, &store_pp, SVN_CONFIG_SECTION_GLOBAL,
-             SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP,
-             store_pp));
-
-          SVN_ERR(svn_config_get_yes_no_ask
-            (servers, &store_pp_plaintext,
-             SVN_CONFIG_SECTION_GLOBAL,
-             SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT,
-             SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT));
-
-          SVN_ERR(svn_config_get_bool
-            (servers, &store_auth_creds, SVN_CONFIG_SECTION_GLOBAL,
-              SVN_CONFIG_OPTION_STORE_AUTH_CREDS,
-              store_auth_creds));
-
           /* Find out where we're about to connect to, and
            * try to pick a server group based on the destination. */
           server_group = svn_config_find_group(servers, repos_URI.hostname,
                                                SVN_CONFIG_SECTION_GROUPS,
                                                sesspool);
 
-          if (server_group)
-            {
-              /* Override global auth caching parameters with the ones
-               * for the server group, if any. */
-              SVN_ERR(svn_config_get_bool(servers, &store_auth_creds,
-                                          server_group,
-                                          SVN_CONFIG_OPTION_STORE_AUTH_CREDS,
-                                          store_auth_creds));
-
-              SVN_ERR(svn_config_get_bool(servers, &store_passwords,
-                                          server_group,
-                                          SVN_CONFIG_OPTION_STORE_PASSWORDS,
-                                          store_passwords));
-
-              SVN_ERR(svn_config_get_yes_no_ask
-                (servers, &store_plaintext_passwords, server_group,
-                 SVN_CONFIG_OPTION_STORE_PLAINTEXT_PASSWORDS,
-                 store_plaintext_passwords));
-
-              SVN_ERR(svn_config_get_bool
-                (servers, &store_pp,
-                 server_group, SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP,
-                 store_pp));
-
-              SVN_ERR(svn_config_get_yes_no_ask
-                (servers, &store_pp_plaintext, server_group,
-                 SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT,
-                 store_pp_plaintext));
-            }
-#ifdef CHOOSABLE_DAV_MODULE
           /* Now, which DAV-based RA method do we want to use today? */
           http_library
             = svn_config_get_server_setting(servers,
@@ -400,38 +318,9 @@ svn_error_t *svn_ra_open4(svn_ra_session
                                      _("Invalid config: unknown HTTP library "
                                        "'%s'"),
                                      http_library);
-#endif
         }
     }
-
-  if (callbacks->auth_baton)
-    {
-      /* Save auth caching parameters in the auth parameter hash. */
-      if (! store_passwords)
-        svn_auth_set_parameter(callbacks->auth_baton,
-                               SVN_AUTH_PARAM_DONT_STORE_PASSWORDS, "");
-
-      svn_auth_set_parameter(callbacks->auth_baton,
-                             SVN_AUTH_PARAM_STORE_PLAINTEXT_PASSWORDS,
-                             store_plaintext_passwords);
-
-      if (! store_pp)
-        svn_auth_set_parameter(callbacks->auth_baton,
-                               SVN_AUTH_PARAM_DONT_STORE_SSL_CLIENT_CERT_PP,
-                               "");
-
-      svn_auth_set_parameter(callbacks->auth_baton,
-                             SVN_AUTH_PARAM_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT,
-                             store_pp_plaintext);
-
-      if (! store_auth_creds)
-        svn_auth_set_parameter(callbacks->auth_baton,
-                               SVN_AUTH_PARAM_NO_AUTH_CACHE, "");
-
-      if (server_group)
-        svn_auth_set_parameter(callbacks->auth_baton,
-                               SVN_AUTH_PARAM_SERVER_GROUP, server_group);
-    }
+#endif
 
   /* Find the library. */
   for (defn = ra_libraries; defn->ra_name != NULL; ++defn)

Modified: subversion/branches/pin-externals/subversion/libsvn_ra_serf/commit.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/commit.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/commit.c 
(original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/commit.c Sun 
Feb  8 03:10:25 2015
@@ -1609,7 +1609,7 @@ change_dir_prop(void *dir_baton,
   prop = apr_palloc(dir->pool, sizeof(*prop));
 
   prop->name = apr_pstrdup(dir->pool, name);
-  prop->value = value ? svn_string_dup(value, dir->pool) : NULL;
+  prop->value = svn_string_dup(value, dir->pool);
 
   svn_hash_sets(dir->prop_changes, prop->name, prop);
 
@@ -1879,7 +1879,7 @@ change_file_prop(void *file_baton,
   prop = apr_palloc(file->pool, sizeof(*prop));
 
   prop->name = apr_pstrdup(file->pool, name);
-  prop->value = value ? svn_string_dup(value, file->pool) : NULL;
+  prop->value = svn_string_dup(value, file->pool);
 
   svn_hash_sets(file->prop_changes, prop->name, prop);
 

Modified: subversion/branches/pin-externals/subversion/libsvn_repos/hooks.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_repos/hooks.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_repos/hooks.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_repos/hooks.c Sun Feb  
8 03:10:25 2015
@@ -522,10 +522,19 @@ lock_token_content(apr_file_t **handle,
       const char *token = apr_hash_this_key(hi);
       const char *path = apr_hash_this_val(hi);
 
+      if (path == (const char *) 1)
+        {
+          /* Special handling for svn_fs_access_t * created by using deprecated
+             svn_fs_access_add_lock_token() function. */
+          path = "";
+        }
+      else
+        {
+          path = svn_path_uri_autoescape(path, pool);
+        }
+
       svn_stringbuf_appendstr(lock_str,
-        svn_stringbuf_createf(pool, "%s|%s\n",
-                              svn_path_uri_autoescape(path, pool),
-                              token));
+          svn_stringbuf_createf(pool, "%s|%s\n", path, token));
     }
 
   svn_stringbuf_appendcstr(lock_str, "\n");

Modified: subversion/branches/pin-externals/subversion/libsvn_repos/log.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_repos/log.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_repos/log.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_repos/log.c Sun Feb  8 
03:10:25 2015
@@ -168,18 +168,23 @@ svn_repos_check_revision_access(svn_repo
  * AUTHZ_READ_BATON and FS) to check whether each changed-path (and
  * copyfrom_path) is readable:
  *
+ *     - If absolutely every changed-path (and copyfrom_path) is
+ *     readable, then return the full CHANGED hash, and set
+ *     *ACCESS_LEVEL to svn_repos_revision_access_full.
+ *
  *     - If some paths are readable and some are not, then silently
- *     omit the unreadable paths from the CHANGED hash, and return
- *     SVN_ERR_AUTHZ_PARTIALLY_READABLE.
+ *     omit the unreadable paths from the CHANGED hash, and set
+ *     *ACCESS_LEVEL to svn_repos_revision_access_partial.
  *
  *     - If absolutely every changed-path (and copyfrom_path) is
- *     unreadable, then return an empty CHANGED hash and
- *     SVN_ERR_AUTHZ_UNREADABLE.  (This is to distinguish a revision
- *     which truly has no changed paths from a revision in which all
- *     paths are unreadable.)
+ *     unreadable, then return an empty CHANGED hash, and set
+ *     *ACCESS_LEVEL to svn_repos_revision_access_none.  (This is
+ *     to distinguish a revision which truly has no changed paths
+ *     from a revision in which all paths are unreadable.)
  */
 static svn_error_t *
-detect_changed(apr_hash_t **changed,
+detect_changed(svn_repos_revision_access_level_t *access_level,
+               apr_hash_t **changed,
                svn_fs_root_t *root,
                svn_fs_t *fs,
                apr_hash_t *prefetched_changes,
@@ -213,9 +218,12 @@ detect_changed(apr_hash_t **changed,
     }
 
   if (apr_hash_count(changes) == 0)
-    /* No paths changed in this revision?  Uh, sure, I guess the
-       revision is readable, then.  */
-    return SVN_NO_ERROR;
+    {
+      /* No paths changed in this revision?  Uh, sure, I guess the
+         revision is readable, then.  */
+      *access_level = svn_repos_revision_access_full;
+      return SVN_NO_ERROR;
+    }
 
   iterpool = svn_pool_create(pool);
   for (hi = apr_hash_first(pool, changes); hi; hi = apr_hash_next(hi))
@@ -364,16 +372,21 @@ detect_changed(apr_hash_t **changed,
   svn_pool_destroy(iterpool);
 
   if (! found_readable)
-    /* Every changed-path was unreadable. */
-    return svn_error_create(SVN_ERR_AUTHZ_UNREADABLE,
-                            NULL, NULL);
-
-  if (found_unreadable)
-    /* At least one changed-path was unreadable. */
-    return svn_error_create(SVN_ERR_AUTHZ_PARTIALLY_READABLE,
-                            NULL, NULL);
+    {
+      /* Every changed-path was unreadable. */
+      *access_level = svn_repos_revision_access_none;
+    }
+  else if (found_unreadable)
+    {
+      /* At least one changed-path was unreadable. */
+      *access_level = svn_repos_revision_access_partial;
+    }
+  else
+    {
+      /* Every changed-path was readable. */
+      *access_level = svn_repos_revision_access_full;
+    }
 
-  /* Every changed-path was readable. */
   return SVN_NO_ERROR;
 }
 
@@ -1078,33 +1091,27 @@ fill_log_entry(svn_log_entry_t *log_entr
       && (authz_read_func || discover_changed_paths))
     {
       svn_fs_root_t *newroot;
-      svn_error_t *patherr;
+      svn_repos_revision_access_level_t access_level;
 
       SVN_ERR(svn_fs_revision_root(&newroot, fs, rev, pool));
-      patherr = detect_changed(&changed_paths,
-                               newroot, fs, prefetched_changes,
-                               authz_read_func, authz_read_baton,
-                               pool);
+      SVN_ERR(detect_changed(&access_level, &changed_paths,
+                             newroot, fs, prefetched_changes,
+                             authz_read_func, authz_read_baton,
+                             pool));
 
-      if (patherr
-          && patherr->apr_err == SVN_ERR_AUTHZ_UNREADABLE)
+      if (access_level == svn_repos_revision_access_none)
         {
           /* All changed-paths are unreadable, so clear all fields. */
-          svn_error_clear(patherr);
           changed_paths = NULL;
           get_revprops = FALSE;
         }
-      else if (patherr
-               && patherr->apr_err == SVN_ERR_AUTHZ_PARTIALLY_READABLE)
+      else if (access_level == svn_repos_revision_access_partial)
         {
           /* At least one changed-path was unreadable, so censor all
              but author and date.  (The unreadable paths are already
              missing from the hash.) */
-          svn_error_clear(patherr);
           censor_revprops = TRUE;
         }
-      else if (patherr)
-        return patherr;
 
       /* It may be the case that an authz func was passed in, but
          the user still doesn't want to see any changed-paths. */

Modified: subversion/branches/pin-externals/subversion/libsvn_repos/reporter.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_repos/reporter.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_repos/reporter.c 
(original)
+++ subversion/branches/pin-externals/subversion/libsvn_repos/reporter.c Sun 
Feb  8 03:10:25 2015
@@ -495,8 +495,8 @@ get_revision_info(report_baton_t *b,
       /* Create a result object */
       info = apr_palloc(b->pool, sizeof(*info));
       info->rev = rev;
-      info->date = cdate ? svn_string_dup(cdate, b->pool) : NULL;
-      info->author = author ? svn_string_dup(author, b->pool) : NULL;
+      info->date = svn_string_dup(cdate, b->pool);
+      info->author = svn_string_dup(author, b->pool);
 
       /* Cache it */
       apr_hash_set(b->revision_infos, &info->rev, sizeof(info->rev), info);

Modified: subversion/branches/pin-externals/subversion/libsvn_subr/auth.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_subr/auth.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_subr/auth.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_subr/auth.c Sun Feb  8 
03:10:25 2015
@@ -685,3 +685,143 @@ svn_auth_get_platform_specific_client_pr
 
   return SVN_NO_ERROR;
 }
+
+svn_error_t *
+svn_auth__apply_config_for_server(svn_auth_baton_t *auth_baton,
+                                  apr_hash_t *config,
+                                  const char *server_name,
+                                  apr_pool_t *scratch_pool)
+{
+  svn_boolean_t store_passwords = SVN_CONFIG_DEFAULT_OPTION_STORE_PASSWORDS;
+  svn_boolean_t store_auth_creds = SVN_CONFIG_DEFAULT_OPTION_STORE_AUTH_CREDS;
+  const char *store_plaintext_passwords
+    = SVN_CONFIG_DEFAULT_OPTION_STORE_PLAINTEXT_PASSWORDS;
+  svn_boolean_t store_pp = SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP;
+  const char *store_pp_plaintext
+    = SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT;
+  svn_config_t *servers = NULL;
+  const char *server_group = NULL;
+
+  /* The 'store-passwords' and 'store-auth-creds' parameters used to
+  * live in SVN_CONFIG_CATEGORY_CONFIG. For backward compatibility,
+  * if values for these parameters have already been set by our
+  * callers, we use those values as defaults.
+  *
+  * Note that we can only catch the case where users explicitly set
+  * "store-passwords = no" or 'store-auth-creds = no".
+  *
+  * However, since the default value for both these options is
+  * currently (and has always been) "yes", users won't know
+  * the difference if they set "store-passwords = yes" or
+  * "store-auth-creds = yes" -- they'll get the expected behaviour.
+  */
+
+  if (svn_auth_get_parameter(auth_baton,
+                              SVN_AUTH_PARAM_DONT_STORE_PASSWORDS) != NULL)
+    store_passwords = FALSE;
+
+  if (svn_auth_get_parameter(auth_baton,
+                              SVN_AUTH_PARAM_NO_AUTH_CACHE) != NULL)
+    store_auth_creds = FALSE;
+
+  if (config)
+    {
+      /* Grab the 'servers' config. */
+      servers = svn_hash_gets(config, SVN_CONFIG_CATEGORY_SERVERS);
+      if (servers)
+        {
+          /* First, look in the global section. */
+
+          SVN_ERR(svn_config_get_bool
+            (servers, &store_passwords, SVN_CONFIG_SECTION_GLOBAL,
+             SVN_CONFIG_OPTION_STORE_PASSWORDS,
+             store_passwords));
+
+          SVN_ERR(svn_config_get_yes_no_ask
+            (servers, &store_plaintext_passwords, SVN_CONFIG_SECTION_GLOBAL,
+             SVN_CONFIG_OPTION_STORE_PLAINTEXT_PASSWORDS,
+             SVN_CONFIG_DEFAULT_OPTION_STORE_PLAINTEXT_PASSWORDS));
+
+          SVN_ERR(svn_config_get_bool
+            (servers, &store_pp, SVN_CONFIG_SECTION_GLOBAL,
+             SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP,
+             store_pp));
+
+          SVN_ERR(svn_config_get_yes_no_ask
+            (servers, &store_pp_plaintext,
+             SVN_CONFIG_SECTION_GLOBAL,
+             SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT,
+             SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT));
+
+          SVN_ERR(svn_config_get_bool
+            (servers, &store_auth_creds, SVN_CONFIG_SECTION_GLOBAL,
+              SVN_CONFIG_OPTION_STORE_AUTH_CREDS,
+              store_auth_creds));
+
+          /* Find out where we're about to connect to, and
+           * try to pick a server group based on the destination. */
+          server_group = svn_config_find_group(servers, server_name,
+                                               SVN_CONFIG_SECTION_GROUPS,
+                                               scratch_pool);
+
+          if (server_group)
+            {
+              /* Override global auth caching parameters with the ones
+               * for the server group, if any. */
+              SVN_ERR(svn_config_get_bool(servers, &store_auth_creds,
+                                          server_group,
+                                          SVN_CONFIG_OPTION_STORE_AUTH_CREDS,
+                                          store_auth_creds));
+
+              SVN_ERR(svn_config_get_bool(servers, &store_passwords,
+                                          server_group,
+                                          SVN_CONFIG_OPTION_STORE_PASSWORDS,
+                                          store_passwords));
+
+              SVN_ERR(svn_config_get_yes_no_ask
+                (servers, &store_plaintext_passwords, server_group,
+                 SVN_CONFIG_OPTION_STORE_PLAINTEXT_PASSWORDS,
+                 store_plaintext_passwords));
+
+              SVN_ERR(svn_config_get_bool
+                (servers, &store_pp,
+                 server_group, SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP,
+                 store_pp));
+
+              SVN_ERR(svn_config_get_yes_no_ask
+                (servers, &store_pp_plaintext, server_group,
+                 SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT,
+                 store_pp_plaintext));
+            }
+        }
+    }
+
+  /* Save auth caching parameters in the auth parameter hash. */
+  if (! store_passwords)
+    svn_auth_set_parameter(auth_baton,
+                           SVN_AUTH_PARAM_DONT_STORE_PASSWORDS, "");
+
+  svn_auth_set_parameter(auth_baton,
+                         SVN_AUTH_PARAM_STORE_PLAINTEXT_PASSWORDS,
+                         store_plaintext_passwords);
+
+  if (! store_pp)
+    svn_auth_set_parameter(auth_baton,
+                           SVN_AUTH_PARAM_DONT_STORE_SSL_CLIENT_CERT_PP,
+                           "");
+
+  svn_auth_set_parameter(auth_baton,
+                         SVN_AUTH_PARAM_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT,
+                         store_pp_plaintext);
+
+  if (! store_auth_creds)
+    svn_auth_set_parameter(auth_baton,
+                            SVN_AUTH_PARAM_NO_AUTH_CACHE, "");
+
+  if (server_group)
+    svn_auth_set_parameter(auth_baton,
+                           SVN_AUTH_PARAM_SERVER_GROUP,
+                           apr_pstrdup(auth_baton->pool, server_group));
+
+  return SVN_NO_ERROR;
+}

Modified: 
subversion/branches/pin-externals/subversion/libsvn_subr/cache-membuffer.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_subr/cache-membuffer.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_subr/cache-membuffer.c 
(original)
+++ subversion/branches/pin-externals/subversion/libsvn_subr/cache-membuffer.c 
Sun Feb  8 03:10:25 2015
@@ -123,7 +123,7 @@
  * Use a simple mutex on Windows.  Because there is one mutex per segment,
  * large machines should (and usually can) be configured with large caches
  * such that read contention is kept low.  This is basically the situation
- * we head before 1.8.
+ * we had before 1.8.
  */
 #ifdef WIN32
 #  define USE_SIMPLE_MUTEX 1
@@ -587,16 +587,15 @@ struct svn_membuffer_t
    */
   apr_uint64_t total_hits;
 
-#if APR_HAS_THREADS
+#if (APR_HAS_THREADS && USE_SIMPLE_MUTEX)
   /* A lock for intra-process synchronization to the cache, or NULL if
    * the cache's creator doesn't feel the cache needs to be
    * thread-safe.
    */
-#  if USE_SIMPLE_MUTEX
   svn_mutex__t *lock;
-#  else
+#elif (APR_HAS_THREADS && !USE_SIMPLE_MUTEX)
+  /* Same for read-write lock. */
   apr_thread_rwlock_t *lock;
-#  endif
 
   /* If set, write access will wait until they get exclusive access.
    * Otherwise, they will become no-ops if the segment is currently
@@ -619,33 +618,32 @@ struct svn_membuffer_t
 static svn_error_t *
 read_lock_cache(svn_membuffer_t *cache)
 {
-#if APR_HAS_THREADS
-#  if USE_SIMPLE_MUTEX
+#if (APR_HAS_THREADS && USE_SIMPLE_MUTEX)
   return svn_mutex__lock(cache->lock);
-#  else
+#elif (APR_HAS_THREADS && !USE_SIMPLE_MUTEX)
   if (cache->lock)
   {
     apr_status_t status = apr_thread_rwlock_rdlock(cache->lock);
     if (status)
       return svn_error_wrap_apr(status, _("Can't lock cache mutex"));
   }
-#  endif
-#endif
+
+  return SVN_NO_ERROR;
+#else
   return SVN_NO_ERROR;
+#endif
 }
 
 /* If locking is supported for CACHE, acquire a write lock for it.
+ * Set *SUCCESS to FALSE, if we couldn't acquire the write lock;
+ * leave it untouched otherwise.
  */
 static svn_error_t *
 write_lock_cache(svn_membuffer_t *cache, svn_boolean_t *success)
 {
-#if APR_HAS_THREADS
-#  if USE_SIMPLE_MUTEX
-
+#if (APR_HAS_THREADS && USE_SIMPLE_MUTEX)
   return svn_mutex__lock(cache->lock);
-
-#  else
-
+#elif (APR_HAS_THREADS && !USE_SIMPLE_MUTEX)
   if (cache->lock)
     {
       apr_status_t status;
@@ -668,9 +666,10 @@ write_lock_cache(svn_membuffer_t *cache,
                                   _("Can't write-lock cache mutex"));
     }
 
-#  endif
-#endif
   return SVN_NO_ERROR;
+#else
+  return SVN_NO_ERROR;
+#endif
 }
 
 /* If locking is supported for CACHE, acquire an unconditional write lock
@@ -679,36 +678,29 @@ write_lock_cache(svn_membuffer_t *cache,
 static svn_error_t *
 force_write_lock_cache(svn_membuffer_t *cache)
 {
-#if APR_HAS_THREADS
-#  if USE_SIMPLE_MUTEX
-
+#if (APR_HAS_THREADS && USE_SIMPLE_MUTEX)
   return svn_mutex__lock(cache->lock);
-
-#  else
-
+#elif (APR_HAS_THREADS && !USE_SIMPLE_MUTEX)
   apr_status_t status = apr_thread_rwlock_wrlock(cache->lock);
   if (status)
     return svn_error_wrap_apr(status,
                               _("Can't write-lock cache mutex"));
 
-#  endif
-#endif
   return SVN_NO_ERROR;
+#else
+  return SVN_NO_ERROR;
+#endif
 }
 
 /* If locking is supported for CACHE, release the current lock
- * (read or write).
+ * (read or write).  Return ERR upon success.
  */
 static svn_error_t *
 unlock_cache(svn_membuffer_t *cache, svn_error_t *err)
 {
-#if APR_HAS_THREADS
-#  if USE_SIMPLE_MUTEX
-
+#if (APR_HAS_THREADS && USE_SIMPLE_MUTEX)
   return svn_mutex__unlock(cache->lock, err);
-
-#  else
-
+#elif (APR_HAS_THREADS && !USE_SIMPLE_MUTEX)
   if (cache->lock)
   {
     apr_status_t status = apr_thread_rwlock_unlock(cache->lock);
@@ -719,13 +711,14 @@ unlock_cache(svn_membuffer_t *cache, svn
       return svn_error_wrap_apr(status, _("Can't unlock cache mutex"));
   }
 
-#  endif
-#endif
   return err;
+#else
+  return err;
+#endif
 }
 
-/* If supported, guard the execution of EXPR with a read lock to cache.
- * Macro has been modeled after SVN_MUTEX__WITH_LOCK.
+/* If supported, guard the execution of EXPR with a read lock to CACHE.
+ * The macro has been modeled after SVN_MUTEX__WITH_LOCK.
  */
 #define WITH_READ_LOCK(cache, expr)         \
 do {                                        \
@@ -733,8 +726,8 @@ do {
   SVN_ERR(unlock_cache(cache, (expr)));     \
 } while (0)
 
-/* If supported, guard the execution of EXPR with a write lock to cache.
- * Macro has been modeled after SVN_MUTEX__WITH_LOCK.
+/* If supported, guard the execution of EXPR with a write lock to CACHE.
+ * The macro has been modeled after SVN_MUTEX__WITH_LOCK.
  *
  * The write lock process is complicated if we don't allow to wait for
  * the lock: If we didn't get the lock, we may still need to remove an
@@ -1797,17 +1790,14 @@ svn_cache__membuffer_cache_create(svn_me
           return svn_error_wrap_apr(APR_ENOMEM, "OOM");
         }
 
-#if APR_HAS_THREADS
+#if (APR_HAS_THREADS && USE_SIMPLE_MUTEX)
       /* A lock for intra-process synchronization to the cache, or NULL if
        * the cache's creator doesn't feel the cache needs to be
        * thread-safe.
        */
-#  if USE_SIMPLE_MUTEX
-
       SVN_ERR(svn_mutex__init(&c[seg].lock, thread_safe, pool));
-
-#  else
-
+#elif (APR_HAS_THREADS && !USE_SIMPLE_MUTEX)
+      /* Same for read-write lock. */
       c[seg].lock = NULL;
       if (thread_safe)
         {
@@ -1817,8 +1807,6 @@ svn_cache__membuffer_cache_create(svn_me
             return svn_error_wrap_apr(status, _("Can't create cache mutex"));
         }
 
-#  endif
-
       /* Select the behavior of write operations.
        */
       c[seg].allow_blocking_writes = allow_blocking_writes;

Modified: subversion/branches/pin-externals/subversion/libsvn_subr/io.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_subr/io.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_subr/io.c Sun Feb  8 
03:10:25 2015
@@ -352,6 +352,25 @@ file_open(apr_file_t **f,
 
   if (retry_on_failure)
     {
+#ifdef WIN32
+      if (status == APR_FROM_OS_ERROR(ERROR_ACCESS_DENIED))
+        {
+          if ((flag & (APR_CREATE | APR_EXCL)) == (APR_CREATE | APR_EXCL))
+            return status; /* Can't create if there is something */
+
+          if (flag & (APR_WRITE | APR_CREATE))
+            {
+              apr_finfo_t finfo;
+
+              if (!apr_stat(&finfo, fname_apr, SVN__APR_FINFO_READONLY, pool))
+                {
+                  if (finfo.protection & APR_FREADONLY)
+                    return status; /* Retrying won't fix this */
+                }
+            }
+        }
+#endif
+
       WIN32_RETRY_LOOP(status, apr_file_open(f, fname_apr, flag, perm, pool));
     }
   return status;

Modified: subversion/branches/pin-externals/subversion/libsvn_subr/string.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_subr/string.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_subr/string.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_subr/string.c Sun Feb  
8 03:10:25 2015
@@ -301,8 +301,9 @@ svn_string_isempty(const svn_string_t *s
 svn_string_t *
 svn_string_dup(const svn_string_t *original_string, apr_pool_t *pool)
 {
-  return (svn_string_ncreate(original_string->data,
-                             original_string->len, pool));
+  return (original_string ? svn_string_ncreate(original_string->data,
+                                               original_string->len, pool)
+                          : NULL);
 }
 
 

Modified: subversion/branches/pin-externals/subversion/libsvn_wc/copy.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_wc/copy.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_wc/copy.c Sun Feb  8 
03:10:25 2015
@@ -42,6 +42,7 @@
 #include "svn_private_config.h"
 #include "private/svn_wc_private.h"
 
+/* #define RECORD_MIXED_MOVE */
 
 /*** Code. ***/
 
@@ -567,10 +568,10 @@ copy_versioned_dir(svn_wc__db_t *db,
  * The additional parameter IS_MOVE indicates whether this is a copy or
  * a move operation.
  *
- * If MOVE_DEGRADED_TO_COPY is not NULL and a move had to be degraded
- * to a copy, then set *MOVE_DEGRADED_TO_COPY. */
+ * If RECORD_MOVE_ON_DELETE is not NULL and a move had to be degraded
+ * to a copy, then set *RECORD_MOVE_ON_DELETE to FALSE. */
 static svn_error_t *
-copy_or_move(svn_boolean_t *move_degraded_to_copy,
+copy_or_move(svn_boolean_t *record_move_on_delete,
              svn_wc_context_t *wc_ctx,
              const char *src_abspath,
              const char *dst_abspath,
@@ -820,8 +821,8 @@ copy_or_move(svn_boolean_t *move_degrade
   if (is_move
       && !within_one_wc)
     {
-      if (move_degraded_to_copy)
-        *move_degraded_to_copy = TRUE;
+      if (record_move_on_delete)
+        *record_move_on_delete = FALSE;
 
       is_move = FALSE;
     }
@@ -865,9 +866,11 @@ copy_or_move(svn_boolean_t *move_degrade
                                                                 scratch_pool),
                                          min_rev, max_rev);
 
+#ifndef RECORD_MIXED_MOVE
               is_move = FALSE;
-              if (move_degraded_to_copy)
-                *move_degraded_to_copy = TRUE;
+              if (record_move_on_delete)
+                *record_move_on_delete = FALSE;
+#endif
             }
         }
 
@@ -1054,7 +1057,7 @@ svn_wc__move2(svn_wc_context_t *wc_ctx,
               apr_pool_t *scratch_pool)
 {
   svn_wc__db_t *db = wc_ctx->db;
-  svn_boolean_t move_degraded_to_copy = FALSE;
+  svn_boolean_t record_on_delete = TRUE;
   svn_node_kind_t kind;
   svn_boolean_t conflicted;
 
@@ -1066,7 +1069,7 @@ svn_wc__move2(svn_wc_context_t *wc_ctx,
                               svn_dirent_dirname(dst_abspath, scratch_pool),
                               scratch_pool));
 
-  SVN_ERR(copy_or_move(&move_degraded_to_copy,
+  SVN_ERR(copy_or_move(&record_on_delete,
                        wc_ctx, src_abspath, dst_abspath,
                        TRUE /* metadata_only */,
                        TRUE /* is_move */,
@@ -1109,7 +1112,7 @@ svn_wc__move2(svn_wc_context_t *wc_ctx,
                                          scratch_pool));
 
   SVN_ERR(svn_wc__db_op_delete(db, src_abspath,
-                               move_degraded_to_copy ? NULL : dst_abspath,
+                               record_on_delete ? dst_abspath : NULL,
                                TRUE /* delete_dir_externals */,
                                NULL /* conflict */, NULL /* work_items */,
                                cancel_func, cancel_baton,

Modified: subversion/branches/pin-externals/subversion/libsvn_wc/diff_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_wc/diff_editor.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_wc/diff_editor.c 
(original)
+++ subversion/branches/pin-externals/subversion/libsvn_wc/diff_editor.c Sun 
Feb  8 03:10:25 2015
@@ -2192,7 +2192,7 @@ change_file_prop(void *file_baton,
 
   propchange = apr_array_push(fb->propchanges);
   propchange->name = apr_pstrdup(fb->pool, name);
-  propchange->value = value ? svn_string_dup(value, fb->pool) : NULL;
+  propchange->value = svn_string_dup(value, fb->pool);
 
   return SVN_NO_ERROR;
 }
@@ -2217,7 +2217,7 @@ change_dir_prop(void *dir_baton,
 
   propchange = apr_array_push(db->propchanges);
   propchange->name = apr_pstrdup(db->pool, name);
-  propchange->value = value ? svn_string_dup(value, db->pool) : NULL;
+  propchange->value = svn_string_dup(value, db->pool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/pin-externals/subversion/libsvn_wc/externals.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_wc/externals.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_wc/externals.c 
(original)
+++ subversion/branches/pin-externals/subversion/libsvn_wc/externals.c Sun Feb  
8 03:10:25 2015
@@ -659,7 +659,7 @@ change_file_prop(void *file_baton,
 
   propchange = apr_array_push(eb->propchanges);
   propchange->name = apr_pstrdup(eb->pool, name);
-  propchange->value = value ? svn_string_dup(value, eb->pool) : NULL;
+  propchange->value = svn_string_dup(value, eb->pool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/pin-externals/subversion/libsvn_wc/props.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_wc/props.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_wc/props.c Sun Feb  8 
03:10:25 2015
@@ -1272,7 +1272,7 @@ svn_wc__merge_props(svn_skel_t **conflic
 
       svn_pool_clear(iterpool);
 
-      to_val = to_val ? svn_string_dup(to_val, result_pool) : NULL;
+      to_val = svn_string_dup(to_val, result_pool);
 
       svn_hash_sets(their_props, propname, to_val);
 

Modified: subversion/branches/pin-externals/subversion/libsvn_wc/update_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_wc/update_editor.c?rev=1658128&r1=1658127&r2=1658128&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_wc/update_editor.c 
(original)
+++ subversion/branches/pin-externals/subversion/libsvn_wc/update_editor.c Sun 
Feb  8 03:10:25 2015
@@ -2112,13 +2112,12 @@ add_directory(const char *path,
       if (tree_conflict)
         {
           svn_wc_conflict_reason_t reason;
+          const char *move_src_op_root_abspath;
           /* So this deletion wasn't just a deletion, it is actually a
              replacement. Let's install a better tree conflict. */
 
-          /* ### Should store the conflict in DB to allow reinstalling
-             ### with theoretically more data in close_directory() */
-
-          SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, NULL, NULL,
+          SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, NULL,
+                                                     &move_src_op_root_abspath,
                                                       eb->db,
                                                       db->local_abspath,
                                                       tree_conflict,
@@ -2130,7 +2129,7 @@ add_directory(const char *path,
                                         tree_conflict,
                                         eb->db, db->local_abspath,
                                         reason, svn_wc_conflict_action_replace,
-                                        NULL,
+                                        move_src_op_root_abspath,
                                         db->pool, scratch_pool));
 
           /* And now stop checking for conflicts here and just perform
@@ -2489,7 +2488,7 @@ change_dir_prop(void *dir_baton,
 
   propchange = apr_array_push(db->propchanges);
   propchange->name = apr_pstrdup(db->pool, name);
-  propchange->value = value ? svn_string_dup(value, db->pool) : NULL;
+  propchange->value = svn_string_dup(value, db->pool);
 
   if (!db->edited && svn_property_kind2(name) == svn_prop_regular_kind)
     SVN_ERR(mark_directory_edited(db, pool));
@@ -3287,13 +3286,12 @@ add_file(const char *path,
       if (tree_conflict)
         {
           svn_wc_conflict_reason_t reason;
+          const char *move_src_op_root_abspath;
           /* So this deletion wasn't just a deletion, it is actually a
              replacement. Let's install a better tree conflict. */
 
-          /* ### Should store the conflict in DB to allow reinstalling
-             ### with theoretically more data in close_directory() */
-
-          SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, NULL, NULL,
+          SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, NULL,
+                                                     &move_src_op_root_abspath,
                                                       eb->db,
                                                       fb->local_abspath,
                                                       tree_conflict,
@@ -3305,7 +3303,7 @@ add_file(const char *path,
                                         tree_conflict,
                                         eb->db, fb->local_abspath,
                                         reason, svn_wc_conflict_action_replace,
-                                        NULL,
+                                        move_src_op_root_abspath,
                                         fb->pool, fb->pool));
 
           /* And now stop checking for conflicts here and just perform
@@ -3805,7 +3803,7 @@ change_file_prop(void *file_baton,
   /* Push a new propchange to the file baton's array of propchanges */
   propchange = apr_array_push(fb->propchanges);
   propchange->name = apr_pstrdup(fb->pool, name);
-  propchange->value = value ? svn_string_dup(value, fb->pool) : NULL;
+  propchange->value = svn_string_dup(value, fb->pool);
 
   if (!fb->edited && svn_property_kind2(name) == svn_prop_regular_kind)
     SVN_ERR(mark_file_edited(fb, scratch_pool));


Reply via email to