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 2014/08/06 06:50:19 UTC

svn commit: r1616095 [2/4] - in /subversion/branches/svn-auth-x509: ./ subversion/bindings/javahl/native/ subversion/bindings/swig/python/svn/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_delta/ subversion...

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_client/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_client/upgrade.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_client/upgrade.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_client/upgrade.c Wed Aug  6 04:50:16 2014
@@ -131,8 +131,8 @@ svn_client_upgrade(const char *path,
       const char *externals_parent_url;
       const char *externals_parent_repos_root_url;
       const char *externals_parent_repos_relpath;
-      const char *externals_parent = svn__apr_hash_index_key(hi);
-      svn_string_t *external_desc = svn__apr_hash_index_val(hi);
+      const char *externals_parent = apr_hash_this_key(hi);
+      svn_string_t *external_desc = apr_hash_this_val(hi);
       apr_array_header_t *externals_p;
       svn_error_t *err;
 

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_delta/compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_delta/compat.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_delta/compat.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_delta/compat.c Wed Aug  6 04:50:16 2014
@@ -295,7 +295,7 @@ get_children(struct ev2_edit_baton *eb,
 
   for (hi = apr_hash_first(pool, eb->changes); hi; hi = apr_hash_next(hi))
     {
-      const char *repos_relpath = svn__apr_hash_index_key(hi);
+      const char *repos_relpath = apr_hash_this_key(hi);
       const char *child;
 
       /* Find potential children. */

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_delta/debug_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_delta/debug_editor.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_delta/debug_editor.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_delta/debug_editor.c Wed Aug  6 04:50:16 2014
@@ -33,6 +33,7 @@ struct edit_baton
   int indent_level;
 
   svn_stream_t *out;
+  const char *prefix;
 };
 
 struct dir_baton
@@ -52,8 +53,7 @@ write_indent(struct edit_baton *eb, apr_
 {
   int i;
 
-  /* This is DBG_FLAG from ../libsvn_subr/debug.c */
-  SVN_ERR(svn_stream_puts(eb->out, "DBG:"));
+  SVN_ERR(svn_stream_puts(eb->out, eb->prefix));
   for (i = 0; i < eb->indent_level; ++i)
     SVN_ERR(svn_stream_puts(eb->out, " "));
 
@@ -391,19 +391,34 @@ close_edit(void *edit_baton,
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+abort_edit(void *edit_baton,
+           apr_pool_t *pool)
+{
+  struct edit_baton *eb = edit_baton;
+
+  SVN_ERR(write_indent(eb, pool));
+  SVN_ERR(svn_stream_printf(eb->out, pool, "abort_edit\n"));
+
+  SVN_ERR(eb->wrapped_editor->abort_edit(eb->wrapped_edit_baton, pool));
+
+  return SVN_NO_ERROR;
+}
+
 svn_error_t *
 svn_delta__get_debug_editor(const svn_delta_editor_t **editor,
                             void **edit_baton,
                             const svn_delta_editor_t *wrapped_editor,
                             void *wrapped_edit_baton,
+                            const char *prefix,
                             apr_pool_t *pool)
 {
-  svn_delta_editor_t *tree_editor = svn_delta_default_editor(pool);
+  svn_delta_editor_t *tree_editor = apr_palloc(pool, sizeof(*tree_editor));
   struct edit_baton *eb = apr_palloc(pool, sizeof(*eb));
   apr_file_t *errfp;
   svn_stream_t *out;
 
-  apr_status_t apr_err = apr_file_open_stderr(&errfp, pool);
+  apr_status_t apr_err = apr_file_open_stdout(&errfp, pool);
   if (apr_err)
     return svn_error_wrap_apr(apr_err, "Problem opening stderr");
 
@@ -424,11 +439,14 @@ svn_delta__get_debug_editor(const svn_de
   tree_editor->close_file = close_file;
   tree_editor->absent_file = absent_file;
   tree_editor->close_edit = close_edit;
+  tree_editor->abort_edit = abort_edit;
 
   eb->wrapped_editor = wrapped_editor;
   eb->wrapped_edit_baton = wrapped_edit_baton;
   eb->out = out;
   eb->indent_level = 0;
+  /* This is DBG_FLAG from ../libsvn_subr/debug.c */
+  eb->prefix = apr_pstrcat(pool, "DBG: ", prefix, SVN_VA_NULL);
 
   *editor = tree_editor;
   *edit_baton = eb;

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_delta/debug_editor.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_delta/debug_editor.h?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_delta/debug_editor.h (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_delta/debug_editor.h Wed Aug  6 04:50:16 2014
@@ -32,14 +32,19 @@ extern "C" {
 /* Return a debug editor that wraps @a wrapped_editor.
  *
  * The debug editor simply prints an indication of what callbacks are being
- * called to @c stderr, and is only intended for use in debugging subversion
+ * called to @c stdout, and is only intended for use in debugging subversion
  * editors.
+ *
+ * @a prefix, if non-null, is printed between "DBG: " and each indication.
+ *
+ * Note: Our test suite generally ignores stdout lines starting with "DBG:".
  */
 svn_error_t *
 svn_delta__get_debug_editor(const svn_delta_editor_t **editor,
                             void **edit_baton,
                             const svn_delta_editor_t *wrapped_editor,
                             void *wrapped_baton,
+                            const char *prefix,
                             apr_pool_t *pool);
 
 #ifdef __cplusplus

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_diff/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_diff/util.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_diff/util.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_diff/util.c Wed Aug  6 04:50:16 2014
@@ -465,8 +465,8 @@ display_mergeinfo_diff(const char *old_m
   for (hi = apr_hash_first(pool, deleted);
        hi; hi = apr_hash_next(hi))
     {
-      const char *from_path = svn__apr_hash_index_key(hi);
-      svn_rangelist_t *merge_revarray = svn__apr_hash_index_val(hi);
+      const char *from_path = apr_hash_this_key(hi);
+      svn_rangelist_t *merge_revarray = apr_hash_this_val(hi);
       svn_string_t *merge_revstr;
 
       svn_pool_clear(iterpool);
@@ -482,8 +482,8 @@ display_mergeinfo_diff(const char *old_m
   for (hi = apr_hash_first(pool, added);
        hi; hi = apr_hash_next(hi))
     {
-      const char *from_path = svn__apr_hash_index_key(hi);
-      svn_rangelist_t *merge_revarray = svn__apr_hash_index_val(hi);
+      const char *from_path = apr_hash_this_key(hi);
+      svn_rangelist_t *merge_revarray = apr_hash_this_val(hi);
       svn_string_t *merge_revstr;
 
       svn_pool_clear(iterpool);

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs/access.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs/access.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs/access.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs/access.c Wed Aug  6 04:50:16 2014
@@ -91,13 +91,6 @@ svn_fs_access_add_lock_token2(svn_fs_acc
   return SVN_NO_ERROR;
 }
 
-svn_error_t *
-svn_fs_access_add_lock_token(svn_fs_access_t *access_ctx,
-                             const char *token)
-{
-  return svn_fs_access_add_lock_token2(access_ctx, (const char *) 1, token);
-}
-
 apr_hash_t *
 svn_fs__access_get_lock_tokens(svn_fs_access_t *access_ctx)
 {

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs/editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs/editor.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs/editor.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs/editor.c Wed Aug  6 04:50:16 2014
@@ -94,8 +94,8 @@ add_new_props(svn_fs_root_t *root,
   for (hi = apr_hash_first(scratch_pool, props); hi;
        hi = apr_hash_next(hi))
     {
-      const char *name = svn__apr_hash_index_key(hi);
-      const svn_string_t *value = svn__apr_hash_index_val(hi);
+      const char *name = apr_hash_this_key(hi);
+      const svn_string_t *value = apr_hash_this_val(hi);
 
       svn_pool_clear(iterpool);
 

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs/fs-loader.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs/fs-loader.c Wed Aug  6 04:50:16 2014
@@ -559,12 +559,6 @@ svn_fs_upgrade2(const char *path,
 }
 
 svn_error_t *
-svn_fs_upgrade(const char *path, apr_pool_t *pool)
-{
-  return svn_error_trace(svn_fs_upgrade2(path, NULL, NULL, NULL, NULL, pool));
-}
-
-svn_error_t *
 svn_fs_verify(const char *path,
               apr_hash_t *fs_config,
               svn_revnum_t start,
@@ -679,26 +673,6 @@ svn_fs_hotcopy3(const char *src_path, co
 }
 
 svn_error_t *
-svn_fs_hotcopy2(const char *src_path, const char *dest_path,
-                svn_boolean_t clean, svn_boolean_t incremental,
-                svn_cancel_func_t cancel_func, void *cancel_baton,
-                apr_pool_t *scratch_pool)
-{
-  return svn_error_trace(svn_fs_hotcopy3(src_path, dest_path, clean,
-                                         incremental, NULL, NULL,
-                                         cancel_func, cancel_baton,
-                                         scratch_pool));
-}
-
-svn_error_t *
-svn_fs_hotcopy(const char *src_path, const char *dest_path,
-               svn_boolean_t clean, apr_pool_t *pool)
-{
-  return svn_error_trace(svn_fs_hotcopy2(src_path, dest_path, clean,
-                                         FALSE, NULL, NULL, pool));
-}
-
-svn_error_t *
 svn_fs_pack(const char *path,
             svn_fs_pack_notify_t notify_func,
             void *notify_baton,
@@ -848,14 +822,6 @@ svn_fs_begin_txn2(svn_fs_txn_t **txn_p, 
 
 
 svn_error_t *
-svn_fs_begin_txn(svn_fs_txn_t **txn_p, svn_fs_t *fs, svn_revnum_t rev,
-                 apr_pool_t *pool)
-{
-  return svn_error_trace(svn_fs_begin_txn2(txn_p, fs, rev, 0, pool));
-}
-
-
-svn_error_t *
 svn_fs_commit_txn(const char **conflict_p, svn_revnum_t *new_rev,
                    svn_fs_txn_t *txn, apr_pool_t *pool)
 {
@@ -1561,14 +1527,6 @@ svn_fs_change_rev_prop2(svn_fs_t *fs, sv
 }
 
 svn_error_t *
-svn_fs_change_rev_prop(svn_fs_t *fs, svn_revnum_t rev, const char *name,
-                       const svn_string_t *value, apr_pool_t *pool)
-{
-  return svn_error_trace(
-           svn_fs_change_rev_prop2(fs, rev, name, NULL, value, pool));
-}
-
-svn_error_t *
 svn_fs_get_file_delta_stream(svn_txdelta_stream_t **stream_p,
                              svn_fs_root_t *source_root,
                              const char *source_path,
@@ -1636,7 +1594,7 @@ svn_fs_lock_many(svn_fs_t *fs,
   /* Enforce that the token be an XML-safe URI. */
   for (hi = apr_hash_first(scratch_pool, targets); hi; hi = apr_hash_next(hi))
     {
-      const svn_fs_lock_target_t *target = svn__apr_hash_index_val(hi);
+      const svn_fs_lock_target_t *target = apr_hash_this_val(hi);
 
       err = SVN_NO_ERROR;
       if (target->token)
@@ -1670,12 +1628,12 @@ svn_fs_lock_many(svn_fs_t *fs,
       if (err)
         {
           if (!cb_err && lock_callback)
-            cb_err = lock_callback(lock_baton, svn__apr_hash_index_key(hi),
+            cb_err = lock_callback(lock_baton, apr_hash_this_key(hi),
                                    NULL, err, scratch_pool);
           svn_error_clear(err);
         }
       else
-        svn_hash_sets(ok_targets, svn__apr_hash_index_key(hi), target);
+        svn_hash_sets(ok_targets, apr_hash_this_key(hi), target);
     }
 
   if (!apr_hash_count(ok_targets))
@@ -1832,16 +1790,6 @@ svn_fs_get_locks2(svn_fs_t *fs, const ch
                                                get_locks_baton, pool));
 }
 
-svn_error_t *
-svn_fs_get_locks(svn_fs_t *fs, const char *path,
-                 svn_fs_get_locks_callback_t get_locks_func,
-                 void *get_locks_baton, apr_pool_t *pool)
-{
-  return svn_error_trace(svn_fs_get_locks2(fs, path, svn_depth_infinity,
-                                           get_locks_func, get_locks_baton,
-                                           pool));
-}
-
 
 /* --- History functions --- */
 

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_base/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_base/lock.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_base/lock.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_base/lock.c Wed Aug  6 04:50:16 2014
@@ -247,8 +247,8 @@ svn_fs_base__lock(svn_fs_t *fs,
   for (hi = apr_hash_first(scratch_pool, targets); hi; hi = apr_hash_next(hi))
     {
       struct lock_args args;
-      const char *path = svn__apr_hash_index_key(hi);
-      const svn_fs_lock_target_t *target = svn__apr_hash_index_val(hi);
+      const char *path = apr_hash_this_key(hi);
+      const svn_fs_lock_target_t *target = apr_hash_this_val(hi);
       svn_lock_t *lock;
       svn_error_t *err;
 
@@ -362,8 +362,8 @@ svn_fs_base__unlock(svn_fs_t *fs,
   for (hi = apr_hash_first(scratch_pool, targets); hi; hi = apr_hash_next(hi))
     {
       struct unlock_args args;
-      const char *path = svn__apr_hash_index_key(hi);
-      const char *token = svn__apr_hash_index_val(hi);
+      const char *path = apr_hash_this_key(hi);
+      const char *token = apr_hash_this_val(hi);
       svn_error_t *err;
 
       args.path = svn_fs__canonicalize_abspath(path, result_pool);

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_base/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_base/tree.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_base/tree.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_base/tree.c Wed Aug  6 04:50:16 2014
@@ -1615,7 +1615,7 @@ base_dir_optimal_order(apr_array_header_
   apr_array_header_t *result = apr_array_make(pool, apr_hash_count(entries),
                                               sizeof(svn_fs_dirent_t *));
   for (hi = apr_hash_first(pool, entries); hi; hi = apr_hash_next(hi))
-    APR_ARRAY_PUSH(result, svn_fs_dirent_t *) = svn__apr_hash_index_val(hi);
+    APR_ARRAY_PUSH(result, svn_fs_dirent_t *) = apr_hash_this_val(hi);
 
   *ordered_p = result;
   return SVN_NO_ERROR;

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/cached_data.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/cached_data.c Wed Aug  6 04:50:16 2014
@@ -462,20 +462,11 @@ get_fs_id_at_offset(svn_fs_id_t **id_p,
    changed path offset in *CHANGES_OFFSET.  If either of these
    pointers is NULL, do nothing with it.
 
-   If PACKED is true, REV_FILE should be a packed shard file.
-   ### There is currently no such parameter.  This function assumes that
-       svn_fs_fs__is_packed_rev(FS, REV) will indicate whether REV_FILE is
-       a packed file.  Therefore FS->fsap_data->min_unpacked_rev must not
-       have been refreshed since REV_FILE was opened if there is a
-       possibility that revision REV may have become packed since then.
-       TODO: Take an IS_PACKED parameter instead, in order to remove this
-       requirement.
-
    Allocate temporary variables from POOL. */
 static svn_error_t *
 get_root_changes_offset(apr_off_t *root_offset,
                         apr_off_t *changes_offset,
-                        apr_file_t *rev_file,
+                        svn_fs_fs__revision_file_t *rev_file,
                         svn_fs_t *fs,
                         svn_revnum_t rev,
                         apr_pool_t *pool)
@@ -498,8 +489,7 @@ get_root_changes_offset(apr_off_t *root_
      Unless the next revision is in a different file, in which case, we can
      just seek to the end of the pack file -- just like we do in the
      non-packed case. */
-  if (svn_fs_fs__is_packed_rev(fs, rev)
-      && ((rev + 1) % ffd->max_files_per_dir != 0))
+  if (rev_file->is_packed && ((rev + 1) % ffd->max_files_per_dir != 0))
     {
       SVN_ERR(svn_fs_fs__get_packed_offset(&end, fs, rev + 1, pool));
       seek_relative = APR_SET;
@@ -511,14 +501,14 @@ get_root_changes_offset(apr_off_t *root_
     }
 
   /* Offset of the revision from the start of the pack file, if applicable. */
-  if (svn_fs_fs__is_packed_rev(fs, rev))
+  if (rev_file->is_packed)
     SVN_ERR(svn_fs_fs__get_packed_offset(&rev_offset, fs, rev, pool));
   else
     rev_offset = 0;
 
   /* We will assume that the last line containing the two offsets
      will never be longer than 64 characters. */
-  SVN_ERR(svn_io_file_seek(rev_file, seek_relative, &end, pool));
+  SVN_ERR(svn_io_file_seek(rev_file->file, seek_relative, &end, pool));
 
   if (end < sizeof(buffer))
     {
@@ -532,8 +522,9 @@ get_root_changes_offset(apr_off_t *root_
     }
 
   /* Read in this last block, from which we will identify the last line. */
-  SVN_ERR(aligned_seek(fs, rev_file, NULL, start, pool));
-  SVN_ERR(svn_io_file_read_full2(rev_file, buffer, len, NULL, NULL, pool));
+  SVN_ERR(aligned_seek(fs, rev_file->file, NULL, start, pool));
+  SVN_ERR(svn_io_file_read_full2(rev_file->file, buffer, len, NULL, NULL,
+                                 pool));
 
   /* Parse the last line. */
   trailer = svn_stringbuf_ncreate(buffer, len, pool);
@@ -580,7 +571,7 @@ svn_fs_fs__rev_get_root(svn_fs_id_t **ro
       SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&revision_file, fs, rev,
                                                scratch_pool, scratch_pool));
       SVN_ERR(get_root_changes_offset(&root_offset, NULL,
-                                      revision_file->file, fs, rev,
+                                      revision_file, fs, rev,
                                       scratch_pool));
 
       SVN_ERR(get_fs_id_at_offset(&root_id, revision_file, fs, rev,
@@ -2418,8 +2409,7 @@ read_dir_entries(apr_array_header_t *ent
     {
       apr_hash_index_t *hi;
       for (hi = apr_hash_first(iterpool, hash); hi; hi = apr_hash_next(hi))
-        APR_ARRAY_PUSH(entries, svn_fs_dirent_t *)
-          = svn__apr_hash_index_val(hi);
+        APR_ARRAY_PUSH(entries, svn_fs_dirent_t *) = apr_hash_this_val(hi);
     }
 
   if (!sorted(entries))
@@ -2727,7 +2717,7 @@ svn_fs_fs__get_changes(apr_array_header_
                                            scratch_pool));
           else
             SVN_ERR(get_root_changes_offset(NULL, &changes_offset,
-                                            revision_file->file, fs, rev,
+                                            revision_file, fs, rev,
                                             scratch_pool));
 
           /* Actual reading and parsing are the same, though. */

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/fs.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/fs.c Wed Aug  6 04:50:16 2014
@@ -155,11 +155,22 @@ fs_freeze_body(void *baton,
 }
 
 static svn_error_t *
+fs_freeze_body2(void *baton,
+                apr_pool_t *pool)
+{
+  struct fs_freeze_baton_t *b = baton;
+  SVN_ERR(svn_fs_fs__with_write_lock(b->fs, fs_freeze_body, baton, pool));
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
 fs_freeze(svn_fs_t *fs,
           svn_fs_freeze_func_t freeze_func,
           void *freeze_baton,
           apr_pool_t *pool)
 {
+  fs_fs_data_t *ffd = fs->fsap_data;
   struct fs_freeze_baton_t b;
 
   b.fs = fs;
@@ -167,7 +178,11 @@ fs_freeze(svn_fs_t *fs,
   b.freeze_baton = freeze_baton;
 
   SVN_ERR(svn_fs__check_fs(fs, TRUE));
-  SVN_ERR(svn_fs_fs__with_write_lock(fs, fs_freeze_body, &b, pool));
+
+  if (ffd->format >= SVN_FS_FS__MIN_PACK_LOCK_FORMAT)
+    SVN_ERR(svn_fs_fs__with_pack_lock(fs, fs_freeze_body2, &b, pool));
+  else
+    SVN_ERR(fs_freeze_body2(&b, pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/hotcopy.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/hotcopy.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/hotcopy.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/hotcopy.c Wed Aug  6 04:50:16 2014
@@ -987,7 +987,7 @@ hotcopy_body(void *baton, apr_pool_t *po
   if (dst_ffd->format >= SVN_FS_FS__MIN_REP_SHARING_FORMAT)
     {
       /* Copy the rep cache and then remove entries for revisions
-      /* that did not make it into the destination. */
+       * that did not make it into the destination. */
       src_subdir = svn_dirent_join(src_fs->path, REP_CACHE_DB_NAME, pool);
       dst_subdir = svn_dirent_join(dst_fs->path, REP_CACHE_DB_NAME, pool);
       SVN_ERR(svn_io_check_path(src_subdir, &kind, pool));
@@ -1017,7 +1017,8 @@ hotcopy_body(void *baton, apr_pool_t *po
   return SVN_NO_ERROR;
 }
 
-/* Wrapper around hotcopy_body taking out all necessary source repositories.
+/* Wrapper around hotcopy_body taking out all necessary source repository
+ * locks.
  */
 static svn_error_t *
 hotcopy_locking_src_body(void *baton, apr_pool_t *pool)

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/lock.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/lock.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/lock.c Wed Aug  6 04:50:16 2014
@@ -212,8 +212,8 @@ write_digest_file(apr_hash_t *children,
       for (hi = apr_hash_first(pool, children); hi; hi = apr_hash_next(hi))
         {
           svn_stringbuf_appendbytes(children_list,
-                                    svn__apr_hash_index_key(hi),
-                                    svn__apr_hash_index_klen(hi));
+                                    apr_hash_this_key(hi),
+                                    apr_hash_this_key_len(hi));
           svn_stringbuf_appendbyte(children_list, '\n');
         }
       hash_store(hash, CHILDREN_KEY, sizeof(CHILDREN_KEY)-1,
@@ -611,7 +611,7 @@ walk_digest_files(const char *fs_path,
   subpool = svn_pool_create(pool);
   for (hi = apr_hash_first(pool, children); hi; hi = apr_hash_next(hi))
     {
-      const char *digest = svn__apr_hash_index_key(hi);
+      const char *digest = apr_hash_this_key(hi);
       svn_pool_clear(subpool);
       SVN_ERR(walk_digest_files
               (fs_path, digest_path_from_digest(fs_path, digest, subpool),
@@ -1225,8 +1225,8 @@ svn_fs_fs__lock(svn_fs_t *fs,
      one, choosing one with a token if possible. */
   for (hi = apr_hash_first(scratch_pool, targets); hi; hi = apr_hash_next(hi))
     {
-      const char *path = svn__apr_hash_index_key(hi);
-      const svn_fs_lock_target_t *target = svn__apr_hash_index_val(hi);
+      const char *path = apr_hash_this_key(hi);
+      const svn_fs_lock_target_t *target = apr_hash_this_val(hi);
       const svn_fs_lock_target_t *other;
 
       path = svn_fspath__canonicalize(path, result_pool);
@@ -1315,8 +1315,8 @@ svn_fs_fs__unlock(svn_fs_t *fs,
 
   for (hi = apr_hash_first(scratch_pool, targets); hi; hi = apr_hash_next(hi))
     {
-      const char *path = svn__apr_hash_index_key(hi);
-      const char *token = svn__apr_hash_index_val(hi);
+      const char *path = apr_hash_this_key(hi);
+      const char *token = apr_hash_this_val(hi);
       const char *other;
 
       path = svn_fspath__canonicalize(path, result_pool);

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/recovery.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/recovery.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/recovery.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/recovery.c Wed Aug  6 04:50:16 2014
@@ -220,7 +220,7 @@ recover_find_max_ids(svn_fs_t *fs,
       const svn_fs_fs__id_part_t *rev_item;
       apr_uint64_t node_id, copy_id;
       apr_off_t child_dir_offset;
-      const svn_string_t *path = svn__apr_hash_index_val(hi);
+      const svn_string_t *path = apr_hash_this_val(hi);
 
       svn_pool_clear(iterpool);
 

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/temp_serializer.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/temp_serializer.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/temp_serializer.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/temp_serializer.c Wed Aug  6 04:50:16 2014
@@ -597,8 +597,8 @@ svn_fs_fs__serialize_properties(void **d
   /* populate it with the hash entries */
   for (hi = apr_hash_first(pool, hash), i=0; hi; hi = apr_hash_next(hi), ++i)
     {
-      properties.keys[i] = svn__apr_hash_index_key(hi);
-      properties.values[i] = svn__apr_hash_index_val(hi);
+      properties.keys[i] = apr_hash_this_key(hi);
+      properties.values[i] = apr_hash_this_val(hi);
     }
 
   /* serialize it */
@@ -1268,7 +1268,7 @@ svn_fs_fs__serialize_mergeinfo(void **da
   i = 0;
   for (hi = apr_hash_first(pool, mergeinfo); hi; hi = apr_hash_next(hi))
     {
-      svn_rangelist_t *ranges = svn__apr_hash_index_val(hi);
+      svn_rangelist_t *ranges = apr_hash_this_val(hi);
       for (k = 0; k < ranges->nelts; ++k, ++i)
         merges.ranges[i] = *APR_ARRAY_IDX(ranges, k, svn_merge_range_t*);
     }

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/transaction.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/transaction.c Wed Aug  6 04:50:16 2014
@@ -3223,7 +3223,7 @@ verify_locks(svn_fs_t *fs,
   for (hi = apr_hash_first(pool, changed_paths); hi; hi = apr_hash_next(hi))
     {
       APR_ARRAY_PUSH(changed_paths_sorted, const char *) =
-        svn__apr_hash_index_key(hi);
+        apr_hash_this_key(hi);
     }
   svn_sort__array(changed_paths_sorted, svn_sort_compare_paths);
 
@@ -3416,7 +3416,7 @@ upgrade_transaction(svn_fs_t *fs,
          Other IDs (noderevs and their usage in directories) will only be
          assigned later anyways. */
 
-      name = svn__apr_hash_index_key(hi);
+      name = apr_hash_this_key(hi);
       if (!is_noderev_file(name))
         continue;
 
@@ -3897,8 +3897,8 @@ svn_fs_fs__list_transactions(apr_array_h
   /* Loop through all the entries and return anything that ends with '.txn'. */
   for (hi = apr_hash_first(pool, dirents); hi; hi = apr_hash_next(hi))
     {
-      const char *name = svn__apr_hash_index_key(hi);
-      apr_ssize_t klen = svn__apr_hash_index_klen(hi);
+      const char *name = apr_hash_this_key(hi);
+      apr_ssize_t klen = apr_hash_this_key_len(hi);
       const char *id;
 
       /* The name must end with ".txn" to be considered a transaction. */

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/tree.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/tree.c Wed Aug  6 04:50:16 2014
@@ -1072,7 +1072,7 @@ open_path(parent_path_t **parent_path_p,
 
           if (flags & open_path_node_only)
             {
-              /* Shortcut: the caller only wan'ts the final DAG node. */
+              /* Shortcut: the caller only wants the final DAG node. */
               parent_path->node = child;
             }
           else

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_util/fs-util.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_util/fs-util.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_util/fs-util.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_util/fs-util.c Wed Aug  6 04:50:16 2014
@@ -214,8 +214,8 @@ svn_fs__append_to_merged_froms(svn_merge
   *output = apr_hash_make(pool);
   for (hi = apr_hash_first(pool, input); hi; hi = apr_hash_next(hi))
     {
-      const char *path = svn__apr_hash_index_key(hi);
-      svn_rangelist_t *rangelist = svn__apr_hash_index_val(hi);
+      const char *path = apr_hash_this_key(hi);
+      svn_rangelist_t *rangelist = apr_hash_this_val(hi);
 
       svn_hash_sets(*output,
                     svn_fspath__join(path, rel_path, pool),

Propchange: subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/
------------------------------------------------------------------------------
  Merged /subversion/trunk/subversion/libsvn_fs_x:r1613462-1616093

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/cached_data.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/cached_data.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/cached_data.c Wed Aug  6 04:50:16 2014
@@ -2440,8 +2440,7 @@ read_dir_entries(apr_array_header_t *ent
     {
       apr_hash_index_t *hi;
       for (hi = apr_hash_first(iterpool, hash); hi; hi = apr_hash_next(hi))
-        APR_ARRAY_PUSH(entries, svn_fs_dirent_t *)
-          = svn__apr_hash_index_val(hi);
+        APR_ARRAY_PUSH(entries, svn_fs_dirent_t *) = apr_hash_this_val(hi);
     }
 
   if (!sorted(entries))

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/lock.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/lock.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/lock.c Wed Aug  6 04:50:16 2014
@@ -212,8 +212,8 @@ write_digest_file(apr_hash_t *children,
       for (hi = apr_hash_first(pool, children); hi; hi = apr_hash_next(hi))
         {
           svn_stringbuf_appendbytes(children_list,
-                                    svn__apr_hash_index_key(hi),
-                                    svn__apr_hash_index_klen(hi));
+                                    apr_hash_this_key(hi),
+                                    apr_hash_this_key_len(hi));
           svn_stringbuf_appendbyte(children_list, '\n');
         }
       hash_store(hash, CHILDREN_KEY, sizeof(CHILDREN_KEY)-1,
@@ -611,7 +611,7 @@ walk_digest_files(const char *fs_path,
   subpool = svn_pool_create(pool);
   for (hi = apr_hash_first(pool, children); hi; hi = apr_hash_next(hi))
     {
-      const char *digest = svn__apr_hash_index_key(hi);
+      const char *digest = apr_hash_this_key(hi);
       svn_pool_clear(subpool);
       SVN_ERR(walk_digest_files
               (fs_path, digest_path_from_digest(fs_path, digest, subpool),
@@ -1225,8 +1225,8 @@ svn_fs_x__lock(svn_fs_t *fs,
      one, choosing one with a token if possible. */
   for (hi = apr_hash_first(scratch_pool, targets); hi; hi = apr_hash_next(hi))
     {
-      const char *path = svn__apr_hash_index_key(hi);
-      const svn_fs_lock_target_t *target = svn__apr_hash_index_val(hi);
+      const char *path = apr_hash_this_key(hi);
+      const svn_fs_lock_target_t *target = apr_hash_this_val(hi);
       const svn_fs_lock_target_t *other;
 
       path = svn_fspath__canonicalize(path, result_pool);
@@ -1315,8 +1315,8 @@ svn_fs_x__unlock(svn_fs_t *fs,
 
   for (hi = apr_hash_first(scratch_pool, targets); hi; hi = apr_hash_next(hi))
     {
-      const char *path = svn__apr_hash_index_key(hi);
-      const char *token = svn__apr_hash_index_val(hi);
+      const char *path = apr_hash_this_key(hi);
+      const char *token = apr_hash_this_val(hi);
       const char *other;
 
       path = svn_fspath__canonicalize(path, result_pool);

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/temp_serializer.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/temp_serializer.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/temp_serializer.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/temp_serializer.c Wed Aug  6 04:50:16 2014
@@ -588,8 +588,8 @@ svn_fs_x__serialize_properties(void **da
   /* populate it with the hash entries */
   for (hi = apr_hash_first(pool, hash), i=0; hi; hi = apr_hash_next(hi), ++i)
     {
-      properties.keys[i] = svn__apr_hash_index_key(hi);
-      properties.values[i] = svn__apr_hash_index_val(hi);
+      properties.keys[i] = apr_hash_this_key(hi);
+      properties.values[i] = apr_hash_this_val(hi);
     }
 
   /* serialize it */
@@ -1266,7 +1266,7 @@ svn_fs_x__serialize_mergeinfo(void **dat
   i = 0;
   for (hi = apr_hash_first(pool, mergeinfo); hi; hi = apr_hash_next(hi))
     {
-      svn_rangelist_t *ranges = svn__apr_hash_index_val(hi);
+      svn_rangelist_t *ranges = apr_hash_this_val(hi);
       for (k = 0; k < ranges->nelts; ++k, ++i)
         merges.ranges[i] = *APR_ARRAY_IDX(ranges, k, svn_merge_range_t*);
     }

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/transaction.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/transaction.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/transaction.c Wed Aug  6 04:50:16 2014
@@ -3084,7 +3084,7 @@ verify_locks(svn_fs_t *fs,
   changed_paths = apr_array_make(pool, apr_hash_count(changes) + 1,
                                  sizeof(const char *));
   for (hi = apr_hash_first(pool, changes); hi; hi = apr_hash_next(hi))
-    APR_ARRAY_PUSH(changed_paths, const char *) = svn__apr_hash_index_key(hi);
+    APR_ARRAY_PUSH(changed_paths, const char *) = apr_hash_this_key(hi);
   svn_sort__array(changed_paths, svn_sort_compare_paths);
 
   /* Now, traverse the array of changed paths, verify locks.  Note
@@ -3455,8 +3455,8 @@ svn_fs_x__list_transactions(apr_array_he
   /* Loop through all the entries and return anything that ends with '.txn'. */
   for (hi = apr_hash_first(pool, dirents); hi; hi = apr_hash_next(hi))
     {
-      const char *name = svn__apr_hash_index_key(hi);
-      apr_ssize_t klen = svn__apr_hash_index_klen(hi);
+      const char *name = apr_hash_this_key(hi);
+      apr_ssize_t klen = apr_hash_this_key_len(hi);
       const char *id;
 
       /* The name must end with ".txn" to be considered a transaction. */

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_ra/compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_ra/compat.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_ra/compat.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_ra/compat.c Wed Aug  6 04:50:16 2014
@@ -922,9 +922,9 @@ svn_ra__get_inherited_props_walk(svn_ra_
            hi;
            hi = apr_hash_next(hi))
         {
-          const char *name = svn__apr_hash_index_key(hi);
-          apr_ssize_t klen = svn__apr_hash_index_klen(hi);
-          svn_string_t *value = svn__apr_hash_index_val(hi);
+          const char *name = apr_hash_this_key(hi);
+          apr_ssize_t klen = apr_hash_this_key_len(hi);
+          svn_string_t *value = apr_hash_this_val(hi);
 
           if (svn_property_kind2(name) == svn_prop_regular_kind)
             {

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_ra/ra_loader.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_ra/ra_loader.c Wed Aug  6 04:50:16 2014
@@ -1208,7 +1208,7 @@ svn_error_t *svn_ra_lock(svn_ra_session_
 
   for (hi = apr_hash_first(pool, path_revs); hi; hi = apr_hash_next(hi))
     {
-      const char *path = svn__apr_hash_index_key(hi);
+      const char *path = apr_hash_this_key(hi);
 
       SVN_ERR_ASSERT(svn_relpath_is_canonical(path));
     }
@@ -1233,7 +1233,7 @@ svn_error_t *svn_ra_unlock(svn_ra_sessio
 
   for (hi = apr_hash_first(pool, path_tokens); hi; hi = apr_hash_next(hi))
     {
-      const char *path = svn__apr_hash_index_key(hi);
+      const char *path = apr_hash_this_key(hi);
 
       SVN_ERR_ASSERT(svn_relpath_is_canonical(path));
     }

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_ra_local/ra_plugin.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_ra_local/ra_plugin.c Wed Aug  6 04:50:16 2014
@@ -416,8 +416,8 @@ deltify_etc(const svn_commit_info_t *com
       for (hi = apr_hash_first(subpool, deb->lock_tokens); hi;
            hi = apr_hash_next(hi))
         {
-          const void *relpath = svn__apr_hash_index_key(hi);
-          const char *token = svn__apr_hash_index_val(hi);
+          const void *relpath = apr_hash_this_key(hi);
+          const char *token = apr_hash_this_val(hi);
           const char *fspath;
 
           fspath = svn_fspath__join(deb->fspath_base, relpath, subpool);
@@ -475,8 +475,8 @@ apply_lock_tokens(svn_fs_t *fs,
           for (hi = apr_hash_first(scratch_pool, lock_tokens); hi;
                hi = apr_hash_next(hi))
             {
-              const void *relpath = svn__apr_hash_index_key(hi);
-              const char *token = svn__apr_hash_index_val(hi);
+              const void *relpath = apr_hash_this_key(hi);
+              const char *token = apr_hash_this_val(hi);
               const char *fspath;
 
               /* The path needs to live as long as ACCESS_CTX.  */
@@ -1424,9 +1424,8 @@ svn_ra_local__lock(svn_ra_session_t *ses
   for (hi = apr_hash_first(pool, path_revs); hi; hi = apr_hash_next(hi))
     {
       const char *abs_path = svn_fspath__join(sess->fs_path->data,
-                                              svn__apr_hash_index_key(hi),
-                                              pool);
-      svn_revnum_t current_rev = *(svn_revnum_t *)svn__apr_hash_index_val(hi);
+                                              apr_hash_this_key(hi), pool);
+      svn_revnum_t current_rev = *(svn_revnum_t *)apr_hash_this_val(hi);
       svn_fs_lock_target_t *target = svn_fs_lock_target_create(NULL,
                                                                current_rev,
                                                                pool);
@@ -1475,9 +1474,8 @@ svn_ra_local__unlock(svn_ra_session_t *s
   for (hi = apr_hash_first(pool, path_tokens); hi; hi = apr_hash_next(hi))
     {
       const char *abs_path = svn_fspath__join(sess->fs_path->data,
-                                              svn__apr_hash_index_key(hi),
-                                              pool);
-      const char *token = svn__apr_hash_index_val(hi);
+                                              apr_hash_this_key(hi), pool);
+      const char *token = apr_hash_this_val(hi);
 
       svn_hash_sets(targets, abs_path, token);
     }

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/commit.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/commit.c Wed Aug  6 04:50:16 2014
@@ -1057,7 +1057,7 @@ setup_if_header_recursive(svn_boolean_t 
        hi;
        hi = apr_hash_next(hi))
     {
-      const char *relpath = svn__apr_hash_index_key(hi);
+      const char *relpath = apr_hash_this_key(hi);
       apr_uri_t uri;
 
       if (!svn_relpath_skip_ancestor(rq_relpath, relpath))
@@ -1087,7 +1087,7 @@ setup_if_header_recursive(svn_boolean_t 
       svn_stringbuf_appendbyte(sb, '<');
       svn_stringbuf_appendcstr(sb, apr_uri_unparse(iterpool, &uri, 0));
       svn_stringbuf_appendcstr(sb, "> (<");
-      svn_stringbuf_appendcstr(sb, svn__apr_hash_index_val(hi));
+      svn_stringbuf_appendcstr(sb, apr_hash_this_val(hi));
       svn_stringbuf_appendcstr(sb, ">)");
     }
 
@@ -1465,8 +1465,8 @@ open_root(void *edit_baton,
            hi;
            hi = apr_hash_next(hi))
         {
-          const char *name = svn__apr_hash_index_key(hi);
-          svn_string_t *value = svn__apr_hash_index_val(hi);
+          const char *name = apr_hash_this_key(hi);
+          svn_string_t *value = apr_hash_this_val(hi);
           const char *ns;
 
           if (strncmp(name, SVN_PROP_PREFIX, sizeof(SVN_PROP_PREFIX) - 1) == 0)

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/inherited_props.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/inherited_props.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/inherited_props.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/inherited_props.c Wed Aug  6 04:50:16 2014
@@ -240,7 +240,7 @@ keep_only_regular_props(apr_hash_t *prop
 
   for (hi = apr_hash_first(scratch_pool, props); hi; hi = apr_hash_next(hi))
     {
-      const char *propname = svn__apr_hash_index_key(hi);
+      const char *propname = apr_hash_this_key(hi);
 
       if (svn_property_kind2(propname) != svn_prop_regular_kind)
         svn_hash_sets(props, propname, NULL);

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/lock.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/lock.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/lock.c Wed Aug  6 04:50:16 2014
@@ -455,8 +455,8 @@ svn_ra_serf__lock(svn_ra_session_t *ra_s
       lock_ctx = apr_pcalloc(scratch_pool, sizeof(*lock_ctx));
 
       lock_ctx->pool = lock_pool;
-      lock_ctx->path = svn__apr_hash_index_key(hi);
-      lock_ctx->revision = *((svn_revnum_t*)svn__apr_hash_index_val(hi));
+      lock_ctx->path = apr_hash_this_key(hi);
+      lock_ctx->revision = *((svn_revnum_t*)apr_hash_this_val(hi));
       lock_ctx->lock = svn_lock_create(lock_pool);
       lock_ctx->lock->path = lock_ctx->path;
       lock_ctx->lock->comment = comment;
@@ -564,8 +564,8 @@ svn_ra_serf__unlock(svn_ra_session_t *ra
 
           svn_pool_clear(iterpool);
 
-          path = svn__apr_hash_index_key(hi);
-          token = svn__apr_hash_index_val(hi);
+          path = apr_hash_this_key(hi);
+          token = apr_hash_this_val(hi);
 
           if (token && token[0])
             continue;
@@ -625,8 +625,8 @@ svn_ra_serf__unlock(svn_ra_session_t *ra
 
       lock_ctx->pool = lock_pool;
 
-      lock_ctx->path = svn__apr_hash_index_key(hi);
-      token = svn__apr_hash_index_val(hi);
+      lock_ctx->path = apr_hash_this_key(hi);
+      token = apr_hash_this_val(hi);
 
       lock_ctx->force = force;
       lock_ctx->token = apr_pstrcat(lock_pool, "<", token, ">", SVN_VA_NULL);

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=1616095&r1=1616094&r2=1616095&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 Wed Aug  6 04:50:16 2014
@@ -849,7 +849,7 @@ maybe_close_dir(dir_baton_t *dir)
            hi = apr_hash_next(hi))
         {
           SVN_ERR(ctx->editor->change_file_prop(dir->dir_baton,
-                                                svn__apr_hash_index_key(hi),
+                                                apr_hash_this_key(hi),
                                                 NULL /* value */,
                                                 scratch_pool));
         }
@@ -1013,7 +1013,7 @@ close_file(file_baton_t *file,
            hi = apr_hash_next(hi))
         {
           SVN_ERR(ctx->editor->change_file_prop(file->file_baton,
-                                                svn__apr_hash_index_key(hi),
+                                                apr_hash_this_key(hi),
                                                 NULL /* value */,
                                                 scratch_pool));
         }

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/util.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/util.c Wed Aug  6 04:50:16 2014
@@ -28,7 +28,6 @@
 #define APR_WANT_STRFUNC
 #include <apr.h>
 #include <apr_want.h>
-#include <apr_fnmatch.h>
 
 #include <serf.h>
 #include <serf_bucket_types.h>
@@ -45,6 +44,7 @@
 #include "private/svn_dep_compat.h"
 #include "private/svn_fspath.h"
 #include "private/svn_auth_private.h"
+#include "private/svn_cert.h"
 
 #include "ra_serf.h"
 
@@ -231,36 +231,36 @@ ssl_server_cert(void *baton, int failure
       ### This should really be handled by serf, which should pass an error
           for this case, but that has backwards compatibility issues. */
       apr_array_header_t *san;
-      svn_boolean_t found_san_entry = FALSE;
       svn_boolean_t found_matching_hostname = FALSE;
+      svn_string_t *actual_hostname =
+          svn_string_create(conn->session->session_url.hostname, scratch_pool);
 
       serf_cert = serf_ssl_cert_certificate(cert, scratch_pool);
 
       san = svn_hash_gets(serf_cert, "subjectAltName");
-      /* Try to find matching server name via subjectAltName first... */
-      if (san)
+      /* Match server certificate CN with the hostname of the server iff
+       * we didn't find any subjectAltName fields and try to match them.
+       * Per RFC 2818 they are authoritative if present and CommonName
+       * should be ignored.  NOTE: This isn't 100% correct since serf
+       * only loads the subjectAltName hash with dNSNames, technically
+       * we should ignore the CommonName if any subjectAltName entry
+       * exists even if it is one we don't support. */
+      if (san && san->nelts > 0)
         {
           int i;
-          found_san_entry = san->nelts > 0;
           for (i = 0; i < san->nelts; i++)
             {
               const char *s = APR_ARRAY_IDX(san, i, const char*);
-              if (APR_SUCCESS == apr_fnmatch(s,
-                                            conn->session->session_url.hostname,
-                                            APR_FNM_PERIOD |
-                                            APR_FNM_CASE_BLIND))
+              svn_string_t *cert_hostname = svn_string_create(s, scratch_pool);
+
+              if (svn_cert__match_dns_identity(cert_hostname, actual_hostname))
                 {
                   found_matching_hostname = TRUE;
                   break;
                 }
             }
         }
-
-      /* Match server certificate CN with the hostname of the server iff
-       * we didn't find any subjectAltName fields and try to match them.
-       * Per RFC 2818 they are authoritative if present and CommonName
-       * should be ignored. */
-      if (!found_matching_hostname && !found_san_entry)
+      else
         {
           const char *hostname = NULL;
 
@@ -269,11 +269,15 @@ ssl_server_cert(void *baton, int failure
           if (subject)
             hostname = svn_hash_gets(subject, "CN");
 
-          if (hostname
-              && apr_fnmatch(hostname, conn->session->session_url.hostname,
-                             APR_FNM_PERIOD | APR_FNM_CASE_BLIND) == APR_SUCCESS)
+          if (hostname)
             {
-              found_matching_hostname = TRUE;
+              svn_string_t *cert_hostname = svn_string_create(hostname,
+                                                              scratch_pool);
+
+              if (svn_cert__match_dns_identity(cert_hostname, actual_hostname))
+                {
+                  found_matching_hostname = TRUE;
+                }
             }
         }
 

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_ra_svn/client.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_ra_svn/client.c Wed Aug  6 04:50:16 2014
@@ -1235,8 +1235,8 @@ parse_iproplist(apr_array_header_t **inh
            hi;
            hi = apr_hash_next(hi))
         {
-          const char *name = svn__apr_hash_index_key(hi);
-          svn_string_t *value = svn__apr_hash_index_val(hi);
+          const char *name = apr_hash_this_key(hi);
+          svn_string_t *value = apr_hash_this_val(hi);
           svn_hash_sets(new_iprop->prop_hash,
                         apr_pstrdup(result_pool, name),
                         svn_string_dup(value, result_pool));

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_repos/authz_pool.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_repos/authz_pool.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_repos/authz_pool.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_repos/authz_pool.c Wed Aug  6 04:50:16 2014
@@ -34,8 +34,7 @@
 #include "private/svn_subr_private.h"
 #include "private/svn_repos_private.h"
 #include "private/svn_string_private.h"
-
-#include "../libsvn_subr/config_impl.h"
+#include "private/svn_subr_private.h"
 
 #include "repos.h"
 

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_repos/delta.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_repos/delta.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_repos/delta.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_repos/delta.c Wed Aug  6 04:50:16 2014
@@ -875,9 +875,9 @@ delta_dirs(struct context *c,
      from the target tree. */
   for (hi = apr_hash_first(pool, t_entries); hi; hi = apr_hash_next(hi))
     {
-      const void *key = svn__apr_hash_index_key(hi);
-      apr_ssize_t klen = svn__apr_hash_index_klen(hi);
-      const svn_fs_dirent_t *t_entry = svn__apr_hash_index_val(hi);
+      const void *key = apr_hash_this_key(hi);
+      apr_ssize_t klen = apr_hash_this_key_len(hi);
+      const svn_fs_dirent_t *t_entry = apr_hash_this_val(hi);
       const svn_fs_dirent_t *s_entry;
       const char *t_fullpath;
       const char *e_fullpath;
@@ -961,7 +961,7 @@ delta_dirs(struct context *c,
     {
       for (hi = apr_hash_first(pool, s_entries); hi; hi = apr_hash_next(hi))
         {
-          const svn_fs_dirent_t *s_entry = svn__apr_hash_index_val(hi);
+          const svn_fs_dirent_t *s_entry = apr_hash_this_val(hi);
           const char *e_fullpath;
           svn_node_kind_t src_kind;
 

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=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_repos/deprecated.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_repos/deprecated.c Wed Aug  6 04:50:16 2014
@@ -226,6 +226,30 @@ svn_repos_upgrade(const char *path,
   return svn_repos_upgrade2(path, nonblocking, recovery_started, &rb, pool);
 }
 
+svn_error_t *
+svn_repos_hotcopy2(const char *src_path,
+                   const char *dst_path,
+                   svn_boolean_t clean_logs,
+                   svn_boolean_t incremental,
+                   svn_cancel_func_t cancel_func,
+                   void *cancel_baton,
+                   apr_pool_t *pool)
+{
+  return svn_error_trace(svn_repos_hotcopy3(src_path, dst_path, clean_logs,
+                                            incremental, NULL, NULL,
+                                            cancel_func, cancel_baton, pool));
+}
+
+svn_error_t *
+svn_repos_hotcopy(const char *src_path,
+                  const char *dst_path,
+                  svn_boolean_t clean_logs,
+                  apr_pool_t *pool)
+{
+  return svn_error_trace(svn_repos_hotcopy2(src_path, dst_path, clean_logs,
+                                            FALSE, NULL, NULL, pool));
+}
+
 /*** From reporter.c ***/
 svn_error_t *
 svn_repos_begin_report(void **report_baton,

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_repos/fs-wrap.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_repos/fs-wrap.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_repos/fs-wrap.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_repos/fs-wrap.c Wed Aug  6 04:50:16 2014
@@ -74,7 +74,7 @@ svn_repos_fs_commit_txn(const char **con
   iterpool = svn_pool_create(pool);
   for (hi = apr_hash_first(pool, props); hi; hi = apr_hash_next(hi))
     {
-      const char *key = svn__apr_hash_index_key(hi);
+      const char *key = apr_hash_this_key(hi);
 
       svn_pool_clear(iterpool);
 
@@ -94,8 +94,8 @@ svn_repos_fs_commit_txn(const char **con
       iterpool = svn_pool_create(pool);
       for (hi = apr_hash_first(pool, props); hi; hi = apr_hash_next(hi))
         {
-          const char *key = svn__apr_hash_index_key(hi);
-          svn_string_t *val = svn__apr_hash_index_val(hi);
+          const char *key = apr_hash_this_key(hi);
+          svn_string_t *val = apr_hash_this_val(hi);
 
           svn_pool_clear(iterpool);
 
@@ -581,7 +581,7 @@ svn_repos_fs_lock_many(svn_repos_t *repo
     {
       const char *new_token;
       svn_fs_lock_target_t *target;
-      const char *path = svn__apr_hash_index_key(hi);
+      const char *path = apr_hash_this_key(hi);
 
       svn_pool_clear(iterpool);
 
@@ -596,7 +596,7 @@ svn_repos_fs_lock_many(svn_repos_t *repo
           continue;
         }
 
-      target = svn__apr_hash_index_val(hi);
+      target = apr_hash_this_val(hi);
       if (*new_token)
         svn_fs_lock_target_set_token(target, new_token);
       svn_hash_sets(pre_targets, path, target);
@@ -738,8 +738,8 @@ svn_repos_fs_unlock_many(svn_repos_t *re
      svn_fs_unlock_many() from happening for that path. */
   for (hi = apr_hash_first(scratch_pool, targets); hi; hi = apr_hash_next(hi))
     {
-      const char *path = svn__apr_hash_index_key(hi);
-      const char *token = svn__apr_hash_index_val(hi);
+      const char *path = apr_hash_this_key(hi);
+      const char *token = apr_hash_this_val(hi);
 
       svn_pool_clear(iterpool);
 

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_repos/hooks.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_repos/hooks.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_repos/hooks.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_repos/hooks.c Wed Aug  6 04:50:16 2014
@@ -184,8 +184,8 @@ env_from_env_hash(apr_hash_t *env_hash,
   for (hi = apr_hash_first(scratch_pool, env_hash); hi; hi = apr_hash_next(hi))
     {
       *envp = apr_psprintf(result_pool, "%s=%s",
-                           (const char *)svn__apr_hash_index_key(hi),
-                           (const char *)svn__apr_hash_index_val(hi));
+                           (const char *)apr_hash_this_key(hi),
+                           (const char *)apr_hash_this_val(hi));
       envp++;
     }
   *envp = NULL;
@@ -519,8 +519,8 @@ lock_token_content(apr_file_t **handle, 
   for (hi = apr_hash_first(pool, lock_tokens); hi;
        hi = apr_hash_next(hi))
     {
-      const char *token = svn__apr_hash_index_key(hi);
-      const char *path = svn__apr_hash_index_val(hi);
+      const char *token = apr_hash_this_key(hi);
+      const char *path = apr_hash_this_val(hi);
 
       svn_stringbuf_appendstr(lock_str,
         svn_stringbuf_createf(pool, "%s|%s\n",

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=1616095&r1=1616094&r2=1616095&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 Wed Aug  6 04:50:16 2014
@@ -209,8 +209,8 @@ prefix_mergeinfo_paths(svn_string_t **me
   prefixed_mergeinfo = apr_hash_make(pool);
   for (hi = apr_hash_first(pool, mergeinfo); hi; hi = apr_hash_next(hi))
     {
-      const char *merge_source = svn__apr_hash_index_key(hi);
-      svn_rangelist_t *rangelist = svn__apr_hash_index_val(hi);
+      const char *merge_source = apr_hash_this_key(hi);
+      svn_rangelist_t *rangelist = apr_hash_this_val(hi);
       const char *path;
 
       merge_source = svn_relpath_canonicalize(merge_source, pool);
@@ -269,8 +269,8 @@ renumber_mergeinfo_revs(svn_string_t **f
 
   for (hi = apr_hash_first(subpool, mergeinfo); hi; hi = apr_hash_next(hi))
     {
-      const char *merge_source = svn__apr_hash_index_key(hi);
-      svn_rangelist_t *rangelist = svn__apr_hash_index_val(hi);
+      const char *merge_source = apr_hash_this_key(hi);
+      svn_rangelist_t *rangelist = apr_hash_this_val(hi);
       struct parse_baton *pb = rb->pb;
       int i;
 
@@ -831,7 +831,7 @@ remove_node_props(void *baton)
 
   for (hi = apr_hash_first(nb->pool, proplist); hi; hi = apr_hash_next(hi))
     {
-      const char *key = svn__apr_hash_index_key(hi);
+      const char *key = apr_hash_this_key(hi);
 
       SVN_ERR(change_node_prop(rb->txn_root, nb->path, key, NULL,
                                rb->pb->validate_props, nb->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=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_repos/log.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_repos/log.c Wed Aug  6 04:50:16 2014
@@ -82,8 +82,8 @@ svn_repos_check_revision_access(svn_repo
   subpool = svn_pool_create(pool);
   for (hi = apr_hash_first(pool, changes); hi; hi = apr_hash_next(hi))
     {
-      const char *key = svn__apr_hash_index_key(hi);
-      svn_fs_path_change2_t *change = svn__apr_hash_index_val(hi);
+      const char *key = apr_hash_this_key(hi);
+      svn_fs_path_change2_t *change = apr_hash_this_val(hi);
       svn_boolean_t readable;
 
       svn_pool_clear(subpool);
@@ -199,7 +199,13 @@ detect_changed(apr_hash_t **changed,
   if (changes == NULL)
     {
       SVN_ERR(svn_fs_paths_changed2(&changes, root, pool));
-      *changed = changes;
+
+      /* If we are going to filter the results, we won't use the exact
+       * same keys but put them into a new hash. */
+      if (authz_read_func)
+        *changed = svn_hash__make(pool);
+      else
+        *changed = changes;
     }
   else
     {
@@ -217,9 +223,9 @@ detect_changed(apr_hash_t **changed,
       /* NOTE:  Much of this loop is going to look quite similar to
          svn_repos_check_revision_access(), but we have to do more things
          here, so we'll live with the duplication. */
-      const char *path = svn__apr_hash_index_key(hi);
-      apr_ssize_t path_len = svn__apr_hash_index_klen(hi);
-      svn_fs_path_change2_t *change = svn__apr_hash_index_val(hi);
+      const char *path = apr_hash_this_key(hi);
+      apr_ssize_t path_len = apr_hash_this_key_len(hi);
+      svn_fs_path_change2_t *change = apr_hash_this_val(hi);
       char action;
       svn_log_changed_path2_t *item;
 
@@ -614,7 +620,7 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
        hi;
        hi = apr_hash_next(hi))
     {
-      svn_fs_path_change2_t *change = svn__apr_hash_index_val(hi);
+      svn_fs_path_change2_t *change = apr_hash_this_val(hi);
 
       /* If there was a prop change and we are not positive that _no_
          mergeinfo change happened, we must assume that it might have. */
@@ -646,7 +652,7 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
        hi = apr_hash_next(hi))
     {
       const char *changed_path;
-      svn_fs_path_change2_t *change = svn__apr_hash_index_val(hi);
+      svn_fs_path_change2_t *change = apr_hash_this_val(hi);
       const char *base_path = NULL;
       svn_revnum_t base_rev = SVN_INVALID_REVNUM;
       svn_fs_root_t *base_root = NULL;
@@ -663,7 +669,7 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
         continue;
 
       /* Begin actual processing */
-      changed_path = svn__apr_hash_index_key(hi);
+      changed_path = apr_hash_this_key(hi);
       svn_pool_clear(iterpool);
 
       switch (change->change_kind)
@@ -1022,9 +1028,9 @@ get_combined_mergeinfo_changes(svn_merge
   for (hi = apr_hash_first(scratch_pool, added_mergeinfo_catalog);
        hi; hi = apr_hash_next(hi))
     {
-      const char *changed_path = svn__apr_hash_index_key(hi);
-      apr_ssize_t klen = svn__apr_hash_index_klen(hi);
-      svn_mergeinfo_t added = svn__apr_hash_index_val(hi);
+      const char *changed_path = apr_hash_this_key(hi);
+      apr_ssize_t klen = apr_hash_this_key_len(hi);
+      svn_mergeinfo_t added = apr_hash_this_val(hi);
       svn_mergeinfo_t deleted;
 
       for (i = 0; i < paths->nelts; i++)
@@ -1252,7 +1258,7 @@ send_log(svn_revnum_t rev,
            hi = apr_hash_next(hi))
         {
           svn_boolean_t path_is_in_history = FALSE;
-          const char *changed_path = svn__apr_hash_index_key(hi);
+          const char *changed_path = apr_hash_this_key(hi);
           apr_hash_index_t *hi2;
 
           /* Look at each path on the log target's mergeinfo. */
@@ -1261,8 +1267,8 @@ send_log(svn_revnum_t rev,
                hi2;
                hi2 = apr_hash_next(hi2))
             {
-              const char *mergeinfo_path = svn__apr_hash_index_key(hi2);
-              svn_rangelist_t *rangelist = svn__apr_hash_index_val(hi2);
+              const char *mergeinfo_path = apr_hash_this_key(hi2);
+              svn_rangelist_t *rangelist = apr_hash_this_val(hi2);
 
               /* Check whether CHANGED_PATH at revision REV is a child of
                  a (path, revision) tuple in LOG_TARGET_HISTORY_AS_MERGEINFO. */
@@ -1535,8 +1541,8 @@ combine_mergeinfo_path_lists(apr_array_h
       int i;
       struct rangelist_path *rp = apr_palloc(subpool, sizeof(*rp));
 
-      rp->path = svn__apr_hash_index_key(hi);
-      rp->rangelist = svn__apr_hash_index_val(hi);
+      rp->path = apr_hash_this_key(hi);
+      rp->rangelist = apr_hash_this_val(hi);
       APR_ARRAY_PUSH(rangelist_paths, struct rangelist_path *) = rp;
 
       /* We need to make local copies of the rangelist, since we will be

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_repos/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_repos/replay.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_repos/replay.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_repos/replay.c Wed Aug  6 04:50:16 2014
@@ -184,8 +184,8 @@ add_subdir(svn_fs_root_t *source_root,
 
   for (phi = apr_hash_first(pool, props); phi; phi = apr_hash_next(phi))
     {
-      const char *key = svn__apr_hash_index_key(phi);
-      svn_string_t *val = svn__apr_hash_index_val(phi);
+      const char *key = apr_hash_this_key(phi);
+      svn_string_t *val = apr_hash_this_val(phi);
 
       svn_pool_clear(subpool);
       SVN_ERR(editor->change_dir_prop(*dir_baton, key, val, subpool));
@@ -200,7 +200,7 @@ add_subdir(svn_fs_root_t *source_root,
     {
       svn_fs_path_change2_t *change;
       svn_boolean_t readable = TRUE;
-      svn_fs_dirent_t *dent = svn__apr_hash_index_val(hi);
+      svn_fs_dirent_t *dent = apr_hash_this_val(hi);
       const char *copyfrom_path = NULL;
       svn_revnum_t copyfrom_rev = SVN_INVALID_REVNUM;
       const char *new_edit_path;
@@ -303,8 +303,8 @@ add_subdir(svn_fs_root_t *source_root,
 
           for (phi = apr_hash_first(pool, props); phi; phi = apr_hash_next(phi))
             {
-              const char *key = svn__apr_hash_index_key(phi);
-              svn_string_t *val = svn__apr_hash_index_val(phi);
+              const char *key = apr_hash_this_key(phi);
+              svn_string_t *val = apr_hash_this_val(phi);
 
               SVN_ERR(editor->change_file_prop(file_baton, key, val, subpool));
             }
@@ -877,9 +877,9 @@ svn_repos_replay2(svn_fs_root_t *root,
   changed_paths = apr_hash_make(pool);
   for (hi = apr_hash_first(pool, fs_changes); hi; hi = apr_hash_next(hi))
     {
-      const char *path = svn__apr_hash_index_key(hi);
-      apr_ssize_t keylen = svn__apr_hash_index_klen(hi);
-      svn_fs_path_change2_t *change = svn__apr_hash_index_val(hi);
+      const char *path = apr_hash_this_key(hi);
+      apr_ssize_t keylen = apr_hash_this_key_len(hi);
+      svn_fs_path_change2_t *change = apr_hash_this_val(hi);
       svn_boolean_t allowed = TRUE;
 
       if (authz_read_func)
@@ -1052,7 +1052,7 @@ add_subdir_ev2(svn_fs_root_t *source_roo
     {
       svn_fs_path_change2_t *change;
       svn_boolean_t readable = TRUE;
-      svn_fs_dirent_t *dent = svn__apr_hash_index_val(hi);
+      svn_fs_dirent_t *dent = apr_hash_this_val(hi);
       const char *copyfrom_path = NULL;
       svn_revnum_t copyfrom_rev = SVN_INVALID_REVNUM;
       const char *child_relpath;
@@ -1503,9 +1503,9 @@ svn_repos__replay_ev2(svn_fs_root_t *roo
   for (hi = apr_hash_first(scratch_pool, fs_changes); hi;
         hi = apr_hash_next(hi))
     {
-      const char *path = svn__apr_hash_index_key(hi);
-      apr_ssize_t keylen = svn__apr_hash_index_klen(hi);
-      svn_fs_path_change2_t *change = svn__apr_hash_index_val(hi);
+      const char *path = apr_hash_this_key(hi);
+      apr_ssize_t keylen = apr_hash_this_key_len(hi);
+      svn_fs_path_change2_t *change = apr_hash_this_val(hi);
       svn_boolean_t allowed = TRUE;
 
       if (authz_read_func)

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_repos/reporter.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_repos/reporter.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_repos/reporter.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_repos/reporter.c Wed Aug  6 04:50:16 2014
@@ -603,8 +603,8 @@ delta_proplists(report_baton_t *b, svn_r
       /* So source, i.e. all new.  Transmit all target props. */
       for (hi = apr_hash_first(pool, t_props); hi; hi = apr_hash_next(hi))
         {
-          const char *key = svn__apr_hash_index_key(hi);
-          svn_string_t *val = svn__apr_hash_index_val(hi);
+          const char *key = apr_hash_this_key(hi);
+          svn_string_t *val = apr_hash_this_val(hi);
 
           SVN_ERR(change_fn(b, object, key, val, pool));
         }
@@ -1246,7 +1246,7 @@ delta_dirs(report_baton_t *b, svn_revnum
                hi;
                hi = apr_hash_next(hi))
             {
-              const svn_fs_dirent_t *s_entry = svn__apr_hash_index_val(hi);
+              const svn_fs_dirent_t *s_entry = apr_hash_this_val(hi);
 
               svn_pool_clear(iterpool);
 

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_repos/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_repos/repos.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_repos/repos.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_repos/repos.c Wed Aug  6 04:50:16 2014
@@ -2247,30 +2247,6 @@ svn_repos_hotcopy3(const char *src_path,
            dst_repos->format, pool);
 }
 
-svn_error_t *
-svn_repos_hotcopy2(const char *src_path,
-                   const char *dst_path,
-                   svn_boolean_t clean_logs,
-                   svn_boolean_t incremental,
-                   svn_cancel_func_t cancel_func,
-                   void *cancel_baton,
-                   apr_pool_t *pool)
-{
-  return svn_error_trace(svn_repos_hotcopy3(src_path, dst_path, clean_logs,
-                                            incremental, NULL, NULL,
-                                            cancel_func, cancel_baton, pool));
-}
-
-svn_error_t *
-svn_repos_hotcopy(const char *src_path,
-                  const char *dst_path,
-                  svn_boolean_t clean_logs,
-                  apr_pool_t *pool)
-{
-  return svn_error_trace(svn_repos_hotcopy2(src_path, dst_path, clean_logs,
-                                            FALSE, NULL, NULL, pool));
-}
-
 /* Return the library version number. */
 const svn_version_t *
 svn_repos_version(void)

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_repos/rev_hunt.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_repos/rev_hunt.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_repos/rev_hunt.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_repos/rev_hunt.c Wed Aug  6 04:50:16 2014
@@ -1253,8 +1253,8 @@ find_merged_revisions(apr_array_header_t
           for (hi = apr_hash_first(iterpool, old_pr->merged_mergeinfo); hi;
                hi = apr_hash_next(hi))
             {
-              const char *path = svn__apr_hash_index_key(hi);
-              svn_rangelist_t *rangelist = svn__apr_hash_index_val(hi);
+              const char *path = apr_hash_this_key(hi);
+              svn_rangelist_t *rangelist = apr_hash_this_val(hi);
               apr_pool_t *iterpool3;
               int j;
 

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_subr/config_auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_subr/config_auth.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_subr/config_auth.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_subr/config_auth.c Wed Aug  6 04:50:16 2014
@@ -208,7 +208,7 @@ svn_config_walk_auth_data(const char *co
       itempool = svn_pool_create(iterpool);
       for (hi = apr_hash_first(iterpool, nodes); hi; hi = apr_hash_next(hi))
         {
-          svn_io_dirent2_t *dirent = svn__apr_hash_index_val(hi);
+          svn_io_dirent2_t *dirent = apr_hash_this_val(hi);
           svn_stream_t *stream;
           apr_hash_t *creds_hash;
           const svn_string_t *realm;
@@ -222,7 +222,7 @@ svn_config_walk_auth_data(const char *co
 
           svn_pool_clear(itempool);
 
-          item_path = svn_dirent_join(dir_path, svn__apr_hash_index_key(hi),
+          item_path = svn_dirent_join(dir_path, apr_hash_this_key(hi),
                                       itempool);
 
           err = svn_stream_open_readonly(&stream, item_path,

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_subr/debug.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_subr/debug.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_subr/debug.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_subr/debug.c Wed Aug  6 04:50:16 2014
@@ -145,8 +145,8 @@ svn_dbg__print_props(apr_hash_t *props,
   for (hi = apr_hash_first(apr_hash_pool_get(props), props); hi;
         hi = apr_hash_next(hi))
     {
-      const char *name = svn__apr_hash_index_key(hi);
-      svn_string_t *val = svn__apr_hash_index_val(hi);
+      const char *name = apr_hash_this_key(hi);
+      svn_string_t *val = apr_hash_this_val(hi);
 
       svn_dbg__printf("    '%s' -> '%s'\n", name, val->data);
     }

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_subr/dirent_uri.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_subr/dirent_uri.c Wed Aug  6 04:50:16 2014
@@ -38,6 +38,7 @@
 
 #include "dirent_uri.h"
 #include "private/svn_fspath.h"
+#include "private/svn_cert.h"
 
 /* The canonical empty path.  Can this be changed?  Well, change the empty
    test below and the path library will work, not so sure about the fs/wc
@@ -2625,3 +2626,81 @@ svn_urlpath__canonicalize(const char *ur
     }
   return uri;
 }
+
+
+/* -------------- The cert API (see private/svn_cert.h) ------------- */
+
+svn_boolean_t
+svn_cert__match_dns_identity(svn_string_t *pattern, svn_string_t *hostname)
+{
+  apr_size_t pattern_pos = 0, hostname_pos = 0;
+
+  /* support leading wildcards that composed of the only character in the
+   * left-most label. */
+  if (pattern->len >= 2 &&
+      pattern->data[pattern_pos] == '*' &&
+      pattern->data[pattern_pos + 1] == '.')
+    {
+      while (hostname_pos < hostname->len &&
+             hostname->data[hostname_pos] != '.')
+        {
+          hostname_pos++;
+        }
+      /* Assume that the wildcard must match something.  Rule 2 says
+       * that *.example.com should not match example.com.  If the wildcard
+       * ends up not matching anything then it matches .example.com which
+       * seems to be essentially the same as just example.com */
+      if (hostname_pos == 0)
+        return FALSE;
+
+      pattern_pos++;
+    }
+
+  while (pattern_pos < pattern->len && hostname_pos < hostname->len)
+    {
+      char pattern_c = pattern->data[pattern_pos];
+      char hostname_c = hostname->data[hostname_pos];
+
+      /* fold case as described in RFC 4343.
+       * Note: We actually convert to lowercase, since our URI
+       * canonicalization code converts to lowercase and generally
+       * most certs are issued with lowercase DNS names, meaning
+       * this avoids the fold operation in most cases.  The RFC
+       * suggests the opposite transformation, but doesn't require
+       * any specific implementation in any case.  It is critical
+       * that this folding be locale independent so you can't use
+       * tolower(). */
+      pattern_c = canonicalize_to_lower(pattern_c);
+      hostname_c = canonicalize_to_lower(hostname_c);
+
+      if (pattern_c != hostname_c)
+        {
+          /* doesn't match */
+          return FALSE;
+        }
+      else
+        {
+          /* characters match so skip both */
+          pattern_pos++;
+          hostname_pos++;
+        }
+    }
+
+  /* ignore a trailing period on the hostname since this has no effect on the
+   * security of the matching.  See the following for the long explanation as
+   * to why:
+   * https://bugzilla.mozilla.org/show_bug.cgi?id=134402#c28
+   */
+  if (pattern_pos == pattern->len &&
+      hostname_pos == hostname->len - 1 &&
+      hostname->data[hostname_pos] == '.')
+    hostname_pos++;
+
+  if (pattern_pos != pattern->len || hostname_pos != hostname->len)
+    {
+      /* end didn't match */
+      return FALSE;
+    }
+
+  return TRUE;
+}

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_subr/hash.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_subr/hash.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_subr/hash.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_subr/hash.c Wed Aug  6 04:50:16 2014
@@ -535,7 +535,7 @@ svn_hash_keys(apr_array_header_t **array
 
   for (hi = apr_hash_first(pool, hash); hi; hi = apr_hash_next(hi))
     {
-      APR_ARRAY_PUSH(*array, const char *) = svn__apr_hash_index_key(hi);
+      APR_ARRAY_PUSH(*array, const char *) = apr_hash_this_key(hi);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_subr/io.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_subr/io.c Wed Aug  6 04:50:16 2014
@@ -2558,8 +2558,8 @@ svn_io_remove_dir2(const char *path, svn
 
   for (hi = apr_hash_first(subpool, dirents); hi; hi = apr_hash_next(hi))
     {
-      const char *name = svn__apr_hash_index_key(hi);
-      const svn_io_dirent2_t *dirent = svn__apr_hash_index_val(hi);
+      const char *name = apr_hash_this_key(hi);
+      const svn_io_dirent2_t *dirent = apr_hash_this_val(hi);
       const char *fullpath;
 
       fullpath = svn_dirent_join(path, name, subpool);

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_subr/iter.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_subr/iter.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_subr/iter.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_subr/iter.c Wed Aug  6 04:50:16 2014
@@ -184,45 +184,28 @@ svn_iter__break(void)
   return &internal_break_error;
 }
 
-/* Note about the type casts:  apr_hash_this() does not expect a const hash
- * index pointer even though it does not modify the hash index.  In
- * Subversion we're trying to be const-correct, so these functions all take
- * a const hash index and we cast away the const when passing it down to
- * APR.  (A compiler may warn about casting away 'const', but at least this
- * cast is explicit and gathered in one place.) */
-
-const void *svn__apr_hash_index_key(const apr_hash_index_t *hi)
+#if !APR_VERSION_AT_LEAST(1, 5, 0)
+const void *apr_hash_this_key(apr_hash_index_t *hi)
 {
-#if APR_VERSION_AT_LEAST(1, 5, 0)
-  return apr_hash_this_key((apr_hash_index_t *)hi);
-#else
   const void *key;
 
   apr_hash_this((apr_hash_index_t *)hi, &key, NULL, NULL);
   return key;
-#endif
 }
 
-apr_ssize_t svn__apr_hash_index_klen(const apr_hash_index_t *hi)
+apr_ssize_t apr_hash_this_key_len(apr_hash_index_t *hi)
 {
-#if APR_VERSION_AT_LEAST(1, 5, 0)
-  return apr_hash_this_key_len((apr_hash_index_t *)hi);
-#else
   apr_ssize_t klen;
 
   apr_hash_this((apr_hash_index_t *)hi, NULL, &klen, NULL);
   return klen;
-#endif
 }
 
-void *svn__apr_hash_index_val(const apr_hash_index_t *hi)
+void *apr_hash_this_val(apr_hash_index_t *hi)
 {
-#if APR_VERSION_AT_LEAST(1, 5, 0)
-  return apr_hash_this_val((apr_hash_index_t *)hi);
-#else
   void *val;
 
   apr_hash_this((apr_hash_index_t *)hi, NULL, NULL, &val);
   return val;
-#endif
 }
+#endif

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_subr/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_subr/log.c?rev=1616095&r1=1616094&r2=1616095&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_subr/log.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_subr/log.c Wed Aug  6 04:50:16 2014
@@ -316,7 +316,7 @@ svn_log__lock(apr_hash_t *targets,
 
   for (hi = apr_hash_first(pool, targets); hi; hi = apr_hash_next(hi))
     {
-      const char *path = svn__apr_hash_index_key(hi);
+      const char *path = apr_hash_this_key(hi);
       svn_pool_clear(iterpool);
       if (space_separated_paths->len)
         svn_stringbuf_appendcstr(space_separated_paths, " ");
@@ -339,7 +339,7 @@ svn_log__unlock(apr_hash_t *targets,
 
   for (hi = apr_hash_first(pool, targets); hi; hi = apr_hash_next(hi))
     {
-      const char *path = svn__apr_hash_index_key(hi);
+      const char *path = apr_hash_this_key(hi);
       svn_pool_clear(iterpool);
       if (space_separated_paths->len)
         svn_stringbuf_appendcstr(space_separated_paths, " ");