You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2015/01/16 15:01:37 UTC

svn commit: r1652409 [13/18] - in /subversion/branches/svn-auth-x509: ./ notes/ subversion/bindings/swig/ subversion/bindings/swig/include/ subversion/bindings/swig/perl/native/ subversion/bindings/swig/perl/native/t/ subversion/bindings/swig/python/li...

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/tree.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/tree.h?rev=1652409&r1=1652408&r2=1652409&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/tree.h (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/tree.h Fri Jan 16 14:01:35 2015
@@ -33,62 +33,64 @@ extern "C" {
 
 /* In POOL, create an instance of a DAG node 1st level cache.
    The POOL will be cleared at regular intervals. */
-fs_x_dag_cache_t*
+svn_fs_x__dag_cache_t*
 svn_fs_x__create_dag_cache(apr_pool_t *pool);
 
 /* Set *ROOT_P to the root directory of revision REV in filesystem FS.
    Allocate the structure in POOL. */
-svn_error_t *svn_fs_x__revision_root(svn_fs_root_t **root_p, svn_fs_t *fs,
-                                     svn_revnum_t rev, apr_pool_t *pool);
+svn_error_t *
+svn_fs_x__revision_root(svn_fs_root_t **root_p,
+                        svn_fs_t *fs,
+                        svn_revnum_t rev,
+                        apr_pool_t *pool);
 
 /* Does nothing, but included for Subversion 1.0.x compatibility. */
-svn_error_t *svn_fs_x__deltify(svn_fs_t *fs, svn_revnum_t rev,
-                               apr_pool_t *pool);
+svn_error_t *
+svn_fs_x__deltify(svn_fs_t *fs,
+                  svn_revnum_t rev,
+                  apr_pool_t *scratch_pool);
 
 /* Commit the transaction TXN as a new revision.  Return the new
    revision in *NEW_REV.  If the transaction conflicts with other
    changes return SVN_ERR_FS_CONFLICT and set *CONFLICT_P to a string
    that details the cause of the conflict. */
-svn_error_t *svn_fs_x__commit_txn(const char **conflict_p,
-                                  svn_revnum_t *new_rev, svn_fs_txn_t *txn,
-                                  apr_pool_t *pool);
+svn_error_t *
+svn_fs_x__commit_txn(const char **conflict_p,
+                     svn_revnum_t *new_rev,
+                     svn_fs_txn_t *txn,
+                     apr_pool_t *pool);
 
 /* Set ROOT_P to the root directory of transaction TXN.  Allocate the
    structure in POOL. */
-svn_error_t *svn_fs_x__txn_root(svn_fs_root_t **root_p, svn_fs_txn_t *txn,
-                                apr_pool_t *pool);
+svn_error_t *
+svn_fs_x__txn_root(svn_fs_root_t **root_p,
+                   svn_fs_txn_t *txn,
+                   apr_pool_t *pool);
 
 
 /* Set KIND_P to the node kind of the node at PATH in ROOT.
-   Allocate the structure in POOL. */
+   Use SCRATCH_POOL for temporary allocations. */
 svn_error_t *
 svn_fs_x__check_path(svn_node_kind_t *kind_p,
                      svn_fs_root_t *root,
                      const char *path,
-                     apr_pool_t *pool);
-
-/* Implement root_vtable_t.node_id(). */
-svn_error_t *
-svn_fs_x__node_id(const svn_fs_id_t **id_p,
-                  svn_fs_root_t *root,
-                  const char *path,
-                  apr_pool_t *pool);
+                     apr_pool_t *scratch_pool);
 
 /* Set *REVISION to the revision in which PATH under ROOT was created.
-   Use POOL for any temporary allocations.  If PATH is in an
+   Use SCRATCH_POOL for any temporary allocations.  If PATH is in an
    uncommitted transaction, *REVISION will be set to
    SVN_INVALID_REVNUM. */
 svn_error_t *
 svn_fs_x__node_created_rev(svn_revnum_t *revision,
                            svn_fs_root_t *root,
                            const char *path,
-                           apr_pool_t *pool);
+                           apr_pool_t *scratch_pool);
 
 /* Verify metadata for ROOT.
    ### Currently only implemented for revision roots. */
 svn_error_t *
 svn_fs_x__verify_root(svn_fs_root_t *root,
-                      apr_pool_t *pool);
+                      apr_pool_t *scratch_pool);
 
 svn_error_t *
 svn_fs_x__info_format(int *fs_format,

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/util.c?rev=1652409&r1=1652408&r2=1652409&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/util.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/util.c Fri Jan 16 14:01:35 2015
@@ -55,7 +55,7 @@ are likely some errors because of that.
 svn_boolean_t
 svn_fs_x__is_packed_rev(svn_fs_t *fs, svn_revnum_t rev)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
+  svn_fs_x__data_t *ffd = fs->fsap_data;
 
   return (rev < ffd->min_unpacked_rev);
 }
@@ -64,7 +64,7 @@ svn_fs_x__is_packed_rev(svn_fs_t *fs, sv
 svn_boolean_t
 svn_fs_x__is_packed_revprop(svn_fs_t *fs, svn_revnum_t rev)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
+  svn_fs_x__data_t *ffd = fs->fsap_data;
 
   /* rev 0 will not be packed */
   return (rev < ffd->min_unpacked_rev) && (rev != 0);
@@ -73,7 +73,7 @@ svn_fs_x__is_packed_revprop(svn_fs_t *fs
 svn_revnum_t
 svn_fs_x__packed_base_rev(svn_fs_t *fs, svn_revnum_t rev)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
+  svn_fs_x__data_t *ffd = fs->fsap_data;
 
   return rev < ffd->min_unpacked_rev
        ? rev - (rev % ffd->max_files_per_dir)
@@ -83,65 +83,73 @@ svn_fs_x__packed_base_rev(svn_fs_t *fs,
 svn_revnum_t
 svn_fs_x__pack_size(svn_fs_t *fs, svn_revnum_t rev)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
+  svn_fs_x__data_t *ffd = fs->fsap_data;
 
   return rev < ffd->min_unpacked_rev ? ffd->max_files_per_dir : 1;
 }
 
 const char *
-svn_fs_x__path_format(svn_fs_t *fs, apr_pool_t *pool)
+svn_fs_x__path_format(svn_fs_t *fs,
+                      apr_pool_t *result_pool)
 {
-  return svn_dirent_join(fs->path, PATH_FORMAT, pool);
+  return svn_dirent_join(fs->path, PATH_FORMAT, result_pool);
 }
 
 const char *
-svn_fs_x__path_uuid(svn_fs_t *fs, apr_pool_t *pool)
+svn_fs_x__path_uuid(svn_fs_t *fs,
+                    apr_pool_t *result_pool)
 {
-  return svn_dirent_join(fs->path, PATH_UUID, pool);
+  return svn_dirent_join(fs->path, PATH_UUID, result_pool);
 }
 
 const char *
-svn_fs_x__path_current(svn_fs_t *fs, apr_pool_t *pool)
+svn_fs_x__path_current(svn_fs_t *fs,
+                       apr_pool_t *result_pool)
 {
-  return svn_dirent_join(fs->path, PATH_CURRENT, pool);
+  return svn_dirent_join(fs->path, PATH_CURRENT, result_pool);
 }
 
 const char *
-svn_fs_x__path_txn_current(svn_fs_t *fs, apr_pool_t *pool)
+svn_fs_x__path_txn_current(svn_fs_t *fs,
+                           apr_pool_t *result_pool)
 {
-  return svn_dirent_join(fs->path, PATH_TXN_CURRENT, pool);
+  return svn_dirent_join(fs->path, PATH_TXN_CURRENT,
+                         result_pool);
 }
 
 const char *
-svn_fs_x__path_txn_current_lock(svn_fs_t *fs, apr_pool_t *pool)
+svn_fs_x__path_txn_current_lock(svn_fs_t *fs,
+                                apr_pool_t *result_pool)
 {
-  return svn_dirent_join(fs->path, PATH_TXN_CURRENT_LOCK, pool);
+  return svn_dirent_join(fs->path, PATH_TXN_CURRENT_LOCK, result_pool);
 }
 
 const char *
-svn_fs_x__path_lock(svn_fs_t *fs, apr_pool_t *pool)
+svn_fs_x__path_lock(svn_fs_t *fs,
+                    apr_pool_t *result_pool)
 {
-  return svn_dirent_join(fs->path, PATH_LOCK_FILE, pool);
+  return svn_dirent_join(fs->path, PATH_LOCK_FILE, result_pool);
 }
 
 const char *
 svn_fs_x__path_pack_lock(svn_fs_t *fs,
-                         apr_pool_t *pool)
+                         apr_pool_t *result_pool)
 {
-  return svn_dirent_join(fs->path, PATH_PACK_LOCK_FILE, pool);
+  return svn_dirent_join(fs->path, PATH_PACK_LOCK_FILE, result_pool);
 }
 
 const char *
-svn_fs_x__path_revprop_generation(svn_fs_t *fs, apr_pool_t *pool)
+svn_fs_x__path_revprop_generation(svn_fs_t *fs,
+                                  apr_pool_t *result_pool)
 {
-  return svn_dirent_join(fs->path, PATH_REVPROP_GENERATION, pool);
+  return svn_dirent_join(fs->path, PATH_REVPROP_GENERATION, result_pool);
 }
 
 const char *
 svn_fs_x__path_rev_packed(svn_fs_t *fs, svn_revnum_t rev, const char *kind,
                           apr_pool_t *pool)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
+  svn_fs_x__data_t *ffd = fs->fsap_data;
   assert(svn_fs_x__is_packed_rev(fs, rev));
 
   return svn_dirent_join_many(pool, fs->path, PATH_REVS_DIR,
@@ -152,12 +160,16 @@ svn_fs_x__path_rev_packed(svn_fs_t *fs,
 }
 
 const char *
-svn_fs_x__path_rev_shard(svn_fs_t *fs, svn_revnum_t rev, apr_pool_t *pool)
+svn_fs_x__path_rev_shard(svn_fs_t *fs,
+                         svn_revnum_t rev,
+                         apr_pool_t *result_pool)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
-  return svn_dirent_join_many(pool, fs->path, PATH_REVS_DIR,
-                              apr_psprintf(pool, "%ld",
-                                                 rev / ffd->max_files_per_dir),
+  svn_fs_x__data_t *ffd = fs->fsap_data;
+
+  char buffer[SVN_INT64_BUFFER_SIZE];
+  svn__i64toa(buffer, rev / ffd->max_files_per_dir);
+
+  return svn_dirent_join_many(result_pool, fs->path, PATH_REVS_DIR, buffer,
                               SVN_VA_NULL);
 }
 
@@ -184,14 +196,15 @@ svn_fs_x__path_rev_absolute(svn_fs_t *fs
 const char *
 svn_fs_x__path_revprops_shard(svn_fs_t *fs,
                               svn_revnum_t rev,
-                              apr_pool_t *pool)
+                              apr_pool_t *result_pool)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
+  svn_fs_x__data_t *ffd = fs->fsap_data;
 
-  return svn_dirent_join_many(pool, fs->path, PATH_REVPROPS_DIR,
-                              apr_psprintf(pool, "%ld",
-                                           rev / ffd->max_files_per_dir),
-                              SVN_VA_NULL);
+  char buffer[SVN_INT64_BUFFER_SIZE];
+  svn__i64toa(buffer, rev / ffd->max_files_per_dir);
+
+  return svn_dirent_join_many(result_pool, fs->path, PATH_REVPROPS_DIR,
+                              buffer, SVN_VA_NULL);
 }
 
 const char *
@@ -199,7 +212,7 @@ svn_fs_x__path_revprops_pack_shard(svn_f
                                    svn_revnum_t rev,
                                    apr_pool_t *pool)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
+  svn_fs_x__data_t *ffd = fs->fsap_data;
 
   return svn_dirent_join_many(pool, fs->path, PATH_REVPROPS_DIR,
                               apr_psprintf(pool, "%ld" PATH_EXT_PACKED_SHARD,
@@ -217,9 +230,9 @@ svn_fs_x__path_revprops(svn_fs_t *fs, sv
 
 const char *
 svn_fs_x__txn_name(svn_fs_x__txn_id_t txn_id,
-                   apr_pool_t *pool)
+                   apr_pool_t *result_pool)
 {
-  char *p = apr_palloc(pool, SVN_INT64_BUFFER_SIZE);
+  char *p = apr_palloc(result_pool, SVN_INT64_BUFFER_SIZE);
   svn__ui64tobase36(p, txn_id);
   return p;
 }
@@ -253,9 +266,9 @@ combine_txn_id_string(svn_fs_x__txn_id_t
 
 const char *
 svn_fs_x__path_txns_dir(svn_fs_t *fs,
-                        apr_pool_t *pool)
+                        apr_pool_t *result_pool)
 {
-  return svn_dirent_join(fs->path, PATH_TXNS_DIR, pool);
+  return svn_dirent_join(fs->path, PATH_TXNS_DIR, result_pool);
 }
 
 const char *
@@ -342,16 +355,17 @@ svn_fs_x__path_txn_next_ids(svn_fs_t *fs
 }
 
 const char *
-svn_fs_x__path_min_unpacked_rev(svn_fs_t *fs, apr_pool_t *pool)
+svn_fs_x__path_min_unpacked_rev(svn_fs_t *fs,
+                                apr_pool_t *result_pool)
 {
-  return svn_dirent_join(fs->path, PATH_MIN_UNPACKED_REV, pool);
+  return svn_dirent_join(fs->path, PATH_MIN_UNPACKED_REV, result_pool);
 }
 
 const char *
 svn_fs_x__path_txn_proto_revs(svn_fs_t *fs,
-                              apr_pool_t *pool)
+                              apr_pool_t *result_pool)
 {
-  return svn_dirent_join(fs->path, PATH_TXN_PROTOS_DIR, pool);
+  return svn_dirent_join(fs->path, PATH_TXN_PROTOS_DIR, result_pool);
 }
 
 const char *
@@ -388,22 +402,20 @@ svn_fs_x__path_txn_proto_rev_lock(svn_fs
 
 const char *
 svn_fs_x__path_txn_node_rev(svn_fs_t *fs,
-                            const svn_fs_id_t *id,
+                            const svn_fs_x__id_t *id,
                             apr_pool_t *pool)
 {
-  char *filename = (char *)svn_fs_x__id_unparse(id, pool)->data;
-  *strrchr(filename, '.') = '\0';
+  const char *filename = svn_fs_x__id_unparse(id, pool)->data;
+  apr_int64_t txn_id = svn_fs_x__get_txn_id(id->change_set);
 
-  return svn_dirent_join(svn_fs_x__path_txn_dir(fs, svn_fs_x__id_txn_id(id),
-                                                pool),
-                         apr_psprintf(pool, PATH_PREFIX_NODE "%s",
-                                      filename),
+  return svn_dirent_join(svn_fs_x__path_txn_dir(fs, txn_id, pool),
+                         apr_psprintf(pool, PATH_PREFIX_NODE "%s", filename),
                          pool);
 }
 
 const char *
 svn_fs_x__path_txn_node_props(svn_fs_t *fs,
-                              const svn_fs_id_t *id,
+                              const svn_fs_x__id_t *id,
                               apr_pool_t *pool)
 {
   return apr_pstrcat(pool, svn_fs_x__path_txn_node_rev(fs, id, pool),
@@ -411,7 +423,9 @@ svn_fs_x__path_txn_node_props(svn_fs_t *
 }
 
 const char *
-svn_fs_x__path_txn_node_children(svn_fs_t *fs, const svn_fs_id_t *id, apr_pool_t *pool)
+svn_fs_x__path_txn_node_children(svn_fs_t *fs,
+                                 const svn_fs_x__id_t *id,
+                                 apr_pool_t *pool)
 {
   return apr_pstrcat(pool, svn_fs_x__path_txn_node_rev(fs, id, pool),
                      PATH_EXT_CHILDREN, SVN_VA_NULL);
@@ -443,30 +457,32 @@ svn_fs_x__check_file_buffer_numeric(cons
 svn_error_t *
 svn_fs_x__read_min_unpacked_rev(svn_revnum_t *min_unpacked_rev,
                                 svn_fs_t *fs,
-                                apr_pool_t *pool)
+                                apr_pool_t *scratch_pool)
 {
   char buf[80];
   apr_file_t *file;
   apr_size_t len;
 
   SVN_ERR(svn_io_file_open(&file,
-                           svn_fs_x__path_min_unpacked_rev(fs, pool),
+                           svn_fs_x__path_min_unpacked_rev(fs, scratch_pool),
                            APR_READ | APR_BUFFERED,
                            APR_OS_DEFAULT,
-                           pool));
+                           scratch_pool));
   len = sizeof(buf);
-  SVN_ERR(svn_io_read_length_line(file, buf, &len, pool));
-  SVN_ERR(svn_io_file_close(file, pool));
+  SVN_ERR(svn_io_read_length_line(file, buf, &len, scratch_pool));
+  SVN_ERR(svn_io_file_close(file, scratch_pool));
 
   SVN_ERR(svn_revnum_parse(min_unpacked_rev, buf, NULL));
   return SVN_NO_ERROR;
 }
 
 svn_error_t *
-svn_fs_x__update_min_unpacked_rev(svn_fs_t *fs, apr_pool_t *pool)
+svn_fs_x__update_min_unpacked_rev(svn_fs_t *fs,
+                                  apr_pool_t *scratch_pool)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
-  return svn_fs_x__read_min_unpacked_rev(&ffd->min_unpacked_rev, fs, pool);
+  svn_fs_x__data_t *ffd = fs->fsap_data;
+  return svn_fs_x__read_min_unpacked_rev(&ffd->min_unpacked_rev, fs,
+                                         scratch_pool);
 }
 
 /* Write a file FILENAME in directory FS_PATH, containing a single line
@@ -495,13 +511,13 @@ svn_fs_x__write_min_unpacked_rev(svn_fs_
 svn_error_t *
 svn_fs_x__read_current(svn_revnum_t *rev,
                        svn_fs_t *fs,
-                       apr_pool_t *pool)
+                       apr_pool_t *scratch_pool)
 {
   const char *str;
   svn_stringbuf_t *content;
   SVN_ERR(svn_fs_x__read_content(&content,
-                                 svn_fs_x__path_current(fs, pool),
-                                 pool));
+                                 svn_fs_x__path_current(fs, scratch_pool),
+                                 scratch_pool));
   SVN_ERR(svn_revnum_parse(rev, content->data, &str));
   if (*str != '\n')
     return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
@@ -511,44 +527,36 @@ svn_fs_x__read_current(svn_revnum_t *rev
 }
 
 /* Atomically update the 'current' file to hold the specifed REV.
-   Perform temporary allocations in POOL. */
+   Perform temporary allocations in SCRATCH_POOL. */
 svn_error_t *
-svn_fs_x__write_current(svn_fs_t *fs, svn_revnum_t rev, apr_pool_t *pool)
+svn_fs_x__write_current(svn_fs_t *fs,
+                        svn_revnum_t rev,
+                        apr_pool_t *scratch_pool)
 {
   char *buf;
   const char *tmp_name, *name;
 
   /* Now we can just write out this line. */
-  buf = apr_psprintf(pool, "%ld\n", rev);
+  buf = apr_psprintf(scratch_pool, "%ld\n", rev);
 
-  name = svn_fs_x__path_current(fs, pool);
+  name = svn_fs_x__path_current(fs, scratch_pool);
   SVN_ERR(svn_io_write_unique(&tmp_name,
-                              svn_dirent_dirname(name, pool),
+                              svn_dirent_dirname(name, scratch_pool),
                               buf, strlen(buf),
-                              svn_io_file_del_none, pool));
+                              svn_io_file_del_none, scratch_pool));
 
-  return svn_fs_x__move_into_place(tmp_name, name, name, pool);
+  return svn_fs_x__move_into_place(tmp_name, name, name, scratch_pool);
 }
 
 
-
-/* Read the file at PATH and return its content in *CONTENT. *CONTENT will
- * not be modified unless the whole file was read successfully.
- *
- * ESTALE, EIO and ENOENT will not cause this function to return an error
- * unless LAST_ATTEMPT has been set.  If MISSING is not NULL, indicate
- * missing files (ENOENT) there.
- *
- * Use POOL for allocations.
- */
 svn_error_t *
 svn_fs_x__try_stringbuf_from_file(svn_stringbuf_t **content,
                                   svn_boolean_t *missing,
                                   const char *path,
                                   svn_boolean_t last_attempt,
-                                  apr_pool_t *pool)
+                                  apr_pool_t *result_pool)
 {
-  svn_error_t *err = svn_stringbuf_from_file2(content, path, pool);
+  svn_error_t *err = svn_stringbuf_from_file2(content, path, result_pool);
   if (missing)
     *missing = FALSE;
 
@@ -586,14 +594,14 @@ svn_fs_x__try_stringbuf_from_file(svn_st
 svn_error_t *
 svn_fs_x__get_file_offset(apr_off_t *offset_p,
                           apr_file_t *file,
-                          apr_pool_t *pool)
+                          apr_pool_t *scratch_pool)
 {
   apr_off_t offset;
 
   /* Note that, for buffered files, one (possibly surprising) side-effect
      of this call is to flush any unwritten data to disk. */
   offset = 0;
-  SVN_ERR(svn_io_file_seek(file, APR_CUR, &offset, pool));
+  SVN_ERR(svn_io_file_seek(file, APR_CUR, &offset, scratch_pool));
   *offset_p = offset;
 
   return SVN_NO_ERROR;
@@ -661,7 +669,7 @@ svn_fs_x__read_number_from_stream(apr_in
 /* Move a file into place from OLD_FILENAME in the transactions
    directory to its final location NEW_FILENAME in the repository.  On
    Unix, match the permissions of the new file to the permissions of
-   PERMS_REFERENCE.  Temporary allocations are from POOL.
+   PERMS_REFERENCE.  Temporary allocations are from SCRATCH_POOL.
 
    This function almost duplicates svn_io_file_move(), but it tries to
    guarantee a flush. */
@@ -669,14 +677,14 @@ svn_error_t *
 svn_fs_x__move_into_place(const char *old_filename,
                           const char *new_filename,
                           const char *perms_reference,
-                          apr_pool_t *pool)
+                          apr_pool_t *scratch_pool)
 {
   svn_error_t *err;
 
-  SVN_ERR(svn_io_copy_perms(perms_reference, old_filename, pool));
+  SVN_ERR(svn_io_copy_perms(perms_reference, old_filename, scratch_pool));
 
   /* Move the file into place. */
-  err = svn_io_file_rename(old_filename, new_filename, pool);
+  err = svn_io_file_rename(old_filename, new_filename, scratch_pool);
   if (err && APR_STATUS_IS_EXDEV(err->apr_err))
     {
       apr_file_t *file;
@@ -684,18 +692,19 @@ svn_fs_x__move_into_place(const char *ol
       /* Can't rename across devices; fall back to copying. */
       svn_error_clear(err);
       err = SVN_NO_ERROR;
-      SVN_ERR(svn_io_copy_file(old_filename, new_filename, TRUE, pool));
+      SVN_ERR(svn_io_copy_file(old_filename, new_filename, TRUE,
+                               scratch_pool));
 
       /* Flush the target of the copy to disk. */
       SVN_ERR(svn_io_file_open(&file, new_filename, APR_READ,
-                               APR_OS_DEFAULT, pool));
+                               APR_OS_DEFAULT, scratch_pool));
       /* ### BH: Does this really guarantee a flush of the data written
          ### via a completely different handle on all operating systems?
          ###
          ### Maybe we should perform the copy ourselves instead of making
          ### apr do that and flush the real handle? */
-      SVN_ERR(svn_io_file_flush_to_disk(file, pool));
-      SVN_ERR(svn_io_file_close(file, pool));
+      SVN_ERR(svn_io_file_flush_to_disk(file, scratch_pool));
+      SVN_ERR(svn_io_file_close(file, scratch_pool));
     }
   if (err)
     return svn_error_trace(err);
@@ -710,11 +719,11 @@ svn_fs_x__move_into_place(const char *ol
     const char *dirname;
     apr_file_t *file;
 
-    dirname = svn_dirent_dirname(new_filename, pool);
+    dirname = svn_dirent_dirname(new_filename, scratch_pool);
     SVN_ERR(svn_io_file_open(&file, dirname, APR_READ, APR_OS_DEFAULT,
-                             pool));
-    SVN_ERR(svn_io_file_flush_to_disk(file, pool));
-    SVN_ERR(svn_io_file_close(file, pool));
+                             scratch_pool));
+    SVN_ERR(svn_io_file_flush_to_disk(file, scratch_pool));
+    SVN_ERR(svn_io_file_close(file, scratch_pool));
   }
 #endif
 

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/util.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/util.h?rev=1652409&r1=1652408&r2=1652409&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/util.h (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/util.h Fri Jan 16 14:01:35 2015
@@ -78,8 +78,8 @@ svn_boolean_t
 svn_fs_x__is_packed_revprop(svn_fs_t *fs,
                             svn_revnum_t rev);
 
-/* Return the first revision in the pack / rev file containing REVISION in
- * filesystem FS.  For non-packed revs, this will simply be REVISION. */
+/* Return the first revision in the pack / rev file containing REV in
+ * filesystem FS.  For non-packed revs, this will simply be REV. */
 svn_revnum_t
 svn_fs_x__packed_base_rev(svn_fs_t *fs,
                           svn_revnum_t rev);
@@ -89,72 +89,133 @@ svn_fs_x__packed_base_rev(svn_fs_t *fs,
 svn_revnum_t
 svn_fs_x__pack_size(svn_fs_t *fs, svn_revnum_t rev);
 
+/* Return the full path of the "format" file in FS.
+ * The result will be allocated in RESULT_POOL.
+ */
 const char *
 svn_fs_x__path_format(svn_fs_t *fs,
-                      apr_pool_t *pool);
+                      apr_pool_t *result_pool);
+
+/* Return the path to the 'current' file in FS.
+   Perform allocation in RESULT_POOL. */
+const char *
+svn_fs_x__path_current(svn_fs_t *fs,
+                       apr_pool_t *result_pool);
 
+/* Return the full path of the "uuid" file in FS.
+ * The result will be allocated in RESULT_POOL.
+ */
 const char *
 svn_fs_x__path_uuid(svn_fs_t *fs,
-                    apr_pool_t *pool);
+                    apr_pool_t *result_pool);
 
+/* Return the full path of the "txn-current" file in FS.
+ * The result will be allocated in RESULT_POOL.
+ */
 const char *
 svn_fs_x__path_txn_current(svn_fs_t *fs,
-                           apr_pool_t *pool);
+                           apr_pool_t *result_pool);
 
+/* Return the full path of the "txn-current-lock" file in FS.
+ * The result will be allocated in RESULT_POOL.
+ */
 const char *
 svn_fs_x__path_txn_current_lock(svn_fs_t *fs,
-                                apr_pool_t *pool);
+                                apr_pool_t *result_pool);
 
+/* Return the full path of the global write lock file in FS.
+ * The result will be allocated in RESULT_POOL.
+ */
 const char *
 svn_fs_x__path_lock(svn_fs_t *fs,
-                    apr_pool_t *pool);
+                    apr_pool_t *result_pool);
 
 /* Return the full path of the pack operation lock file in FS.
- * The result will be allocated in POOL.
+ * The result will be allocated in RESULT_POOL.
  */
 const char *
 svn_fs_x__path_pack_lock(svn_fs_t *fs,
-                         apr_pool_t *pool);
+                         apr_pool_t *result_pool);
 
+/* Return the full path of the revprop generation file in FS.
+ * Allocate the result in RESULT_POOL.
+ */
 const char *
 svn_fs_x__path_revprop_generation(svn_fs_t *fs,
-                                  apr_pool_t *pool);
+                                  apr_pool_t *result_pool);
 
+/* Return the path of the pack-related file that for revision REV in FS.
+ * KIND specifies the file name base, e.g. "pack".
+ * The result will be allocated in POOL.
+ */
 const char *
 svn_fs_x__path_rev_packed(svn_fs_t *fs,
                           svn_revnum_t rev,
                           const char *kind,
                           apr_pool_t *pool);
 
+/* Return the full path of the rev shard directory that will contain
+ * revision REV in FS.  Allocate the result in RESULT_POOL.
+ */
 const char *
 svn_fs_x__path_rev_shard(svn_fs_t *fs,
                          svn_revnum_t rev,
-                         apr_pool_t *pool);
+                         apr_pool_t *result_pool);
 
+/* Return the full path of the non-packed rev file containing revision REV
+ * in FS.  Allocate the result in POOL.
+ */
 const char *
 svn_fs_x__path_rev(svn_fs_t *fs,
                    svn_revnum_t rev,
                    apr_pool_t *pool);
 
+/* Set *PATH to the path of REV in FS, whether in a pack file or not.
+   Allocate *PATH in POOL.
+
+   Note: If the caller does not have the write lock on FS, then the path is
+   not guaranteed to be correct or to remain correct after the function
+   returns, because the revision might become packed before or after this
+   call.  If a file exists at that path, then it is correct; if not, then
+   the caller should call update_min_unpacked_rev() and re-try once. */
+const char *
+svn_fs_x__path_rev_absolute(svn_fs_t *fs,
+                            svn_revnum_t rev,
+                            apr_pool_t *pool);
+
+/* Return the full path of the revision properties shard directory that
+ * will contain the properties of revision REV in FS.
+ * Allocate the result in RESULT_POOL.
+ */
 const char *
 svn_fs_x__path_revprops_shard(svn_fs_t *fs,
                               svn_revnum_t rev,
-                              apr_pool_t *pool);
+                              apr_pool_t *result_pool);
 
+/* Return the full path of the revision properties pack shard directory
+ * that will contain the packed properties of revision REV in FS.
+ * Allocate the result in POOL.
+ */
 const char *
 svn_fs_x__path_revprops_pack_shard(svn_fs_t *fs,
                                    svn_revnum_t rev,
                                    apr_pool_t *pool);
 
+/* Return the full path of the non-packed revision properties file that
+ * contains the props for revision REV in FS.  Allocate the result in POOL.
+ */
 const char *
 svn_fs_x__path_revprops(svn_fs_t *fs,
                         svn_revnum_t rev,
                         apr_pool_t *pool);
 
+/* Convert the TXN_ID into a string, allocated from RESULT_POOL.
+ */
 const char *
 svn_fs_x__txn_name(svn_fs_x__txn_id_t txn_id,
-                   apr_pool_t *pool);
+                   apr_pool_t *result_pool);
 
+/* Convert TXN_NAME into an ID and return it in *TXN_ID. */
 svn_error_t *
 svn_fs_x__txn_by_name(svn_fs_x__txn_id_t *txn_id,
                       const char *txn_name);
@@ -168,11 +229,11 @@ svn_fs_x__path_txn_dir(svn_fs_t *fs,
                        apr_pool_t *pool);
 
 /* Return the path of the 'transactions' directory in FS.
- * The result will be allocated in POOL.
+ * The result will be allocated in RESULT_POOL.
  */
 const char *
 svn_fs_x__path_txns_dir(svn_fs_t *fs,
-                        apr_pool_t *pool);
+                        apr_pool_t *result_pool);
 
 /* Return the name of the sha1->rep mapping file in transaction TXN_ID
  * within FS for the given SHA1 checksum.  Use POOL for allocations.
@@ -184,13 +245,13 @@ svn_fs_x__path_txn_sha1(svn_fs_t *fs,
                         apr_pool_t *pool);
 
 /* Return the path of the 'txn-protorevs' directory in FS, even if that
- * folder may not exist in FS.  The result will be allocated in POOL.
+ * folder may not exist in FS.  The result will be allocated in RESULT_POOL.
  */
 const char *
 svn_fs_x__path_txn_proto_revs(svn_fs_t *fs,
-                              apr_pool_t *pool);
+                              apr_pool_t *result_pool);
 
-/* Return the path of the proto-revision file for transaction TXN_ID in FS.
+/* Return the path of the changes file for transaction TXN_ID in FS.
  * The result will be allocated in POOL.
  */
 const char *
@@ -198,64 +259,106 @@ svn_fs_x__path_txn_changes(svn_fs_t *fs,
                            svn_fs_x__txn_id_t txn_id,
                            apr_pool_t *pool);
 
+/* Return the path of the file containing the log-to-phys index for
+ * the transaction identified by TXN_ID in FS.
+ * The result will be allocated in POOL.
+ */
 const char*
 svn_fs_x__path_l2p_proto_index(svn_fs_t *fs,
                                svn_fs_x__txn_id_t txn_id,
                                apr_pool_t *pool);
 
+/* Return the path of the file containing the phys-to-log index for
+ * the transaction identified by TXN_ID in FS.
+ * The result will be allocated in POOL.
+ */
 const char*
 svn_fs_x__path_p2l_proto_index(svn_fs_t *fs,
                                svn_fs_x__txn_id_t txn_id,
                                apr_pool_t *pool);
 
+/* Return the path of the file containing the transaction properties for
+ * the transaction identified by TXN_ID in FS.
+ * The result will be allocated in POOL.
+ */
 const char *
 svn_fs_x__path_txn_props(svn_fs_t *fs,
                          svn_fs_x__txn_id_t txn_id,
                          apr_pool_t *pool);
 
+/* Return the path of the file containing the "final" transaction
+ * properties for the transaction identified by TXN_ID in FS.
+ * The result will be allocated in POOL.
+ */
 const char *
 svn_fs_x__path_txn_props_final(svn_fs_t *fs,
                                svn_fs_x__txn_id_t txn_id,
                                apr_pool_t *pool);
 
+/* Return the path of the file containing the node and copy ID counters for
+ * the transaction identified by TXN_ID in FS.
+ * The result will be allocated in POOL.
+ */
 const char *
 svn_fs_x__path_txn_next_ids(svn_fs_t *fs,
                             svn_fs_x__txn_id_t txn_id,
                             apr_pool_t *pool);
 
+/* Return the path of the file storing the oldest non-packed revision in FS.
+ * The result will be allocated in RESULT_POOL.
+ */
 const char *
 svn_fs_x__path_min_unpacked_rev(svn_fs_t *fs,
-                                apr_pool_t *pool);
-
+                                apr_pool_t *result_pool);
 
+/* Return the path of the file containing item_index counter for
+ * the transaction identified by TXN_ID in FS.
+ * The result will be allocated in POOL.
+ */
 const char *
 svn_fs_x__path_txn_item_index(svn_fs_t *fs,
                               svn_fs_x__txn_id_t txn_id,
                               apr_pool_t *pool);
 
+/* Return the path of the proto-revision file for transaction TXN_ID in FS.
+ * The result will be allocated in POOL.
+ */
 const char *
 svn_fs_x__path_txn_proto_rev(svn_fs_t *fs,
                              svn_fs_x__txn_id_t txn_id,
                              apr_pool_t *pool);
 
+/* Return the path of the proto-revision lock file for transaction TXN_ID
+ * in FS.  The result will be allocated in POOL.
+ */
 const char *
 svn_fs_x__path_txn_proto_rev_lock(svn_fs_t *fs,
                                   svn_fs_x__txn_id_t txn_id,
                                   apr_pool_t *pool);
 
+/* Return the path of the file containing the in-transaction node revision
+ * identified by ID in FS.  The result will be allocated in POOL.
+ */
 const char *
 svn_fs_x__path_txn_node_rev(svn_fs_t *fs,
-                            const svn_fs_id_t *id,
+                            const svn_fs_x__id_t *id,
                             apr_pool_t *pool);
 
+/* Return the path of the file containing the in-transaction properties of
+ * the node identified by ID in FS.  The result will be allocated in POOL.
+ */
 const char *
 svn_fs_x__path_txn_node_props(svn_fs_t *fs,
-                              const svn_fs_id_t *id,
+                              const svn_fs_x__id_t *id,
                               apr_pool_t *pool);
 
+/* Return the path of the file containing the directory entries of the
+ * in-transaction directory node identified by ID in FS.
+ * The result will be allocated in POOL.
+ */
 const char *
 svn_fs_x__path_txn_node_children(svn_fs_t *fs,
-                                 const svn_fs_id_t *id,
+                                 const svn_fs_x__id_t *id,
                                  apr_pool_t *pool);
 
 /* Check that BUF, a nul-terminated buffer of text from file PATH,
@@ -271,11 +374,18 @@ svn_fs_x__check_file_buffer_numeric(cons
                                     const char *title,
                                     apr_pool_t *pool);
 
+/* Set *MIN_UNPACKED_REV to the integer value read from the file returned
+ * by #svn_fs_fs__path_min_unpacked_rev() for FS.
+ * Use SCRATCH_POOL for temporary allocations.
+ */
 svn_error_t *
 svn_fs_x__read_min_unpacked_rev(svn_revnum_t *min_unpacked_rev,
                                 svn_fs_t *fs,
-                                apr_pool_t *pool);
+                                apr_pool_t *scratch_pool);
 
+/* Re-read the MIN_UNPACKED_REV member of FS from disk.
+ * Use POOL for temporary allocations.
+ */
 svn_error_t *
 svn_fs_x__update_min_unpacked_rev(svn_fs_t *fs,
                                   apr_pool_t *pool);
@@ -289,41 +399,41 @@ svn_fs_x__write_min_unpacked_rev(svn_fs_
                                  apr_pool_t *scratch_pool);
 
 /* Set *REV to the value read from the 'current' file.  Perform temporary
- * allocations in POOL.
+ * allocations in SCRATCH_POOL.
  */
 svn_error_t *
 svn_fs_x__read_current(svn_revnum_t *rev,
                        svn_fs_t *fs,
-                       apr_pool_t *pool);
+                       apr_pool_t *scratch_pool);
 
 /* Atomically update the 'current' file to hold the specifed REV.
-   Perform temporary allocations in POOL. */
+   Perform temporary allocations in SCRATCH_POOL. */
 svn_error_t *
 svn_fs_x__write_current(svn_fs_t *fs,
                         svn_revnum_t rev,
-                        apr_pool_t *pool);
+                        apr_pool_t *scratch_pool);
 
-/* Read the file at PATH and return its content in *CONTENT. *CONTENT will
- * not be modified unless the whole file was read successfully.
+/* Read the file at PATH and return its content in *CONTENT, allocated in
+ * RESULT_POOL.  *CONTENT will not be modified unless the whole file was
+ * read successfully.
  *
  * ESTALE, EIO and ENOENT will not cause this function to return an error
  * unless LAST_ATTEMPT has been set.  If MISSING is not NULL, indicate
  * missing files (ENOENT) there.
- *
- * Use POOL for allocations.
  */
 svn_error_t *
 svn_fs_x__try_stringbuf_from_file(svn_stringbuf_t **content,
                                   svn_boolean_t *missing,
                                   const char *path,
                                   svn_boolean_t last_attempt,
-                                  apr_pool_t *pool);
+                                  apr_pool_t *result_pool);
 
-/* Fetch the current offset of FILE into *OFFSET_P. */
+/* Fetch the current offset of FILE into *OFFSET_P.
+ * Perform temporary allocations in SCRATCH_POOL. */
 svn_error_t *
 svn_fs_x__get_file_offset(apr_off_t *offset_p,
                           apr_file_t *file,
-                          apr_pool_t *pool);
+                          apr_pool_t *scratch_pool);
 
 /* Read the file FNAME and store the contents in *BUF.
    Allocations are performed in POOL. */
@@ -347,7 +457,7 @@ svn_fs_x__read_number_from_stream(apr_in
 /* Move a file into place from OLD_FILENAME in the transactions
    directory to its final location NEW_FILENAME in the repository.  On
    Unix, match the permissions of the new file to the permissions of
-   PERMS_REFERENCE.  Temporary allocations are from POOL.
+   PERMS_REFERENCE.  Temporary allocations are from SCRATCH_POOL.
 
    This function almost duplicates svn_io_file_move(), but it tries to
    guarantee a flush. */
@@ -355,6 +465,6 @@ svn_error_t *
 svn_fs_x__move_into_place(const char *old_filename,
                           const char *new_filename,
                           const char *perms_reference,
-                          apr_pool_t *pool);
+                          apr_pool_t *scratch_pool);
 
 #endif

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/verify.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/verify.c?rev=1652409&r1=1652408&r2=1652409&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/verify.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/verify.c Fri Jan 16 14:01:35 2015
@@ -22,6 +22,7 @@
 
 #include "verify.h"
 #include "fs_x.h"
+#include "svn_time.h"
 #include "private/svn_subr_private.h"
 
 #include "cached_data.h"
@@ -57,7 +58,7 @@ typedef struct verify_walker_baton_t
 /* Used by svn_fs_x__verify().
    Implements svn_fs_x__walk_rep_reference().walker.  */
 static svn_error_t *
-verify_walker(representation_t *rep,
+verify_walker(svn_fs_x__representation_t *rep,
               void *baton,
               svn_fs_t *fs,
               apr_pool_t *scratch_pool)
@@ -102,24 +103,26 @@ verify_rep_cache(svn_fs_t *fs,
                  void *notify_baton,
                  svn_cancel_func_t cancel_func,
                  void *cancel_baton,
-                 apr_pool_t *pool)
+                 apr_pool_t *scratch_pool)
 {
   svn_boolean_t exists;
 
   /* rep-cache verification. */
-  SVN_ERR(svn_fs_x__exists_rep_cache(&exists, fs, pool));
+  SVN_ERR(svn_fs_x__exists_rep_cache(&exists, fs, scratch_pool));
   if (exists)
     {
       /* provide a baton to allow the reuse of open file handles between
          iterations (saves 2/3 of OS level file operations). */
-      verify_walker_baton_t *baton = apr_pcalloc(pool, sizeof(*baton));
+      verify_walker_baton_t *baton
+        = apr_pcalloc(scratch_pool, sizeof(*baton));
+
       baton->last_notified_revision = SVN_INVALID_REVNUM;
       baton->notify_func = notify_func;
       baton->notify_baton = notify_baton;
 
       /* tell the user that we are now ready to do *something* */
       if (notify_func)
-        notify_func(SVN_INVALID_REVNUM, notify_baton, pool);
+        notify_func(SVN_INVALID_REVNUM, notify_baton, scratch_pool);
 
       /* Do not attempt to walk the rep-cache database if its file does
          not exist,  since doing so would create it --- which may confuse
@@ -127,7 +130,7 @@ verify_rep_cache(svn_fs_t *fs,
       SVN_ERR(svn_fs_x__walk_rep_reference(fs, start, end,
                                            verify_walker, baton,
                                            cancel_func, cancel_baton,
-                                           pool));
+                                           scratch_pool));
     }
 
   return SVN_NO_ERROR;
@@ -223,7 +226,7 @@ verify_index_checksums(svn_fs_t *fs,
 /* Verify that for all log-to-phys index entries for revisions START to
  * START + COUNT-1 in FS there is a consistent entry in the phys-to-log
  * index.  If given, invoke CANCEL_FUNC with CANCEL_BATON at regular
- * intervals. Use POOL for allocations.
+ * intervals. Use SCRATCH_POOL for temporary allocations.
  */
 static svn_error_t *
 compare_l2p_to_p2l_index(svn_fs_t *fs,
@@ -231,19 +234,19 @@ compare_l2p_to_p2l_index(svn_fs_t *fs,
                          svn_revnum_t count,
                          svn_cancel_func_t cancel_func,
                          void *cancel_baton,
-                         apr_pool_t *pool)
+                         apr_pool_t *scratch_pool)
 {
   svn_revnum_t i;
-  apr_pool_t *iterpool = svn_pool_create(pool);
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   apr_array_header_t *max_ids;
 
   /* common file access structure */
   svn_fs_x__revision_file_t *rev_file;
-  SVN_ERR(svn_fs_x__open_pack_or_rev_file(&rev_file, fs, start, pool,
+  SVN_ERR(svn_fs_x__open_pack_or_rev_file(&rev_file, fs, start, scratch_pool,
                                           iterpool));
 
   /* determine the range of items to check for each revision */
-  SVN_ERR(svn_fs_x__l2p_get_max_ids(&max_ids, fs, start, count, pool,
+  SVN_ERR(svn_fs_x__l2p_get_max_ids(&max_ids, fs, start, count, scratch_pool,
                                     iterpool));
 
   /* check all items in all revisions if the given range */
@@ -257,8 +260,8 @@ compare_l2p_to_p2l_index(svn_fs_t *fs,
         {
           apr_off_t offset;
           apr_uint32_t sub_item;
-          svn_fs_x__id_part_t l2p_item;
-          svn_fs_x__id_part_t *p2l_item;
+          svn_fs_x__id_t l2p_item;
+          svn_fs_x__id_t *p2l_item;
 
           l2p_item.change_set = svn_fs_x__change_set_by_rev(revision);
           l2p_item.number = k;
@@ -280,10 +283,10 @@ compare_l2p_to_p2l_index(svn_fs_t *fs,
                                      _("p2l index entry not found for "
                                        "PHYS o%s:s%ld returned by "
                                        "l2p index for LOG r%ld:i%ld"),
-                                     apr_off_t_toa(pool, offset),
+                                     apr_off_t_toa(scratch_pool, offset),
                                      (long)sub_item, revision, (long)k);
 
-          if (!svn_fs_x__id_part_eq(&l2p_item, p2l_item))
+          if (!svn_fs_x__id_eq(&l2p_item, p2l_item))
             return svn_error_createf(SVN_ERR_FS_INDEX_INCONSISTENT,
                                      NULL,
                                      _("p2l index info LOG r%ld:i%ld"
@@ -310,7 +313,7 @@ compare_l2p_to_p2l_index(svn_fs_t *fs,
 /* Verify that for all phys-to-log index entries for revisions START to
  * START + COUNT-1 in FS there is a consistent entry in the log-to-phys
  * index.  If given, invoke CANCEL_FUNC with CANCEL_BATON at regular
- * intervals. Use POOL for allocations.
+ * intervals. Use SCRATCH_POOL for temporary allocations.
  *
  * Please note that we can only check on pack / rev file granularity and
  * must only be called for a single rev / pack file.
@@ -321,21 +324,22 @@ compare_p2l_to_l2p_index(svn_fs_t *fs,
                          svn_revnum_t count,
                          svn_cancel_func_t cancel_func,
                          void *cancel_baton,
-                         apr_pool_t *pool)
+                         apr_pool_t *scratch_pool)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
-  apr_pool_t *iterpool = svn_pool_create(pool);
+  svn_fs_x__data_t *ffd = fs->fsap_data;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+  apr_pool_t *iterpool2 = svn_pool_create(scratch_pool);
   apr_off_t max_offset;
   apr_off_t offset = 0;
 
   /* common file access structure */
   svn_fs_x__revision_file_t *rev_file;
-  SVN_ERR(svn_fs_x__open_pack_or_rev_file(&rev_file, fs, start, pool,
+  SVN_ERR(svn_fs_x__open_pack_or_rev_file(&rev_file, fs, start, scratch_pool,
                                           iterpool));
 
   /* get the size of the rev / pack file as covered by the P2L index */
   SVN_ERR(svn_fs_x__p2l_get_max_offset(&max_offset, fs, rev_file, start,
-                                       pool));
+                                       scratch_pool));
 
   /* for all offsets in the file, get the P2L index entries and check
      them against the L2P index */
@@ -345,6 +349,8 @@ compare_p2l_to_l2p_index(svn_fs_t *fs,
       svn_fs_x__p2l_entry_t *last_entry;
       int i;
 
+      svn_pool_clear(iterpool);
+
       /* get all entries for the current block */
       SVN_ERR(svn_fs_x__p2l_index_lookup(&entries, fs, rev_file, start,
                                          offset, ffd->p2l_page_size,
@@ -354,7 +360,7 @@ compare_p2l_to_l2p_index(svn_fs_t *fs,
                                  NULL,
                                  _("p2l does not cover offset %s"
                                    " for revision %ld"),
-                                  apr_off_t_toa(pool, offset), start);
+                                  apr_off_t_toa(scratch_pool, offset), start);
 
       /* process all entries (and later continue with the next block) */
       last_entry
@@ -372,12 +378,13 @@ compare_p2l_to_l2p_index(svn_fs_t *fs,
             {
               apr_off_t l2p_offset;
               apr_uint32_t sub_item;
-              svn_fs_x__id_part_t *p2l_item = &entry->items[k];
+              svn_fs_x__id_t *p2l_item = &entry->items[k];
               svn_revnum_t revision
                 = svn_fs_x__get_revnum(p2l_item->change_set);
 
+              svn_pool_clear(iterpool2);
               SVN_ERR(svn_fs_x__item_offset(&l2p_offset, &sub_item, fs,
-                                            rev_file, p2l_item, iterpool));
+                                            rev_file, p2l_item, iterpool2));
 
               if (sub_item != k || l2p_offset != entry->offset)
                 return svn_error_createf(SVN_ERR_FS_INDEX_INCONSISTENT,
@@ -385,11 +392,13 @@ compare_p2l_to_l2p_index(svn_fs_t *fs,
                                          _("l2p index entry PHYS o%s:s%ld "
                                            "does not match p2l index value "
                                            "LOG r%ld:i%ld for PHYS o%s:s%ld"),
-                                         apr_off_t_toa(pool, l2p_offset),
+                                         apr_off_t_toa(scratch_pool,
+                                                       l2p_offset),
                                          (long)sub_item,
                                          revision,
                                          (long)p2l_item->number,
-                                         apr_off_t_toa(pool, entry->offset),
+                                         apr_off_t_toa(scratch_pool,
+                                                       entry->offset),
                                          (long)k);
             }
         }
@@ -398,6 +407,7 @@ compare_p2l_to_l2p_index(svn_fs_t *fs,
         SVN_ERR(cancel_func(cancel_baton));
     }
 
+  svn_pool_destroy(iterpool2);
   svn_pool_destroy(iterpool);
 
   SVN_ERR(svn_fs_x__close_revision_file(rev_file));
@@ -410,13 +420,13 @@ compare_p2l_to_l2p_index(svn_fs_t *fs,
  * Must be a multiple of 8. */
 #define STREAM_THRESHOLD 4096
 
-/* Verify that the next SIZE bytes read from FILE are NUL.
- * SIZE must not exceed STREAM_THRESHOLD.  Use POOL for allocations.
+/* Verify that the next SIZE bytes read from FILE are NUL.  SIZE must not
+ * exceed STREAM_THRESHOLD.  Use SCRATCH_POOL for temporary allocations.
  */
 static svn_error_t *
 expect_buffer_nul(apr_file_t *file,
                   apr_off_t size,
-                  apr_pool_t *pool)
+                  apr_pool_t *scratch_pool)
 {
   union
   {
@@ -429,7 +439,8 @@ expect_buffer_nul(apr_file_t *file,
 
   /* read the whole data block; error out on failure */
   data.chunks[(size - 1)/ sizeof(apr_uint64_t)] = 0;
-  SVN_ERR(svn_io_file_read_full2(file, data.buffer, size, NULL, NULL, pool));
+  SVN_ERR(svn_io_file_read_full2(file, data.buffer, size, NULL, NULL,
+                                 scratch_pool));
 
   /* chunky check */
   for (i = 0; i < size / sizeof(apr_uint64_t); ++i)
@@ -443,57 +454,59 @@ expect_buffer_nul(apr_file_t *file,
         const char *file_name;
         apr_off_t offset;
 
-        SVN_ERR(svn_io_file_name_get(&file_name, file, pool));
-        SVN_ERR(svn_fs_x__get_file_offset(&offset, file, pool));
+        SVN_ERR(svn_io_file_name_get(&file_name, file, scratch_pool));
+        SVN_ERR(svn_fs_x__get_file_offset(&offset, file, scratch_pool));
         offset -= size - i;
 
         return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
                                  _("Empty section in file %s contains "
                                    "non-NUL data at offset %s"),
-                                 file_name, apr_off_t_toa(pool, offset));
+                                 file_name,
+                                 apr_off_t_toa(scratch_pool, offset));
       }
 
   return SVN_NO_ERROR;
 }
 
 /* Verify that the next SIZE bytes read from FILE are NUL.
- * Use POOL for allocations.
+ * Use SCRATCH_POOL for temporary allocations.
  */
 static svn_error_t *
 read_all_nul(apr_file_t *file,
              apr_off_t size,
-             apr_pool_t *pool)
+             apr_pool_t *scratch_pool)
 {
   for (; size >= STREAM_THRESHOLD; size -= STREAM_THRESHOLD)
-    SVN_ERR(expect_buffer_nul(file, STREAM_THRESHOLD, pool));
+    SVN_ERR(expect_buffer_nul(file, STREAM_THRESHOLD, scratch_pool));
 
   if (size)
-    SVN_ERR(expect_buffer_nul(file, size, pool));
+    SVN_ERR(expect_buffer_nul(file, size, scratch_pool));
 
   return SVN_NO_ERROR;
 }
 
 /* Compare the ACTUAL checksum with the one expected by ENTRY.
  * Return an error in case of mismatch.  Use the name of FILE
- * in error message.  Allocate data in POOL.
+ * in error message.  Allocate temporary data in SCRATCH_POOL.
  */
 static svn_error_t *
 expected_checksum(apr_file_t *file,
                   svn_fs_x__p2l_entry_t *entry,
                   apr_uint32_t actual,
-                  apr_pool_t *pool)
+                  apr_pool_t *scratch_pool)
 {
   if (actual != entry->fnv1_checksum)
     {
       const char *file_name;
 
-      SVN_ERR(svn_io_file_name_get(&file_name, file, pool));
-      SVN_ERR(svn_io_file_name_get(&file_name, file, pool));
+      SVN_ERR(svn_io_file_name_get(&file_name, file, scratch_pool));
+      SVN_ERR(svn_io_file_name_get(&file_name, file, scratch_pool));
       return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
                                _("Checksum mismatch in item at offset %s of "
                                  "length %s bytes in file %s"),
-                               apr_off_t_toa(pool, entry->offset),
-                               apr_off_t_toa(pool, entry->size), file_name);
+                               apr_off_t_toa(scratch_pool, entry->offset),
+                               apr_off_t_toa(scratch_pool, entry->size),
+                               file_name);
     }
 
   return SVN_NO_ERROR;
@@ -501,37 +514,38 @@ expected_checksum(apr_file_t *file,
 
 /* Verify that the FNV checksum over the next ENTRY->SIZE bytes read
  * from FILE will match ENTRY's expected checksum.  SIZE must not
- * exceed STREAM_THRESHOLD.  Use POOL for allocations.
+ * exceed STREAM_THRESHOLD.  Use SCRATCH_POOL for temporary allocations.
  */
 static svn_error_t *
 expected_buffered_checksum(apr_file_t *file,
                            svn_fs_x__p2l_entry_t *entry,
-                           apr_pool_t *pool)
+                           apr_pool_t *scratch_pool)
 {
   unsigned char buffer[STREAM_THRESHOLD];
   SVN_ERR_ASSERT(entry->size <= STREAM_THRESHOLD);
 
   SVN_ERR(svn_io_file_read_full2(file, buffer, (apr_size_t)entry->size,
-                                 NULL, NULL, pool));
+                                 NULL, NULL, scratch_pool));
   SVN_ERR(expected_checksum(file, entry,
                             svn__fnv1a_32x4(buffer, (apr_size_t)entry->size),
-                            pool));
+                            scratch_pool));
 
   return SVN_NO_ERROR;
 }
 
 /* Verify that the FNV checksum over the next ENTRY->SIZE bytes read from
- * FILE will match ENTRY's expected checksum.  Use POOL for allocations.
+ * FILE will match ENTRY's expected checksum.
+ * Use SCRATCH_POOL for temporary allocations.
  */
 static svn_error_t *
 expected_streamed_checksum(apr_file_t *file,
                            svn_fs_x__p2l_entry_t *entry,
-                           apr_pool_t *pool)
+                           apr_pool_t *scratch_pool)
 {
   unsigned char buffer[STREAM_THRESHOLD];
   svn_checksum_t *checksum;
   svn_checksum_ctx_t *context
-    = svn_checksum_ctx_create(svn_checksum_fnv1a_32x4, pool);
+    = svn_checksum_ctx_create(svn_checksum_fnv1a_32x4, scratch_pool);
   apr_off_t size = entry->size;
 
   while (size > 0)
@@ -540,15 +554,15 @@ expected_streamed_checksum(apr_file_t *f
                          ? sizeof(buffer)
                          : (apr_size_t)size;
       SVN_ERR(svn_io_file_read_full2(file, buffer, to_read, NULL, NULL,
-                                     pool));
+                                     scratch_pool));
       SVN_ERR(svn_checksum_update(context, buffer, to_read));
       size -= to_read;
     }
 
-  SVN_ERR(svn_checksum_final(&checksum, context, pool));
+  SVN_ERR(svn_checksum_final(&checksum, context, scratch_pool));
   SVN_ERR(expected_checksum(file, entry,
                             ntohl(*(const apr_uint32_t *)checksum->digest),
-                            pool));
+                            scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -556,7 +570,7 @@ expected_streamed_checksum(apr_file_t *f
 /* Verify that for all phys-to-log index entries for revisions START to
  * START + COUNT-1 in FS match the actual pack / rev file contents.
  * If given, invoke CANCEL_FUNC with CANCEL_BATON at regular intervals.
- * Use POOL for allocations.
+ * Use SCRATCH_POOL for temporary allocations.
  *
  * Please note that we can only check on pack / rev file granularity and
  * must only be called for a single rev / pack file.
@@ -567,32 +581,35 @@ compare_p2l_to_rev(svn_fs_t *fs,
                    svn_revnum_t count,
                    svn_cancel_func_t cancel_func,
                    void *cancel_baton,
-                   apr_pool_t *pool)
+                   apr_pool_t *scratch_pool)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
-  apr_pool_t *iterpool = svn_pool_create(pool);
+  svn_fs_x__data_t *ffd = fs->fsap_data;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   apr_off_t max_offset;
   apr_off_t offset = 0;
   svn_fs_x__revision_file_t *rev_file;
 
   /* open the pack / rev file that is covered by the p2l index */
-  SVN_ERR(svn_fs_x__open_pack_or_rev_file(&rev_file, fs, start, pool,
+  SVN_ERR(svn_fs_x__open_pack_or_rev_file(&rev_file, fs, start, scratch_pool,
                                           iterpool));
 
   /* check file size vs. range covered by index */
   SVN_ERR(svn_fs_x__auto_read_footer(rev_file));
   SVN_ERR(svn_fs_x__p2l_get_max_offset(&max_offset, fs, rev_file, start,
-                                       pool));
+                                       scratch_pool));
 
   if (rev_file->l2p_offset != max_offset)
     return svn_error_createf(SVN_ERR_FS_INDEX_INCONSISTENT, NULL,
                              _("File size of %s for revision r%ld does "
                                "not match p2l index size of %s"),
-                             apr_off_t_toa(pool, rev_file->l2p_offset), start,
-                             apr_off_t_toa(pool, max_offset));
+                             apr_off_t_toa(scratch_pool,
+                                           rev_file->l2p_offset),
+                             start,
+                             apr_off_t_toa(scratch_pool,
+                                           max_offset));
 
   SVN_ERR(svn_io_file_aligned_seek(rev_file->file, ffd->block_size, NULL, 0,
-                                   pool));
+                                   scratch_pool));
 
   /* for all offsets in the file, get the P2L index entries and check
      them against the L2P index */
@@ -635,24 +652,25 @@ compare_p2l_to_rev(svn_fs_t *fs,
                                        " is non-contiguous between offsets "
                                        " %s and %s"),
                                      start,
-                                     apr_off_t_toa(pool, offset),
-                                     apr_off_t_toa(pool, entry->offset));
+                                     apr_off_t_toa(scratch_pool, offset),
+                                     apr_off_t_toa(scratch_pool,
+                                                   entry->offset));
 
           /* empty sections must contain NUL bytes only */
           if (entry->type == SVN_FS_X__ITEM_TYPE_UNUSED)
             {
               /* skip filler entry at the end of the p2l index */
               if (entry->offset != max_offset)
-                SVN_ERR(read_all_nul(rev_file->file, entry->size, pool));
+                SVN_ERR(read_all_nul(rev_file->file, entry->size, iterpool));
             }
           else
             {
               if (entry->size < STREAM_THRESHOLD)
                 SVN_ERR(expected_buffered_checksum(rev_file->file, entry,
-                                                   pool));
+                                                   iterpool));
               else
                 SVN_ERR(expected_streamed_checksum(rev_file->file, entry,
-                                                   pool));
+                                                   iterpool));
             }
 
           /* advance offset */
@@ -668,27 +686,72 @@ compare_p2l_to_rev(svn_fs_t *fs,
   return SVN_NO_ERROR;
 }
 
-/* Verify that the log-to-phys indexes and phys-to-log indexes are
- * consistent with each other.  The function signature is similar to
- * svn_fs_x__verify.
+/* Verify that the revprops of the revisions START to END in FS can be
+ * accessed.  Invoke CANCEL_FUNC with CANCEL_BATON at regular intervals.
  *
  * The values of START and END have already been auto-selected and
- * verified.  You may call this for format7 or higher repos.
+ * verified.
  */
 static svn_error_t *
-verify_index_consistency(svn_fs_t *fs,
-                         svn_revnum_t start,
-                         svn_revnum_t end,
-                         svn_fs_progress_notify_func_t notify_func,
-                         void *notify_baton,
-                         svn_cancel_func_t cancel_func,
-                         void *cancel_baton,
-                         apr_pool_t *pool)
+verify_revprops(svn_fs_t *fs,
+                svn_revnum_t start,
+                svn_revnum_t end,
+                svn_cancel_func_t cancel_func,
+                void *cancel_baton,
+                apr_pool_t *scratch_pool)
+{
+  svn_revnum_t revision;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+
+  for (revision = start; revision < end; ++revision)
+    {
+      svn_string_t *date;
+      apr_time_t timetemp;
+
+      svn_pool_clear(iterpool);
+
+      /* 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));
+
+      /* The time stamp is the only revprop that, if given, needs to
+       * have a valid content. */
+      if (date)
+        SVN_ERR(svn_time_from_cstring(&timetemp, date->data, iterpool));
+
+      if (cancel_func)
+        SVN_ERR(cancel_func(cancel_baton));
+    }
+
+  svn_pool_destroy(iterpool);
+
+  return SVN_NO_ERROR;
+}
+
+/* Verify that on-disk representation has not been tempered with (in a way
+ * that leaves the repository in a corrupted state).  This compares log-to-
+ * phys with phys-to-log indexes, verifies the low-level checksums and
+ * checks that all revprops are available.  The function signature is
+ * similar to svn_fs_x__verify.
+ *
+ * The values of START and END have already been auto-selected and
+ * verified.
+ */
+static svn_error_t *
+verify_metadata_consistency(svn_fs_t *fs,
+                            svn_revnum_t start,
+                            svn_revnum_t end,
+                            svn_fs_progress_notify_func_t notify_func,
+                            void *notify_baton,
+                            svn_cancel_func_t cancel_func,
+                            void *cancel_baton,
+                            apr_pool_t *scratch_pool)
 {
   svn_error_t *err;
-  fs_x_data_t *ffd = fs->fsap_data;
+  svn_fs_x__data_t *ffd = fs->fsap_data;
   svn_revnum_t revision, next_revision;
-  apr_pool_t *iterpool = svn_pool_create(pool);
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
   for (revision = start; revision <= end; revision = next_revision)
     {
@@ -718,11 +781,16 @@ verify_index_consistency(svn_fs_t *fs,
         err = compare_p2l_to_rev(fs, pack_start, pack_end - pack_start,
                                  cancel_func, cancel_baton, iterpool);
 
+      /* ensure that revprops are available and accessible */
+      if (!err)
+        err = verify_revprops(fs, pack_start, pack_end,
+                              cancel_func, cancel_baton, iterpool);
+
       /* concurrent packing is one of the reasons why verification may fail.
          Make sure, we operate on up-to-date information. */
       if (err)
         SVN_ERR(svn_fs_x__read_min_unpacked_rev(&ffd->min_unpacked_rev,
-                                                fs, pool));
+                                                fs, scratch_pool));
 
       /* retry the whole shard if it got packed in the meantime */
       if (err && count != svn_fs_x__pack_size(fs, revision))
@@ -753,9 +821,9 @@ svn_fs_x__verify(svn_fs_t *fs,
                  void *notify_baton,
                  svn_cancel_func_t cancel_func,
                  void *cancel_baton,
-                 apr_pool_t *pool)
+                 apr_pool_t *scratch_pool)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
+  svn_fs_x__data_t *ffd = fs->fsap_data;
   svn_revnum_t youngest = ffd->youngest_rev_cache; /* cache is current */
 
   /* Input validation. */
@@ -763,18 +831,19 @@ svn_fs_x__verify(svn_fs_t *fs,
     start = 0;
   if (! SVN_IS_VALID_REVNUM(end))
     end = youngest;
-  SVN_ERR(svn_fs_x__ensure_revision_exists(start, fs, pool));
-  SVN_ERR(svn_fs_x__ensure_revision_exists(end, fs, pool));
+  SVN_ERR(svn_fs_x__ensure_revision_exists(start, fs, scratch_pool));
+  SVN_ERR(svn_fs_x__ensure_revision_exists(end, fs, scratch_pool));
 
   /* log/phys index consistency.  We need to check them first to make
      sure we can access the rev / pack files in format7. */
-  SVN_ERR(verify_index_consistency(fs, start, end,
-                                   notify_func, notify_baton,
-                                   cancel_func, cancel_baton, pool));
+  SVN_ERR(verify_metadata_consistency(fs, start, end,
+                                      notify_func, notify_baton,
+                                      cancel_func, cancel_baton,
+                                      scratch_pool));
 
   /* rep cache consistency */
   SVN_ERR(verify_rep_cache(fs, start, end, notify_func, notify_baton,
-                            cancel_func, cancel_baton, pool));
+                            cancel_func, cancel_baton, scratch_pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/verify.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/verify.h?rev=1652409&r1=1652408&r2=1652409&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/verify.h (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/verify.h Fri Jan 16 14:01:35 2015
@@ -29,14 +29,15 @@
  * START to END where possible.  Indicate progress via the optional
  * NOTIFY_FUNC callback using NOTIFY_BATON.  The optional CANCEL_FUNC
  * will periodically be called with CANCEL_BATON to allow for preemption.
- * Use POOL for temporary allocations. */
-svn_error_t *svn_fs_x__verify(svn_fs_t *fs,
-                              svn_revnum_t start,
-                              svn_revnum_t end,
-                              svn_fs_progress_notify_func_t notify_func,
-                              void *notify_baton,
-                              svn_cancel_func_t cancel_func,
-                              void *cancel_baton,
-                              apr_pool_t *pool);
+ * Use SCRATCH_POOL for temporary allocations. */
+svn_error_t *
+svn_fs_x__verify(svn_fs_t *fs,
+                 svn_revnum_t start,
+                 svn_revnum_t end,
+                 svn_fs_progress_notify_func_t notify_func,
+                 void *notify_baton,
+                 svn_cancel_func_t cancel_func,
+                 void *cancel_baton,
+                 apr_pool_t *scratch_pool);
 
 #endif

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/options.c?rev=1652409&r1=1652408&r2=1652409&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/options.c Fri Jan 16 14:01:35 2015
@@ -33,6 +33,7 @@
 #include "svn_ra.h"
 #include "svn_dav.h"
 #include "svn_xml.h"
+#include "svn_ctype.h"
 
 #include "../libsvn_ra/ra_loader.h"
 #include "svn_private_config.h"
@@ -226,7 +227,9 @@ capabilities_headers_iterator_callback(v
     }
 
   /* SVN-specific headers -- if present, server supports HTTP protocol v2 */
-  else if (strncmp(key, "SVN", 3) == 0)
+  else if (!svn_ctype_casecmp(key[0], 'S')
+           && !svn_ctype_casecmp(key[1], 'V')
+           && !svn_ctype_casecmp(key[2], 'N'))
     {
       /* If we've not yet seen any information about supported POST
          requests, we'll initialize the list/hash with "create-txn"

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/update.c?rev=1652409&r1=1652408&r2=1652409&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/update.c Fri Jan 16 14:01:35 2015
@@ -771,7 +771,8 @@ get_best_connection(report_context_t *ct
          pending requests, thereby giving more work to lightly loaded server
          processes.
        */
-      unsigned int i, min = INT_MAX, best_conn = first_conn;
+      int i, best_conn = first_conn;
+      unsigned int min = INT_MAX;
       for (i = first_conn; i < ctx->sess->num_conns; i++)
         {
           serf_connection_t *sc = ctx->sess->conns[i]->conn;

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_repos/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_repos/deprecated.c?rev=1652409&r1=1652408&r2=1652409&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_repos/deprecated.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_repos/deprecated.c Fri Jan 16 14:01:35 2015
@@ -997,6 +997,35 @@ svn_repos_load_fs(svn_repos_t *repos,
 }
 
 svn_error_t *
+svn_repos_get_fs_build_parser4(const svn_repos_parse_fns3_t **callbacks,
+                               void **parse_baton,
+                               svn_repos_t *repos,
+                               svn_revnum_t start_rev,
+                               svn_revnum_t end_rev,
+                               svn_boolean_t use_history,
+                               svn_boolean_t validate_props,
+                               enum svn_repos_load_uuid uuid_action,
+                               const char *parent_dir,
+                               svn_repos_notify_func_t notify_func,
+                               void *notify_baton,
+                               apr_pool_t *pool)
+{
+  SVN_ERR(svn_repos_get_fs_build_parser5(callbacks, parse_baton,
+                                         repos,
+                                         start_rev, end_rev,
+                                         use_history,
+                                         validate_props,
+                                         uuid_action,
+                                         parent_dir,
+                                         FALSE, FALSE, /*hooks */
+                                         FALSE /*ignore_dates*/,
+                                         notify_func,
+                                         notify_baton,
+                                         pool));
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
 svn_repos_get_fs_build_parser3(const svn_repos_parse_fns2_t **callbacks,
                                void **parse_baton,
                                svn_repos_t *repos,

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_repos/dump.c?rev=1652409&r1=1652408&r2=1652409&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_repos/dump.c Fri Jan 16 14:01:35 2015
@@ -426,10 +426,6 @@ struct edit_baton
      revisions older than OLDEST_DUMPED_REV. */
   svn_boolean_t *found_old_mergeinfo;
 
-  /* reusable buffer for writing file contents */
-  char buffer[SVN__STREAM_CHUNK_SIZE];
-  apr_size_t bufsize;
-
   /* Structure allows us to verify the paths currently being dumped.
      If NULL, validity checks are being skipped. */
   path_tracker_t *path_tracker;
@@ -693,7 +689,6 @@ extract_mergeinfo_paths(void *baton, con
 struct filter_mergeinfo_paths_baton
 {
   apr_hash_t *paths;
-  svn_membuf_t buffer;
 };
 
 /* Compare two sets of denormalized paths from mergeinfo entries,
@@ -800,7 +795,6 @@ check_mergeinfo_normalization(const char
       normalized_paths = extract_baton.result;
 
       filter_baton.paths = added_paths;
-      filter_baton.buffer = extract_baton.buffer;
       SVN_ERR(svn_iter_apr_hash(NULL, oldinfo,
                                 filter_mergeinfo_paths,
                                 &filter_baton, pool));
@@ -826,7 +820,7 @@ check_mergeinfo_normalization(const char
 
    Write out a node record for PATH of type KIND under EB->FS_ROOT.
    ACTION describes what is happening to the node (see enum svn_node_action).
-   Write record to writable EB->STREAM, using EB->BUFFER to write in chunks.
+   Write record to writable EB->STREAM.
 
    If the node was itself copied, IS_COPY is TRUE and the
    path/revision of the copy source are in CMP_PATH/CMP_REV.  If
@@ -1651,7 +1645,6 @@ get_dump_editor(const svn_delta_editor_t
   eb->notify_func = notify_func;
   eb->notify_baton = notify_baton;
   eb->oldest_dumped_rev = oldest_dumped_rev;
-  eb->bufsize = sizeof(eb->buffer);
   eb->path = apr_pstrdup(pool, root_path);
   SVN_ERR(svn_fs_revision_root(&(eb->fs_root), fs, to_rev, pool));
   eb->fs = fs;
@@ -1719,8 +1712,6 @@ write_revision_record(svn_stream_t *stre
   svn_string_t *datevalue;
   svn_stream_t *propstream;
 
-  /* Read the revision props even if we're aren't going to dump
-     them for verification purposes */
   SVN_ERR(svn_fs_revision_proplist(&props, fs, rev, pool));
 
   /* Run revision date properties through the time conversion to

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_repos/load-fs-vtable.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_repos/load-fs-vtable.c?rev=1652409&r1=1652408&r2=1652409&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_repos/load-fs-vtable.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_repos/load-fs-vtable.c Fri Jan 16 14:01:35 2015
@@ -31,11 +31,9 @@
 #include "svn_string.h"
 #include "svn_props.h"
 #include "repos.h"
-#include "svn_private_config.h"
 #include "svn_mergeinfo.h"
 #include "svn_checksum.h"
 #include "svn_subst.h"
-#include "svn_ctype.h"
 #include "svn_dirent_uri.h"
 
 #include <apr_lib.h>
@@ -84,9 +82,9 @@ struct parse_baton
      SVN_INVALID_REVNUM. */
   svn_revnum_t last_rev_mapped;
 
-  /* The oldest old revision loaded from the dump stream.  If no revisions
+  /* The oldest revision loaded from the dump stream.  If no revisions
      have been loaded yet, this is set to SVN_INVALID_REVNUM. */
-  svn_revnum_t oldest_old_rev;
+  svn_revnum_t oldest_dumpstream_rev;
 };
 
 struct revision_baton
@@ -248,15 +246,15 @@ renumber_mergeinfo_revs(svn_string_t **f
      Remove mergeinfo older than the oldest revision in the dump stream
      and adjust its revisions by the difference between the head rev of
      the target repository and the current dump stream rev. */
-  if (rb->pb->oldest_old_rev > 1)
+  if (rb->pb->oldest_dumpstream_rev > 1)
     {
       SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges(
         &predates_stream_mergeinfo, mergeinfo,
-        rb->pb->oldest_old_rev - 1, 0,
+        rb->pb->oldest_dumpstream_rev - 1, 0,
         TRUE, subpool, subpool));
       SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges(
         &mergeinfo, mergeinfo,
-        rb->pb->oldest_old_rev - 1, 0,
+        rb->pb->oldest_dumpstream_rev - 1, 0,
         FALSE, subpool, subpool));
       SVN_ERR(svn_mergeinfo__adjust_mergeinfo_rangelists(
         &predates_stream_mergeinfo, predates_stream_mergeinfo,
@@ -285,7 +283,7 @@ renumber_mergeinfo_revs(svn_string_t **f
             {
               range->start = rev_from_map;
             }
-          else if (range->start == pb->oldest_old_rev - 1)
+          else if (range->start == pb->oldest_dumpstream_rev - 1)
             {
               /* Since the start revision of svn_merge_range_t are not
                  inclusive there is one possible valid start revision that
@@ -300,7 +298,7 @@ renumber_mergeinfo_revs(svn_string_t **f
                  oldest rev from the load stream and subtract 1 to get the
                  renumbered, non-inclusive, start revision. */
               rev_from_map = get_revision_mapping(pb->rev_map,
-                                                  pb->oldest_old_rev);
+                                                  pb->oldest_dumpstream_rev);
               if (SVN_IS_VALID_REVNUM(rev_from_map))
                 range->start = rev_from_map - 1;
             }
@@ -325,19 +323,12 @@ renumber_mergeinfo_revs(svn_string_t **f
     }
 
   if (predates_stream_mergeinfo)
+    {
       SVN_ERR(svn_mergeinfo_merge2(final_mergeinfo, predates_stream_mergeinfo,
                                    subpool, subpool));
+    }
 
-  SVN_ERR(svn_mergeinfo_sort(final_mergeinfo, subpool));
-
-  /* Mergeinfo revision sources for r0 and r1 are invalid; you can't merge r0
-     or r1.  However, svndumpfilter can be abused to produce r1 merge source
-     revs.  So if we encounter any, then strip them out, no need to put them
-     into the load target. */
-  SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges(&final_mergeinfo,
-                                                    final_mergeinfo,
-                                                    1, 0, FALSE,
-                                                    subpool, subpool));
+  SVN_ERR(svn_mergeinfo__canonicalize_ranges(final_mergeinfo, subpool));
 
   SVN_ERR(svn_mergeinfo_to_string(final_val, final_mergeinfo, pool));
   svn_pool_destroy(subpool);
@@ -350,6 +341,12 @@ renumber_mergeinfo_revs(svn_string_t **f
 /** vtable for doing commits to a fs **/
 
 
+/* Make a node baton, parsing the relevant HEADERS.
+ *
+ * If RB->pb->parent_dir:
+ *   prefix it to NB->path
+ *   prefix it to NB->copyfrom_path (if present)
+ */
 static svn_error_t *
 make_node_baton(struct node_baton **node_baton_p,
                 apr_hash_t *headers,
@@ -436,6 +433,10 @@ make_node_baton(struct node_baton **node
   return SVN_NO_ERROR;
 }
 
+/* Make a revision baton, parsing the relevant HEADERS.
+ *
+ * Set RB->skipped iff the revision number is outside the range given in PB.
+ */
 static struct revision_baton *
 make_revision_baton(apr_hash_t *headers,
                     struct parse_baton *pb,
@@ -514,8 +515,8 @@ new_revision_record(void **revision_bato
         }
 
       /* Stash the oldest "old" revision committed from the load stream. */
-      if (!SVN_IS_VALID_REVNUM(pb->oldest_old_rev))
-        pb->oldest_old_rev = rb->rev;
+      if (!SVN_IS_VALID_REVNUM(pb->oldest_dumpstream_rev))
+        pb->oldest_dumpstream_rev = rb->rev;
     }
 
   /* If we're skipping this revision, try to notify someone. */
@@ -542,7 +543,11 @@ new_revision_record(void **revision_bato
 
 
 
-/* Factorized helper func for new_node_record() */
+/* Perform a copy or a plain add.
+ *
+ * For a copy, also adjust the copy-from rev, check any copy-source checksum,
+ * and send a notification.
+ */
 static svn_error_t *
 maybe_add_with_history(struct node_baton *nb,
                        struct revision_baton *rb,
@@ -753,6 +758,67 @@ set_revision_property(void *baton,
 }
 
 
+/* Adjust mergeinfo:
+ *   - normalize line endings (if all CRLF, change to LF; but error if mixed);
+ *   - adjust revision numbers (see renumber_mergeinfo_revs());
+ *   - adjust paths (see prefix_mergeinfo_paths()).
+ */
+static svn_error_t *
+adjust_mergeinfo_property(struct revision_baton *rb,
+                          svn_string_t **new_value_p,
+                          const svn_string_t *old_value,
+                          apr_pool_t *result_pool)
+{
+  struct parse_baton *pb = rb->pb;
+  svn_string_t prop_val = *old_value;
+
+  /* Tolerate mergeinfo with "\r\n" line endings because some
+     dumpstream sources might contain as much.  If so normalize
+     the line endings to '\n' and notify that we have made this
+     correction. */
+  if (strstr(prop_val.data, "\r"))
+    {
+      const char *prop_eol_normalized;
+
+      SVN_ERR(svn_subst_translate_cstring2(prop_val.data,
+                                           &prop_eol_normalized,
+                                           "\n",  /* translate to LF */
+                                           FALSE, /* no repair */
+                                           NULL,  /* no keywords */
+                                           FALSE, /* no expansion */
+                                           result_pool));
+      prop_val.data = prop_eol_normalized;
+      prop_val.len = strlen(prop_eol_normalized);
+
+      if (pb->notify_func)
+        {
+          /* ### TODO: Use proper scratch pool instead of pb->notify_pool */
+          svn_repos_notify_t *notify
+                  = svn_repos_notify_create(
+                                svn_repos_notify_load_normalized_mergeinfo,
+                                pb->notify_pool);
+
+          pb->notify_func(pb->notify_baton, notify, pb->notify_pool);
+          svn_pool_clear(pb->notify_pool);
+        }
+    }
+
+  /* Renumber mergeinfo as appropriate. */
+  SVN_ERR(renumber_mergeinfo_revs(new_value_p, &prop_val, rb,
+                                  result_pool));
+
+  if (pb->parent_dir)
+    {
+      /* Prefix the merge source paths with PB->parent_dir. */
+      /* ASSUMPTION: All source paths are included in the dump stream. */
+      SVN_ERR(prefix_mergeinfo_paths(new_value_p, *new_value_p,
+                                     pb->parent_dir, result_pool));
+    }
+
+  return SVN_NO_ERROR;
+}
+
+
 static svn_error_t *
 set_node_property(void *baton,
                   const char *name,
@@ -766,55 +832,42 @@ set_node_property(void *baton,
   if (rb->skipped)
     return SVN_NO_ERROR;
 
+  /* Adjust mergeinfo. If this fails, presumably because the mergeinfo
+     property has an ill-formed value, then we must not fail to load
+     the repository (at least if it's a simple load with no revision
+     offset adjustments, path changes, etc.) so just warn and leave it
+     as it is. */
   if (strcmp(name, SVN_PROP_MERGEINFO) == 0)
     {
-      svn_string_t prop_val = *value;
-      svn_string_t *renumbered_mergeinfo;
+      svn_string_t *new_value;
+      svn_error_t *err;
 
-      /* Tolerate mergeinfo with "\r\n" line endings because some
-         dumpstream sources might contain as much.  If so normalize
-         the line endings to '\n' and make a notification to
-         PARSE_BATON->FEEDBACK_STREAM that we have made this
-         correction. */
-      if (strstr(prop_val.data, "\r"))
+      err = adjust_mergeinfo_property(rb, &new_value, value, nb->pool);
+      if (err)
         {
-          const char *prop_eol_normalized;
-
-          SVN_ERR(svn_subst_translate_cstring2(prop_val.data,
-                                               &prop_eol_normalized,
-                                               "\n",  /* translate to LF */
-                                               FALSE, /* no repair */
-                                               NULL,  /* no keywords */
-                                               FALSE, /* no expansion */
-                                               nb->pool));
-          prop_val.data = prop_eol_normalized;
-          prop_val.len = strlen(prop_eol_normalized);
-
+          if (pb->validate_props)
+            {
+              return svn_error_quick_wrap(
+                       err,
+                       _("Invalid svn:mergeinfo value"));
+            }
           if (pb->notify_func)
             {
-              /* ### TODO: Use proper scratch pool instead of pb->notify_pool */
               svn_repos_notify_t *notify
-                      = svn_repos_notify_create(
-                                    svn_repos_notify_load_normalized_mergeinfo,
-                                    pb->notify_pool);
+                = svn_repos_notify_create(svn_repos_notify_warning,
+                                          pb->notify_pool);
 
+              notify->warning = svn_repos_notify_warning_invalid_mergeinfo;
+              notify->warning_str = _("Invalid svn:mergeinfo value; "
+                                      "leaving unchanged");
               pb->notify_func(pb->notify_baton, notify, pb->notify_pool);
               svn_pool_clear(pb->notify_pool);
             }
+          svn_error_clear(err);
         }
-
-      /* Renumber mergeinfo as appropriate. */
-      SVN_ERR(renumber_mergeinfo_revs(&renumbered_mergeinfo, &prop_val, rb,
-                                      nb->pool));
-      value = renumbered_mergeinfo;
-      if (pb->parent_dir)
+      else
         {
-          /* Prefix the merge source paths with PB->parent_dir. */
-          /* ASSUMPTION: All source paths are included in the dump stream. */
-          svn_string_t *mergeinfo_val;
-          SVN_ERR(prefix_mergeinfo_paths(&mergeinfo_val, value,
-                                         pb->parent_dir, nb->pool));
-          value = mergeinfo_val;
+          value = new_value;
         }
     }
 
@@ -1082,7 +1135,7 @@ close_revision(void *baton)
 
 
 svn_error_t *
-svn_repos_get_fs_build_parser4(const svn_repos_parse_fns3_t **callbacks,
+svn_repos_get_fs_build_parser5(const svn_repos_parse_fns3_t **callbacks,
                                void **parse_baton,
                                svn_repos_t *repos,
                                svn_revnum_t start_rev,
@@ -1091,6 +1144,9 @@ svn_repos_get_fs_build_parser4(const svn
                                svn_boolean_t validate_props,
                                enum svn_repos_load_uuid uuid_action,
                                const char *parent_dir,
+                               svn_boolean_t use_pre_commit_hook,
+                               svn_boolean_t use_post_commit_hook,
+                               svn_boolean_t ignore_dates,
                                svn_repos_notify_func_t notify_func,
                                void *notify_baton,
                                apr_pool_t *pool)
@@ -1132,10 +1188,13 @@ svn_repos_get_fs_build_parser4(const svn
   pb->pool = pool;
   pb->notify_pool = svn_pool_create(pool);
   pb->rev_map = apr_hash_make(pool);
-  pb->oldest_old_rev = SVN_INVALID_REVNUM;
+  pb->oldest_dumpstream_rev = SVN_INVALID_REVNUM;
   pb->last_rev_mapped = SVN_INVALID_REVNUM;
   pb->start_rev = start_rev;
   pb->end_rev = end_rev;
+  pb->use_pre_commit_hook = use_pre_commit_hook;
+  pb->use_post_commit_hook = use_post_commit_hook;
+  pb->ignore_dates = ignore_dates;
 
   *callbacks = parser;
   *parse_baton = pb;
@@ -1162,28 +1221,23 @@ svn_repos_load_fs5(svn_repos_t *repos,
 {
   const svn_repos_parse_fns3_t *parser;
   void *parse_baton;
-  struct parse_baton *pb;
 
   /* This is really simple. */
 
-  SVN_ERR(svn_repos_get_fs_build_parser4(&parser, &parse_baton,
+  SVN_ERR(svn_repos_get_fs_build_parser5(&parser, &parse_baton,
                                          repos,
                                          start_rev, end_rev,
                                          TRUE, /* look for copyfrom revs */
                                          validate_props,
                                          uuid_action,
                                          parent_dir,
+                                         use_pre_commit_hook,
+                                         use_post_commit_hook,
+                                         ignore_dates,
                                          notify_func,
                                          notify_baton,
                                          pool));
 
-  /* Heh.  We know this is a parse_baton.  This file made it.  So
-     cast away, and set our hook booleans.  */
-  pb = parse_baton;
-  pb->use_pre_commit_hook = use_pre_commit_hook;
-  pb->use_post_commit_hook = use_post_commit_hook;
-  pb->ignore_dates = ignore_dates;
-
   return svn_repos_parse_dumpstream3(dumpstream, parser, parse_baton, FALSE,
                                      cancel_func, cancel_baton, pool);
 }

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_repos/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_repos/log.c?rev=1652409&r1=1652408&r2=1652409&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_repos/log.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_repos/log.c Fri Jan 16 14:01:35 2015
@@ -1070,6 +1070,7 @@ fill_log_entry(svn_log_entry_t *log_entr
 {
   apr_hash_t *r_props, *changed_paths = NULL;
   svn_boolean_t get_revprops = TRUE, censor_revprops = FALSE;
+  svn_boolean_t want_revprops = !revprops || revprops->nelts;
 
   /* Discover changed paths if the user requested them
      or if we need to check that they are readable. */
@@ -1111,7 +1112,7 @@ fill_log_entry(svn_log_entry_t *log_entr
         changed_paths = NULL;
     }
 
-  if (get_revprops)
+  if (get_revprops && want_revprops)
     {
       /* User is allowed to see at least some revprops. */
       SVN_ERR(svn_fs_revision_proplist(&r_props, fs, rev, pool));