You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/05/16 21:48:47 UTC

svn commit: r1483532 - in /subversion/trunk/subversion: include/ libsvn_client/ libsvn_fs_base/ libsvn_fs_fs/ libsvn_ra/ libsvn_ra_local/ libsvn_ra_svn/ libsvn_repos/ libsvn_subr/ libsvn_wc/ mod_dav_svn/ svndumpfilter/ svnmucc/ svnrdump/ svnserve/ svns...

Author: stefan2
Date: Thu May 16 19:48:47 2013
New Revision: 1483532

URL: http://svn.apache.org/r1483532
Log:
We frequently use property name constants in conjunction with hash containers.
Provide new wrappers around apr_hash_get and apr_hash_set that accept such
string constants and statically determine their size.  That minimizes the
hash access costs.

Mass change hash get and set calls for SVN_PROP_* constants.

* subversion/include/svn_hash.h
  (svn_hash_gets,
   svn_hash_sets): Doxygen-ize the docstring
  (svn_hash_gets_fixed_key,
   svn_hash_sets_fixed_key): define new apr_hash_* wrapper

* subversion/libsvn_client/add.c
  (svn_client__get_all_auto_props): use faster hash wrappers with SVN_PROP_*

* subversion/libsvn_client/commit_util.c
  (svn_client__ensure_revprop_table): ditto

* subversion/libsvn_client/copy.c
  (repos_to_wc_copy_single): ditto

* subversion/libsvn_client/list.c
  (svn_client__ra_stat_compatible): ditto

* subversion/libsvn_client/log.c
  (pre_15_receiver): ditto

* subversion/libsvn_client/merge.c
  (prepare_merge_props_changed, merge_file_added, merge_dir_added,
   merge_dir_deleted): ditto

* subversion/libsvn_client/mergeinfo.c
  (svn_client__get_wc_or_repos_mergeinfo_catalog): ditto

* subversion/libsvn_fs_base/tree.c
  (txn_body_get_mergeinfo_data_and_entries,
   txn_body_get_mergeinfo_for_path): same

* subversion/libsvn_fs_fs/fs_fs.c
  (write_revision_zero): same

* subversion/libsvn_fs_fs/tree.c
  (crawl_directory_dag_for_mergeinfo, get_mergeinfo_for_path_internal): same

* subversion/libsvn_ra/deprecated.c
  (svn_ra_get_commit_editor2): same

* subversion/libsvn_ra_local/ra_plugin.c
  (svn_ra_local__get_commit_editor, svn_ra_local__get_commit_ev2): same

* subversion/libsvn_ra_svn/client.c
  (ra_svn_commit, ra_svn_log): same

* subversion/libsvn_repos/commit.c
  (svn_repos__get_commit_ev2): same

* subversion/libsvn_repos/delta.c
  (delta_proplists): same

* subversion/libsvn_repos/deprecated.c
  (svn_repos_get_commit_editor4): same

* subversion/libsvn_repos/dump.c
  (dump_node, write_revision_record): 

* subversion/libsvn_repos/fs-wrap.c
  (svn_repos_fs_begin_txn_for_commit2, svn_repos_fs_begin_txn_for_commit,
   svn_repos_fs_revision_proplist): same

* subversion/libsvn_repos/log.c
  (fill_log_entry): same

* subversion/libsvn_repos/reporter.c
  (get_revision_info): same

* subversion/libsvn_repos/rev_hunt.c
  (svn_repos_get_committed_info): same

* subversion/libsvn_subr/compat.c
  (svn_compat_log_revprops_clear, svn_compat_log_revprops_out): same

* subversion/libsvn_wc/status.c
  (collect_ignore_patterns): same

* subversion/mod_dav_svn/activity.c
  (dav_svn__create_txn): same

* subversion/mod_dav_svn/lock.c
  (append_locks): same

* subversion/svndumpfilter/svndumpfilter.c
  (output_revision): same

* subversion/svnmucc/svnmucc.c
  (execute, sanitize_log_sources): same

* subversion/svnrdump/load_editor.c
  (new_node_record): same

* subversion/svnserve/serve.c
  (commit): same

* subversion/svnsync/svnsync.c
  (replay_rev_started): same

Modified:
    subversion/trunk/subversion/include/svn_hash.h
    subversion/trunk/subversion/libsvn_client/add.c
    subversion/trunk/subversion/libsvn_client/commit_util.c
    subversion/trunk/subversion/libsvn_client/copy.c
    subversion/trunk/subversion/libsvn_client/list.c
    subversion/trunk/subversion/libsvn_client/log.c
    subversion/trunk/subversion/libsvn_client/merge.c
    subversion/trunk/subversion/libsvn_client/mergeinfo.c
    subversion/trunk/subversion/libsvn_fs_base/tree.c
    subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
    subversion/trunk/subversion/libsvn_fs_fs/tree.c
    subversion/trunk/subversion/libsvn_ra/deprecated.c
    subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c
    subversion/trunk/subversion/libsvn_ra_svn/client.c
    subversion/trunk/subversion/libsvn_repos/commit.c
    subversion/trunk/subversion/libsvn_repos/delta.c
    subversion/trunk/subversion/libsvn_repos/deprecated.c
    subversion/trunk/subversion/libsvn_repos/dump.c
    subversion/trunk/subversion/libsvn_repos/fs-wrap.c
    subversion/trunk/subversion/libsvn_repos/log.c
    subversion/trunk/subversion/libsvn_repos/reporter.c
    subversion/trunk/subversion/libsvn_repos/rev_hunt.c
    subversion/trunk/subversion/libsvn_subr/compat.c
    subversion/trunk/subversion/libsvn_wc/status.c
    subversion/trunk/subversion/mod_dav_svn/activity.c
    subversion/trunk/subversion/mod_dav_svn/lock.c
    subversion/trunk/subversion/svndumpfilter/svndumpfilter.c
    subversion/trunk/subversion/svnmucc/svnmucc.c
    subversion/trunk/subversion/svnrdump/load_editor.c
    subversion/trunk/subversion/svnserve/serve.c
    subversion/trunk/subversion/svnsync/svnsync.c

Modified: subversion/trunk/subversion/include/svn_hash.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_hash.h?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_hash.h (original)
+++ subversion/trunk/subversion/include/svn_hash.h Thu May 16 19:48:47 2013
@@ -240,20 +240,36 @@ svn_hash_from_cstring_keys(apr_hash_t **
                            const apr_array_header_t *keys,
                            apr_pool_t *pool);
 
-/* Shortcut for apr_hash_get() with a const char * key.
+/** Shortcut for apr_hash_get() with a const char * key.
  *
  * @since New in 1.8.
  */
 #define svn_hash_gets(ht, key) \
             apr_hash_get(ht, key, APR_HASH_KEY_STRING)
 
-/* Shortcut for apr_hash_set() with a const char * key.
+/** Shortcut for apr_hash_set() with a const char * key.
  *
  * @since New in 1.8.
  */
 #define svn_hash_sets(ht, key, val) \
             apr_hash_set(ht, key, APR_HASH_KEY_STRING, val)
 
+/** Shortcut for apr_hash_get() with a fixed-size char[] key.
+ * @note Do NOT use this with pointer types like const char*.
+ *
+ * @since New in 1.9.
+ */
+#define svn_hash_gets_fixed_key(ht, key) \
+            apr_hash_get(ht, key, sizeof(key)-1)
+
+/** Shortcut for apr_hash_get() with a fixed-size char[] key.
+ * @note Do NOT use this with pointer types like const char*.
+ *
+ * @since New in 1.9.
+ */
+#define svn_hash_sets_fixed_key(ht, key, val) \
+            apr_hash_set(ht, key, sizeof(key)-1, val)
+
 /** @} */
 
 /** @} */

Modified: subversion/trunk/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/add.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/add.c (original)
+++ subversion/trunk/subversion/libsvn_client/add.c Thu May 16 19:48:47 2013
@@ -696,8 +696,9 @@ svn_client__get_all_auto_props(apr_hash_
         apr_palloc(scratch_pool, sizeof(*new_iprop));
       new_iprop->path_or_url = path_or_url;
       new_iprop->prop_hash = apr_hash_make(scratch_pool);
-      svn_hash_sets(new_iprop->prop_hash, SVN_PROP_INHERITABLE_AUTO_PROPS,
-                    config_auto_prop);
+      svn_hash_sets_fixed_key(new_iprop->prop_hash,
+                              SVN_PROP_INHERITABLE_AUTO_PROPS,
+                              config_auto_prop);
       APR_ARRAY_PUSH(inherited_config_auto_props,
                      svn_prop_inherited_item_t *) = new_iprop;
     }
@@ -796,8 +797,8 @@ svn_error_t *svn_client__get_inherited_i
         apr_palloc(scratch_pool, sizeof(*new_iprop));
       new_iprop->path_or_url = path_or_url;
       new_iprop->prop_hash = apr_hash_make(scratch_pool);
-      svn_hash_sets(new_iprop->prop_hash, SVN_PROP_INHERITABLE_IGNORES,
-                    explicit_prop);
+      svn_hash_sets_fixed_key(new_iprop->prop_hash,
+                              SVN_PROP_INHERITABLE_IGNORES, explicit_prop);
       APR_ARRAY_PUSH(inherited_ignores,
                      svn_prop_inherited_item_t *) = new_iprop;
     }
@@ -808,8 +809,8 @@ svn_error_t *svn_client__get_inherited_i
     {
       svn_prop_inherited_item_t *elt = APR_ARRAY_IDX(
         inherited_ignores, i, svn_prop_inherited_item_t *);
-      svn_string_t *ignore_val = svn_hash_gets(elt->prop_hash,
-                                               SVN_PROP_INHERITABLE_IGNORES);
+      svn_string_t *ignore_val =
+        svn_hash_gets_fixed_key(elt->prop_hash, SVN_PROP_INHERITABLE_IGNORES);
       if (ignore_val)
         svn_cstring_split_append(*ignores, ignore_val->data, "\n\r\t\v ",
                                  FALSE, result_pool);

Modified: subversion/trunk/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit_util.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit_util.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit_util.c Thu May 16 19:48:47 2013
@@ -1974,8 +1974,8 @@ svn_client__ensure_revprop_table(apr_has
     {
       new_revprop_table = apr_hash_make(pool);
     }
-  svn_hash_sets(new_revprop_table, SVN_PROP_REVISION_LOG,
-                svn_string_create(log_msg, pool));
+  svn_hash_sets_fixed_key(new_revprop_table, SVN_PROP_REVISION_LOG,
+                          svn_string_create(log_msg, pool));
   *revprop_table_out = new_revprop_table;
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/copy.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/copy.c (original)
+++ subversion/trunk/subversion/libsvn_client/copy.c Thu May 16 19:48:47 2013
@@ -1675,7 +1675,7 @@ repos_to_wc_copy_single(svn_boolean_t *t
                               &pair->src_revnum, &new_props, pool));
 
       if (new_props && ! same_repositories)
-        svn_hash_sets(new_props, SVN_PROP_MERGEINFO, NULL);
+        svn_hash_sets_fixed_key(new_props, SVN_PROP_MERGEINFO, NULL);
 
       *timestamp_sleep = TRUE;
 

Modified: subversion/trunk/subversion/libsvn_client/list.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/list.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/list.c (original)
+++ subversion/trunk/subversion/libsvn_client/list.c Thu May 16 19:48:47 2013
@@ -273,14 +273,15 @@ svn_client__ra_stat_compatible(svn_ra_se
 
                   SVN_ERR(svn_ra_rev_proplist(ra_session, rev, &props,
                                               pool));
-                  val = svn_hash_gets(props, SVN_PROP_REVISION_DATE);
+                  val = svn_hash_gets_fixed_key(props, SVN_PROP_REVISION_DATE);
                   if (val)
                     SVN_ERR(svn_time_from_cstring(&dirent->time, val->data,
                                                   pool));
                   else
                     dirent->time = 0;
 
-                  val = svn_hash_gets(props, SVN_PROP_REVISION_AUTHOR);
+                  val = svn_hash_gets_fixed_key(props,
+                                                SVN_PROP_REVISION_AUTHOR);
                   dirent->last_author = val ? val->data : NULL;
                 }
 

Modified: subversion/trunk/subversion/libsvn_client/log.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/log.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/log.c (original)
+++ subversion/trunk/subversion/libsvn_client/log.c Thu May 16 19:48:47 2013
@@ -221,11 +221,14 @@ pre_15_receiver(void *baton, svn_log_ent
           /* Pre-1.5 servers send the standard revprops unconditionally;
              clear those the caller doesn't want. */
           if (!want_author)
-            svn_hash_sets(log_entry->revprops, SVN_PROP_REVISION_AUTHOR, NULL);
+            svn_hash_sets_fixed_key(log_entry->revprops,
+                                    SVN_PROP_REVISION_AUTHOR, NULL);
           if (!want_date)
-            svn_hash_sets(log_entry->revprops, SVN_PROP_REVISION_DATE, NULL);
+            svn_hash_sets_fixed_key(log_entry->revprops,
+                                    SVN_PROP_REVISION_DATE, NULL);
           if (!want_log)
-            svn_hash_sets(log_entry->revprops, SVN_PROP_REVISION_LOG, NULL);
+            svn_hash_sets_fixed_key(log_entry->revprops,
+                                    SVN_PROP_REVISION_LOG, NULL);
         }
     }
   else

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Thu May 16 19:48:47 2013
@@ -1104,7 +1104,8 @@ prepare_merge_props_changed(const apr_ar
                                                 scratch_pool));
 
               if (pristine_props
-                  && svn_hash_gets(pristine_props, SVN_PROP_MERGEINFO))
+                  && svn_hash_gets_fixed_key(pristine_props,
+                                             SVN_PROP_MERGEINFO))
                 has_pristine_mergeinfo = TRUE;
 
               if (!has_pristine_mergeinfo && prop->value)
@@ -2172,7 +2173,7 @@ merge_file_added(const char *relpath,
           pristine_props = right_props; /* Includes last_* information */
           new_props = NULL; /* No local changes */
 
-          if (svn_hash_gets(pristine_props, SVN_PROP_MERGEINFO))
+          if (svn_hash_gets_fixed_key(pristine_props, SVN_PROP_MERGEINFO))
             {
               alloc_and_store_path(&merge_b->paths_with_new_mergeinfo,
                                    local_abspath, merge_b->pool);
@@ -2200,7 +2201,7 @@ merge_file_added(const char *relpath,
           new_props = svn_prop_array_to_hash(regular_props, scratch_pool);
 
           /* Issue #3383: We don't want mergeinfo from a foreign repository. */
-          svn_hash_sets(new_props, SVN_PROP_MERGEINFO, NULL);
+          svn_hash_sets_fixed_key(new_props, SVN_PROP_MERGEINFO, NULL);
         }
 
       /* Do everything like if we had called 'svn cp PATH1 PATH2'. */
@@ -2967,7 +2968,7 @@ merge_dir_added(const char *relpath,
                                                 scratch_pool));
         }
 
-      if (svn_hash_gets(new_pristine_props, SVN_PROP_MERGEINFO))
+      if (svn_hash_gets_fixed_key(new_pristine_props, SVN_PROP_MERGEINFO))
         {
           alloc_and_store_path(&merge_b->paths_with_new_mergeinfo,
                                local_abspath, merge_b->pool);
@@ -2985,7 +2986,7 @@ merge_dir_added(const char *relpath,
 
       new_props = svn_prop_array_to_hash(regular_props, scratch_pool);
 
-      svn_hash_sets(new_props, SVN_PROP_MERGEINFO, NULL);
+      svn_hash_sets_fixed_key(new_props, SVN_PROP_MERGEINFO, NULL);
 
       /* ### What is the easiest way to set new_props on LOCAL_ABSPATH?
 
@@ -3194,7 +3195,7 @@ merge_dir_deleted(const char *relpath,
     {
       /* Record that we might have deleted mergeinfo */
       if (working_props
-          && svn_hash_gets(working_props, SVN_PROP_MERGEINFO))
+          && svn_hash_gets_fixed_key(working_props, SVN_PROP_MERGEINFO))
         {
           alloc_and_store_path(&merge_b->paths_with_deleted_mergeinfo,
                                local_abspath, merge_b->pool);

Modified: subversion/trunk/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/mergeinfo.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_client/mergeinfo.c Thu May 16 19:48:47 2013
@@ -677,7 +677,7 @@ svn_client__get_wc_or_repos_mergeinfo_ca
           SVN_ERR(svn_wc_get_pristine_props(&original_props,
                                             ctx->wc_ctx, local_abspath,
                                             result_pool, scratch_pool));
-          if (!svn_hash_gets(original_props, SVN_PROP_MERGEINFO))
+          if (!svn_hash_gets_fixed_key(original_props, SVN_PROP_MERGEINFO))
             {
               apr_pool_t *sesspool = NULL;
 

Modified: subversion/trunk/subversion/libsvn_fs_base/tree.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_base/tree.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_base/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_base/tree.c Thu May 16 19:48:47 2013
@@ -4997,7 +4997,7 @@ txn_body_get_mergeinfo_data_and_entries(
 
           SVN_ERR(svn_fs_base__dag_get_proplist(&plist, child_node,
                                                 trail, iterpool));
-          pval = svn_hash_gets(plist, SVN_PROP_MERGEINFO);
+          pval = svn_hash_gets_fixed_key(plist, SVN_PROP_MERGEINFO);
           if (! pval)
             {
               svn_string_t *id_str = svn_fs_base__id_unparse(child_id,
@@ -5172,7 +5172,7 @@ txn_body_get_mergeinfo_for_path(void *ba
   svn_pool_destroy(iterpool);
 
   SVN_ERR(svn_fs_base__dag_get_proplist(&proplist, node, trail, trail->pool));
-  mergeinfo_string = svn_hash_gets(proplist, SVN_PROP_MERGEINFO);
+  mergeinfo_string = svn_hash_gets_fixed_key(proplist, SVN_PROP_MERGEINFO);
   if (! mergeinfo_string)
     {
       svn_string_t *id_str =

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Thu May 16 19:48:47 2013
@@ -8719,7 +8719,7 @@ write_revision_zero(svn_fs_t *fs)
   date.data = svn_time_to_cstring(apr_time_now(), fs->pool);
   date.len = strlen(date.data);
   proplist = apr_hash_make(fs->pool);
-  svn_hash_sets(proplist, SVN_PROP_REVISION_DATE, &date);
+  svn_hash_sets_fixed_key(proplist, SVN_PROP_REVISION_DATE, &date);
   return set_revision_proplist(fs, 0, proplist, fs->pool);
 }
 

Modified: subversion/trunk/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/tree.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/tree.c Thu May 16 19:48:47 2013
@@ -3783,7 +3783,8 @@ crawl_directory_dag_for_mergeinfo(svn_fs
           svn_error_t *err;
 
           SVN_ERR(svn_fs_fs__dag_get_proplist(&proplist, kid_dag, iterpool));
-          mergeinfo_string = svn_hash_gets(proplist, SVN_PROP_MERGEINFO);
+          mergeinfo_string = svn_hash_gets_fixed_key(proplist,
+                                                     SVN_PROP_MERGEINFO);
           if (!mergeinfo_string)
             {
               svn_string_t *idstr = svn_fs_fs__id_unparse(dirent->id, iterpool);
@@ -3901,7 +3902,7 @@ get_mergeinfo_for_path_internal(svn_merg
 
   SVN_ERR(svn_fs_fs__dag_get_proplist(&proplist, nearest_ancestor->node,
                                       scratch_pool));
-  mergeinfo_string = svn_hash_gets(proplist, SVN_PROP_MERGEINFO);
+  mergeinfo_string = svn_hash_gets_fixed_key(proplist, SVN_PROP_MERGEINFO);
   if (!mergeinfo_string)
     return svn_error_createf
       (SVN_ERR_FS_CORRUPT, NULL,

Modified: subversion/trunk/subversion/libsvn_ra/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra/deprecated.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_ra/deprecated.c Thu May 16 19:48:47 2013
@@ -219,8 +219,8 @@ svn_error_t *svn_ra_get_commit_editor2(s
 {
   apr_hash_t *revprop_table = apr_hash_make(pool);
   if (log_msg)
-    svn_hash_sets(revprop_table, SVN_PROP_REVISION_LOG,
-                  svn_string_create(log_msg, pool));
+    svn_hash_sets_fixed_key(revprop_table, SVN_PROP_REVISION_LOG,
+                            svn_string_create(log_msg, pool));
   return svn_ra_get_commit_editor3(session, editor, edit_baton, revprop_table,
                                    commit_callback, commit_baton,
                                    lock_tokens, keep_locks, pool);

Modified: subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c Thu May 16 19:48:47 2013
@@ -761,10 +761,10 @@ svn_ra_local__get_commit_editor(svn_ra_s
 
   /* Copy the revprops table so we can add the username. */
   revprop_table = apr_hash_copy(pool, revprop_table);
-  svn_hash_sets(revprop_table, SVN_PROP_REVISION_AUTHOR,
-                svn_string_create(sess->username, pool));
-  svn_hash_sets(revprop_table, SVN_PROP_TXN_CLIENT_COMPAT_VERSION,
-                svn_string_create(SVN_VER_NUMBER, pool));
+  svn_hash_sets_fixed_key(revprop_table, SVN_PROP_REVISION_AUTHOR,
+                          svn_string_create(sess->username, pool));
+  svn_hash_sets_fixed_key(revprop_table, SVN_PROP_TXN_CLIENT_COMPAT_VERSION,
+                          svn_string_create(SVN_VER_NUMBER, pool));
 
   /* Get the repos commit-editor */
   return svn_repos_get_commit_editor5
@@ -1655,8 +1655,8 @@ svn_ra_local__get_commit_ev2(svn_editor_
 
   /* Copy the REVPROPS and insert the author/username.  */
   revprops = apr_hash_copy(scratch_pool, revprops);
-  svn_hash_sets(revprops, SVN_PROP_REVISION_AUTHOR,
-                svn_string_create(sess->username, scratch_pool));
+  svn_hash_sets_fixed_key(revprops, SVN_PROP_REVISION_AUTHOR,
+                          svn_string_create(sess->username, scratch_pool));
 
   return svn_error_trace(svn_repos__get_commit_ev2(
                            editor, sess->repos, NULL /* authz */,

Modified: subversion/trunk/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/client.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/client.c Thu May 16 19:48:47 2013
@@ -974,8 +974,8 @@ static svn_error_t *ra_svn_commit(svn_ra
   ra_svn_commit_callback_baton_t *ccb;
   apr_hash_index_t *hi;
   apr_pool_t *iterpool;
-  const svn_string_t *log_msg = svn_hash_gets(revprop_table,
-                                              SVN_PROP_REVISION_LOG);
+  const svn_string_t *log_msg = svn_hash_gets_fixed_key(revprop_table,
+                                                        SVN_PROP_REVISION_LOG);
 
   /* If we're sending revprops other than svn:log, make sure the server won't
      silently ignore them. */
@@ -1624,14 +1624,14 @@ static svn_error_t *ra_svn_log(svn_ra_se
             {
               /* Caller requested all revprops; set author/date/log. */
               if (author)
-                svn_hash_sets(log_entry->revprops, SVN_PROP_REVISION_AUTHOR,
-                              author);
+                svn_hash_sets_fixed_key(log_entry->revprops,
+                                        SVN_PROP_REVISION_AUTHOR, author);
               if (date)
-                svn_hash_sets(log_entry->revprops, SVN_PROP_REVISION_DATE,
-                              date);
+                svn_hash_sets_fixed_key(log_entry->revprops,
+                                        SVN_PROP_REVISION_DATE, date);
               if (message)
-                svn_hash_sets(log_entry->revprops, SVN_PROP_REVISION_LOG,
-                              message);
+                svn_hash_sets_fixed_key(log_entry->revprops,
+                                        SVN_PROP_REVISION_LOG, message);
             }
           else
             {
@@ -1640,14 +1640,14 @@ static svn_error_t *ra_svn_log(svn_ra_se
                 {
                   name = APR_ARRAY_IDX(revprops, i, char *);
                   if (author && strcmp(name, SVN_PROP_REVISION_AUTHOR) == 0)
-                    svn_hash_sets(log_entry->revprops,
-                                  SVN_PROP_REVISION_AUTHOR, author);
+                    svn_hash_sets_fixed_key(log_entry->revprops,
+                                            SVN_PROP_REVISION_AUTHOR, author);
                   if (date && strcmp(name, SVN_PROP_REVISION_DATE) == 0)
-                    svn_hash_sets(log_entry->revprops,
-                                  SVN_PROP_REVISION_DATE, date);
+                    svn_hash_sets_fixed_key(log_entry->revprops,
+                                            SVN_PROP_REVISION_DATE, date);
                   if (message && strcmp(name, SVN_PROP_REVISION_LOG) == 0)
-                    svn_hash_sets(log_entry->revprops,
-                                  SVN_PROP_REVISION_LOG, message);
+                    svn_hash_sets_fixed_key(log_entry->revprops,
+                                            SVN_PROP_REVISION_LOG, message);
                 }
             }
           SVN_ERR(receiver(receiver_baton, log_entry, iterpool));

Modified: subversion/trunk/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/commit.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/commit.c (original)
+++ subversion/trunk/subversion/libsvn_repos/commit.c Thu May 16 19:48:47 2013
@@ -1348,7 +1348,7 @@ svn_repos__get_commit_ev2(svn_editor_t *
   /* Can the user modify the repository at all?  */
   /* ### check against AUTHZ.  */
 
-  author = svn_hash_gets(revprops, SVN_PROP_REVISION_AUTHOR);
+  author = svn_hash_gets_fixed_key(revprops, SVN_PROP_REVISION_AUTHOR);
 
   eb = apr_palloc(result_pool, sizeof(*eb));
   eb->repos = repos;

Modified: subversion/trunk/subversion/libsvn_repos/delta.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/delta.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/delta.c (original)
+++ subversion/trunk/subversion/libsvn_repos/delta.c Thu May 16 19:48:47 2013
@@ -497,7 +497,8 @@ delta_proplists(struct context *c,
                                            pool));
 
           /* Transmit the committed-date. */
-          committed_date = svn_hash_gets(r_props, SVN_PROP_REVISION_DATE);
+          committed_date = svn_hash_gets_fixed_key(r_props,
+                                                   SVN_PROP_REVISION_DATE);
           if (committed_date || source_path)
             {
               SVN_ERR(change_fn(c, object, SVN_PROP_ENTRY_COMMITTED_DATE,
@@ -505,7 +506,8 @@ delta_proplists(struct context *c,
             }
 
           /* Transmit the last-author. */
-          last_author = svn_hash_gets(r_props, SVN_PROP_REVISION_AUTHOR);
+          last_author = svn_hash_gets_fixed_key(r_props,
+                                                SVN_PROP_REVISION_AUTHOR);
           if (last_author || source_path)
             {
               SVN_ERR(change_fn(c, object, SVN_PROP_ENTRY_LAST_AUTHOR,

Modified: subversion/trunk/subversion/libsvn_repos/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/deprecated.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_repos/deprecated.c Thu May 16 19:48:47 2013
@@ -57,11 +57,11 @@ svn_repos_get_commit_editor4(const svn_d
 {
   apr_hash_t *revprop_table = apr_hash_make(pool);
   if (user)
-    svn_hash_sets(revprop_table, SVN_PROP_REVISION_AUTHOR,
-                  svn_string_create(user, pool));
+    svn_hash_sets_fixed_key(revprop_table, SVN_PROP_REVISION_AUTHOR,
+                            svn_string_create(user, pool));
   if (log_msg)
-    svn_hash_sets(revprop_table, SVN_PROP_REVISION_LOG,
-                  svn_string_create(log_msg, pool));
+    svn_hash_sets_fixed_key(revprop_table, SVN_PROP_REVISION_LOG,
+                            svn_string_create(log_msg, pool));
   return svn_repos_get_commit_editor5(editor, edit_baton, repos, txn,
                                       repos_url, base_path, revprop_table,
                                       commit_callback, commit_baton,

Modified: subversion/trunk/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/dump.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/dump.c (original)
+++ subversion/trunk/subversion/libsvn_repos/dump.c Thu May 16 19:48:47 2013
@@ -471,8 +471,8 @@ dump_node(struct edit_baton *eb,
          dumped. */
       if (!eb->verify && eb->notify_func && eb->oldest_dumped_rev > 1)
         {
-          svn_string_t *mergeinfo_str = svn_hash_gets(prophash,
-                                                      SVN_PROP_MERGEINFO);
+          svn_string_t *mergeinfo_str
+            = svn_hash_gets_fixed_key(prophash, SVN_PROP_MERGEINFO);
           if (mergeinfo_str)
             {
               svn_mergeinfo_t mergeinfo, old_mergeinfo;
@@ -1041,13 +1041,13 @@ write_revision_record(svn_stream_t *stre
   /* Run revision date properties through the time conversion to
      canonicalize them. */
   /* ### Remove this when it is no longer needed for sure. */
-  datevalue = svn_hash_gets(props, SVN_PROP_REVISION_DATE);
+  datevalue = svn_hash_gets_fixed_key(props, SVN_PROP_REVISION_DATE);
   if (datevalue)
     {
       SVN_ERR(svn_time_from_cstring(&timetemp, datevalue->data, pool));
       datevalue = svn_string_create(svn_time_to_cstring(timetemp, pool),
                                     pool);
-      svn_hash_sets(props, SVN_PROP_REVISION_DATE, datevalue);
+      svn_hash_sets_fixed_key(props, SVN_PROP_REVISION_DATE, datevalue);
     }
 
   encoded_prophash = svn_stringbuf_create_ensure(0, pool);

Modified: subversion/trunk/subversion/libsvn_repos/fs-wrap.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/fs-wrap.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/fs-wrap.c (original)
+++ subversion/trunk/subversion/libsvn_repos/fs-wrap.c Thu May 16 19:48:47 2013
@@ -115,8 +115,9 @@ svn_repos_fs_begin_txn_for_commit2(svn_f
 {
   apr_array_header_t *revprops;
   const char *txn_name;
-  svn_string_t *author = svn_hash_gets(revprop_table, SVN_PROP_REVISION_AUTHOR);
   apr_hash_t *hooks_env;
+  svn_string_t *author = svn_hash_gets_fixed_key(revprop_table,
+                                                 SVN_PROP_REVISION_AUTHOR);
 
   /* Parse the hooks-env file (if any). */
   SVN_ERR(svn_repos__parse_hooks_env(&hooks_env, repos->hooks_env_path,
@@ -153,11 +154,11 @@ svn_repos_fs_begin_txn_for_commit(svn_fs
 {
   apr_hash_t *revprop_table = apr_hash_make(pool);
   if (author)
-    svn_hash_sets(revprop_table, SVN_PROP_REVISION_AUTHOR,
-                  svn_string_create(author, pool));
+    svn_hash_sets_fixed_key(revprop_table, SVN_PROP_REVISION_AUTHOR,
+                            svn_string_create(author, pool));
   if (log_msg)
-    svn_hash_sets(revprop_table, SVN_PROP_REVISION_LOG,
-                  svn_string_create(log_msg, pool));
+    svn_hash_sets_fixed_key(revprop_table, SVN_PROP_REVISION_LOG,
+                            svn_string_create(log_msg, pool));
   return svn_repos_fs_begin_txn_for_commit2(txn_p, repos, rev, revprop_table,
                                             pool);
 }
@@ -459,13 +460,13 @@ svn_repos_fs_revision_proplist(apr_hash_
 
       /* If they exist, we only copy svn:author and svn:date into the
          'real' hashtable being returned. */
-      value = svn_hash_gets(tmphash, SVN_PROP_REVISION_AUTHOR);
+      value = svn_hash_gets_fixed_key(tmphash, SVN_PROP_REVISION_AUTHOR);
       if (value)
-        svn_hash_sets(*table_p, SVN_PROP_REVISION_AUTHOR, value);
+        svn_hash_sets_fixed_key(*table_p, SVN_PROP_REVISION_AUTHOR, value);
 
-      value = svn_hash_gets(tmphash, SVN_PROP_REVISION_DATE);
+      value = svn_hash_gets_fixed_key(tmphash, SVN_PROP_REVISION_DATE);
       if (value)
-        svn_hash_sets(*table_p, SVN_PROP_REVISION_DATE, value);
+        svn_hash_sets_fixed_key(*table_p, SVN_PROP_REVISION_DATE, value);
     }
   else /* wholly readable revision */
     {

Modified: subversion/trunk/subversion/libsvn_repos/log.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/log.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/log.c (original)
+++ subversion/trunk/subversion/libsvn_repos/log.c Thu May 16 19:48:47 2013
@@ -1085,10 +1085,14 @@ fill_log_entry(svn_log_entry_t *log_entr
             {
               /* ... but we can only return author/date. */
               log_entry->revprops = svn_hash__make(pool);
-              svn_hash_sets(log_entry->revprops, SVN_PROP_REVISION_AUTHOR,
-                            svn_hash_gets(r_props, SVN_PROP_REVISION_AUTHOR));
-              svn_hash_sets(log_entry->revprops, SVN_PROP_REVISION_DATE,
-                            svn_hash_gets(r_props, SVN_PROP_REVISION_DATE));
+              svn_hash_sets_fixed_key(log_entry->revprops,
+                                      SVN_PROP_REVISION_AUTHOR,
+                            svn_hash_gets_fixed_key(r_props,
+                                                    SVN_PROP_REVISION_AUTHOR));
+              svn_hash_sets_fixed_key(log_entry->revprops,
+                                      SVN_PROP_REVISION_DATE,
+                            svn_hash_gets_fixed_key(r_props,
+                                                    SVN_PROP_REVISION_DATE));
             }
           else
             /* ... so return all we got. */

Modified: subversion/trunk/subversion/libsvn_repos/reporter.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/reporter.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/reporter.c (original)
+++ subversion/trunk/subversion/libsvn_repos/reporter.c Thu May 16 19:48:47 2013
@@ -487,10 +487,10 @@ get_revision_info(report_baton_t *b,
                                        scratch_pool));
 
       /* Extract the committed-date. */
-      cdate = svn_hash_gets(r_props, SVN_PROP_REVISION_DATE);
+      cdate = svn_hash_gets_fixed_key(r_props, SVN_PROP_REVISION_DATE);
 
       /* Extract the last-author. */
-      author = svn_hash_gets(r_props, SVN_PROP_REVISION_AUTHOR);
+      author = svn_hash_gets_fixed_key(r_props, SVN_PROP_REVISION_AUTHOR);
 
       /* Create a result object */
       info = apr_palloc(b->pool, sizeof(*info));

Modified: subversion/trunk/subversion/libsvn_repos/rev_hunt.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/rev_hunt.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/rev_hunt.c (original)
+++ subversion/trunk/subversion/libsvn_repos/rev_hunt.c Thu May 16 19:48:47 2013
@@ -171,12 +171,8 @@ svn_repos_get_committed_info(svn_revnum_
   SVN_ERR(svn_fs_revision_proplist(&revprops, fs, *committed_rev, pool));
 
   /* Extract date and author from these revprops. */
-  committed_date_s = apr_hash_get(revprops,
-                                  SVN_PROP_REVISION_DATE,
-                                  sizeof(SVN_PROP_REVISION_DATE)-1);
-  last_author_s = apr_hash_get(revprops,
-                               SVN_PROP_REVISION_AUTHOR,
-                               sizeof(SVN_PROP_REVISION_AUTHOR)-1);
+  committed_date_s = svn_hash_gets_fixed_key(revprops, SVN_PROP_REVISION_DATE);
+  last_author_s = svn_hash_gets_fixed_key(revprops, SVN_PROP_REVISION_AUTHOR);
 
   *committed_date = committed_date_s ? committed_date_s->data : NULL;
   *last_author = last_author_s ? last_author_s->data : NULL;

Modified: subversion/trunk/subversion/libsvn_subr/compat.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/compat.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/compat.c (original)
+++ subversion/trunk/subversion/libsvn_subr/compat.c Thu May 16 19:48:47 2013
@@ -76,9 +76,9 @@ svn_compat_log_revprops_clear(apr_hash_t
 {
   if (revprops)
     {
-      svn_hash_sets(revprops, SVN_PROP_REVISION_AUTHOR, NULL);
-      svn_hash_sets(revprops, SVN_PROP_REVISION_DATE, NULL);
-      svn_hash_sets(revprops, SVN_PROP_REVISION_LOG, NULL);
+      svn_hash_sets_fixed_key(revprops, SVN_PROP_REVISION_AUTHOR, NULL);
+      svn_hash_sets_fixed_key(revprops, SVN_PROP_REVISION_DATE, NULL);
+      svn_hash_sets_fixed_key(revprops, SVN_PROP_REVISION_LOG, NULL);
     }
 }
 
@@ -103,11 +103,14 @@ svn_compat_log_revprops_out(const char *
   *author = *date = *message = NULL;
   if (revprops)
     {
-      if ((author_s = svn_hash_gets(revprops, SVN_PROP_REVISION_AUTHOR)))
+      if ((author_s = svn_hash_gets_fixed_key(revprops,
+                                              SVN_PROP_REVISION_AUTHOR)))
         *author = author_s->data;
-      if ((date_s = svn_hash_gets(revprops, SVN_PROP_REVISION_DATE)))
+      if ((date_s = svn_hash_gets_fixed_key(revprops,
+                                            SVN_PROP_REVISION_DATE)))
         *date = date_s->data;
-      if ((message_s = svn_hash_gets(revprops, SVN_PROP_REVISION_LOG)))
+      if ((message_s = svn_hash_gets_fixed_key(revprops,
+                                               SVN_PROP_REVISION_LOG)))
         *message = message_s->data;
     }
 }

Modified: subversion/trunk/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/status.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/status.c (original)
+++ subversion/trunk/subversion/libsvn_wc/status.c Thu May 16 19:48:47 2013
@@ -995,12 +995,12 @@ collect_ignore_patterns(apr_array_header
     {
       const svn_string_t *value;
 
-      value = svn_hash_gets(props, SVN_PROP_IGNORE);
+      value = svn_hash_gets_fixed_key(props, SVN_PROP_IGNORE);
       if (value)
         svn_cstring_split_append(*patterns, value->data, "\n\r", FALSE,
                                  result_pool);
 
-      value = svn_hash_gets(props, SVN_PROP_INHERITABLE_IGNORES);
+      value = svn_hash_gets_fixed_key(props, SVN_PROP_INHERITABLE_IGNORES);
       if (value)
         svn_cstring_split_append(*patterns, value->data, "\n\r", FALSE,
                                  result_pool);

Modified: subversion/trunk/subversion/mod_dav_svn/activity.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/activity.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/activity.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/activity.c Thu May 16 19:48:47 2013
@@ -255,9 +255,9 @@ dav_svn__create_txn(const dav_svn_repos 
 
   if (repos->username)
     {
-      svn_hash_sets(revprops,
-                    SVN_PROP_REVISION_AUTHOR,
-                    svn_string_create(repos->username, pool));
+      svn_hash_sets_fixed_key(revprops,
+                              SVN_PROP_REVISION_AUTHOR,
+                              svn_string_create(repos->username, pool));
     }
 
   serr = svn_fs_youngest_rev(&rev, repos->fs, pool);

Modified: subversion/trunk/subversion/mod_dav_svn/lock.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/lock.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/lock.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/lock.c Thu May 16 19:48:47 2013
@@ -680,9 +680,10 @@ append_locks(dav_lockdb *lockdb,
       svn_fs_root_t *txn_root;
       const char *conflict_msg;
       apr_hash_t *revprop_table = apr_hash_make(resource->pool);
-      svn_hash_sets(revprop_table,
-                    SVN_PROP_REVISION_AUTHOR,
-                    svn_string_create(repos->username, resource->pool));
+      svn_hash_sets_fixed_key(revprop_table,
+                              SVN_PROP_REVISION_AUTHOR,
+                              svn_string_create(repos->username,
+                                                resource->pool));
 
       if (resource->info->repos->is_svn_client)
         return dav_svn__new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED,

Modified: subversion/trunk/subversion/svndumpfilter/svndumpfilter.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svndumpfilter/svndumpfilter.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/svndumpfilter/svndumpfilter.c (original)
+++ subversion/trunk/subversion/svndumpfilter/svndumpfilter.c Thu May 16 19:48:47 2013
@@ -399,11 +399,12 @@ output_revision(struct revision_baton_t 
       apr_hash_t *old_props = rb->props;
       rb->has_props = TRUE;
       rb->props = apr_hash_make(hash_pool);
-      svn_hash_sets(rb->props, SVN_PROP_REVISION_DATE,
-                    svn_hash_gets(old_props, SVN_PROP_REVISION_DATE));
-      svn_hash_sets(rb->props, SVN_PROP_REVISION_LOG,
-                    svn_string_create(_("This is an empty revision for "
-                                        "padding."), hash_pool));
+      svn_hash_sets_fixed_key(rb->props, SVN_PROP_REVISION_DATE,
+                              svn_hash_gets_fixed_key(old_props,
+                                                      SVN_PROP_REVISION_DATE));
+      svn_hash_sets_fixed_key(rb->props, SVN_PROP_REVISION_LOG,
+                              svn_string_create(_("This is an empty revision "
+                                                  "for padding."), hash_pool));
     }
 
   /* Now, "rasterize" the props to a string, and append the property

Modified: subversion/trunk/subversion/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnmucc/svnmucc.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/svnmucc/svnmucc.c (original)
+++ subversion/trunk/subversion/svnmucc/svnmucc.c Thu May 16 19:48:47 2013
@@ -751,7 +751,7 @@ execute(const apr_array_header_t *action
                                             "svnmucc: ", "--config-option"));
   cfg_config = svn_hash_gets(config, SVN_CONFIG_CATEGORY_CONFIG);
 
-  if (! svn_hash_gets(revprops, SVN_PROP_REVISION_LOG))
+  if (! svn_hash_gets_fixed_key(revprops, SVN_PROP_REVISION_LOG))
     {
       svn_string_t *msg = svn_string_create("", pool);
 
@@ -770,7 +770,7 @@ execute(const apr_array_header_t *action
                       TRUE, NULL, apr_hash_pool_get(revprops)));
         }
 
-      svn_hash_sets(revprops, SVN_PROP_REVISION_LOG, msg);
+      svn_hash_sets_fixed_key(revprops, SVN_PROP_REVISION_LOG, msg);
     }
 
   SVN_ERR(create_ra_callbacks(&ra_callbacks, username, password, config_dir,
@@ -1028,13 +1028,13 @@ sanitize_log_sources(apr_hash_t *revprop
         return mutually_exclusive_logs_error();
 
       SVN_ERR(svn_utf_cstring_to_utf8(&message, filedata->data, hash_pool));
-      svn_hash_sets(revprops, SVN_PROP_REVISION_LOG,
-                    svn_stringbuf__morph_into_string(filedata));
+      svn_hash_sets_fixed_key(revprops, SVN_PROP_REVISION_LOG,
+                              svn_stringbuf__morph_into_string(filedata));
     }
   else if (message)
     {
-      svn_hash_sets(revprops, SVN_PROP_REVISION_LOG,
-                    svn_string_create(message, hash_pool));
+      svn_hash_sets_fixed_key(revprops, SVN_PROP_REVISION_LOG,
+                              svn_string_create(message, hash_pool));
     }
 
   return SVN_NO_ERROR;

Modified: subversion/trunk/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/load_editor.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/load_editor.c (original)
+++ subversion/trunk/subversion/svnrdump/load_editor.c Thu May 16 19:48:47 2013
@@ -635,8 +635,10 @@ new_node_record(void **node_baton,
          commit_editor. We'll set them separately using the RA API
          after closing the editor (see close_revision). */
 
-      svn_hash_sets(rb->revprop_table, SVN_PROP_REVISION_AUTHOR, NULL);
-      svn_hash_sets(rb->revprop_table, SVN_PROP_REVISION_DATE, NULL);
+      svn_hash_sets_fixed_key(rb->revprop_table,
+                              SVN_PROP_REVISION_AUTHOR, NULL);
+      svn_hash_sets_fixed_key(rb->revprop_table,
+                              SVN_PROP_REVISION_DATE, NULL);
 
       SVN_ERR(svn_ra__register_editor_shim_callbacks(rb->pb->session,
                                     get_shim_callbacks(rb, rb->pool)));

Modified: subversion/trunk/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnserve/serve.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/svnserve/serve.c (original)
+++ subversion/trunk/subversion/svnserve/serve.c Thu May 16 19:48:47 2013
@@ -1446,14 +1446,14 @@ static svn_error_t *commit(svn_ra_svn_co
   else
     {
       revprop_table = apr_hash_make(pool);
-      svn_hash_sets(revprop_table, SVN_PROP_REVISION_LOG,
-                    svn_string_create(log_msg, pool));
+      svn_hash_sets_fixed_key(revprop_table, SVN_PROP_REVISION_LOG,
+                              svn_string_create(log_msg, pool));
     }
 
   /* Get author from the baton, making sure clients can't circumvent
      the authentication via the revision props. */
-  svn_hash_sets(revprop_table, SVN_PROP_REVISION_AUTHOR,
-                b->user ? svn_string_create(b->user, pool) : NULL);
+  svn_hash_sets_fixed_key(revprop_table, SVN_PROP_REVISION_AUTHOR,
+                          b->user ? svn_string_create(b->user, pool) : NULL);
 
   ccb.pool = pool;
   ccb.new_rev = &new_rev;

Modified: subversion/trunk/subversion/svnsync/svnsync.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnsync/svnsync.c?rev=1483532&r1=1483531&r2=1483532&view=diff
==============================================================================
--- subversion/trunk/subversion/svnsync/svnsync.c (original)
+++ subversion/trunk/subversion/svnsync/svnsync.c Thu May 16 19:48:47 2013
@@ -1235,9 +1235,9 @@ replay_rev_started(svn_revnum_t revision
      have to set it to at least the empty string. If there's a svn:log
      property on this revision, we will write the actual value in the
      replay_rev_finished callback. */
-  if (! svn_hash_gets(filtered, SVN_PROP_REVISION_LOG))
-    svn_hash_sets(filtered, SVN_PROP_REVISION_LOG,
-                  svn_string_create_empty(pool));
+  if (! svn_hash_gets_fixed_key(filtered, SVN_PROP_REVISION_LOG))
+    svn_hash_sets_fixed_key(filtered, SVN_PROP_REVISION_LOG,
+                            svn_string_create_empty(pool));
 
   /* If necessary, normalize encoding and line ending style. Add the number
      of properties that required EOL normalization to the overall count



Re: svn commit: r1483532 - in /subversion/trunk/subversion: include/ libsvn_client/ libsvn_fs_base/ libsvn_fs_fs/ libsvn_ra/ libsvn_ra_local/ libsvn_ra_svn/ libsvn_repos/ libsvn_subr/ libsvn_wc/ mod_dav_svn/ svndumpfilter/ svnmucc/ svnrdump/ svnserve/ svns...

Posted by Ivan Zhakov <iv...@visualsvn.com>.
On Fri, May 17, 2013 at 1:40 AM, Stefan Fuhrmann
<st...@wandisco.com> wrote:
>
> On Thu, May 16, 2013 at 11:14 PM, Ivan Zhakov <iv...@visualsvn.com> wrote:
>>
>> On Thu, May 16, 2013 at 11:48 PM,  <st...@apache.org> wrote:
>> > Author: stefan2
>> > Date: Thu May 16 19:48:47 2013
>> > New Revision: 1483532
>> >
>> > URL: http://svn.apache.org/r1483532
>> > Log:
>> > We frequently use property name constants in conjunction with hash
>> > containers.
>> > Provide new wrappers around apr_hash_get and apr_hash_set that accept
>> > such
>> > string constants and statically determine their size.  That minimizes
>> > the
>> > hash access costs.
>> >
>> > Mass change hash get and set calls for SVN_PROP_* constants.
>> >
>> Hi Stefan,
>>
>> Is the performance gain costs code complexity? Please understand my
>> correctly: it's great improve Subversion speed. I just don't like the
>> idea getting code more complicated to win just several cycles.
>
>
> It is not essential to use these wrappers in all places. I did that for
> symmetry.
> As for the complexity: The patch should not add any significant maintenance
> costs - no extra parameters etc.
>
It's really easy to create bugs with new API: if someone pass const
char * variable as parameter to svn_hash_sets_fixed_key(). Risk very
high IMHO, while benefits are small.

-- 
Ivan Zhakov
CTO | VisualSVN | http://www.visualsvn.com

Re: svn commit: r1483532 - in /subversion/trunk/subversion: include/ libsvn_client/ libsvn_fs_base/ libsvn_fs_fs/ libsvn_ra/ libsvn_ra_local/ libsvn_ra_svn/ libsvn_repos/ libsvn_subr/ libsvn_wc/ mod_dav_svn/ svndumpfilter/ svnmucc/ svnrdump/ svnserve/ svns...

Posted by Stefan Fuhrmann <st...@wandisco.com>.
On Thu, May 16, 2013 at 11:14 PM, Ivan Zhakov <iv...@visualsvn.com> wrote:

> On Thu, May 16, 2013 at 11:48 PM,  <st...@apache.org> wrote:
> > Author: stefan2
> > Date: Thu May 16 19:48:47 2013
> > New Revision: 1483532
> >
> > URL: http://svn.apache.org/r1483532
> > Log:
> > We frequently use property name constants in conjunction with hash
> containers.
> > Provide new wrappers around apr_hash_get and apr_hash_set that accept
> such
> > string constants and statically determine their size.  That minimizes the
> > hash access costs.
> >
> > Mass change hash get and set calls for SVN_PROP_* constants.
> >
> Hi Stefan,
>
> Is the performance gain costs code complexity? Please understand my
> correctly: it's great improve Subversion speed. I just don't like the
> idea getting code more complicated to win just several cycles.
>

It is not essential to use these wrappers in all places. I did that for
symmetry.
As for the complexity: The patch should not add any significant maintenance
costs - no extra parameters etc.

Not using the new wrappers doesn't break anything. Using them
inappropriately,
e.g. on a const char *, will break result in data not being found in the
hash
(keys would effectively be truncated to 4 or 8 bytes) or even a segfault in
all
uses of that code. So, these cases would caught early on.

-- Stefan^2.

-- 
*Join one of our free daily demo sessions on* *Scaling Subversion for the
Enterprise <http://www.wandisco.com/training/webinars>*
*

*

Re: svn commit: r1483532 - in /subversion/trunk/subversion: include/ libsvn_client/ libsvn_fs_base/ libsvn_fs_fs/ libsvn_ra/ libsvn_ra_local/ libsvn_ra_svn/ libsvn_repos/ libsvn_subr/ libsvn_wc/ mod_dav_svn/ svndumpfilter/ svnmucc/ svnrdump/ svnserve/ svns...

Posted by Ivan Zhakov <iv...@visualsvn.com>.
On Thu, May 16, 2013 at 11:48 PM,  <st...@apache.org> wrote:
> Author: stefan2
> Date: Thu May 16 19:48:47 2013
> New Revision: 1483532
>
> URL: http://svn.apache.org/r1483532
> Log:
> We frequently use property name constants in conjunction with hash containers.
> Provide new wrappers around apr_hash_get and apr_hash_set that accept such
> string constants and statically determine their size.  That minimizes the
> hash access costs.
>
> Mass change hash get and set calls for SVN_PROP_* constants.
>
Hi Stefan,

Is the performance gain costs code complexity? Please understand my
correctly: it's great improve Subversion speed. I just don't like the
idea getting code more complicated to win just several cycles.

-- 
Ivan Zhakov
CTO | VisualSVN | http://www.visualsvn.com