You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2013/03/23 15:09:03 UTC
svn commit: r1460158 [1/2] - /subversion/trunk/subversion/libsvn_wc/
Author: danielsh
Date: Sat Mar 23 14:09:02 2013
New Revision: 1460158
URL: http://svn.apache.org/r1460158
Log:
Use svn_hash_gets and svn_hash_puts.
* subversion/libsvn_wc/adm_crawler.c
* subversion/libsvn_wc/adm_ops.c
* subversion/libsvn_wc/conflicts.c
* subversion/libsvn_wc/copy.c
* subversion/libsvn_wc/deprecated.c
* subversion/libsvn_wc/diff_local.c
* subversion/libsvn_wc/entries.c
* subversion/libsvn_wc/externals.c
* subversion/libsvn_wc/info.c
* subversion/libsvn_wc/old-and-busted.c
* subversion/libsvn_wc/props.c
* subversion/libsvn_wc/revert.c
* subversion/libsvn_wc/status.c
* subversion/libsvn_wc/translate.c
* subversion/libsvn_wc/update_editor.c
* subversion/libsvn_wc/upgrade.c
* subversion/libsvn_wc/wc_db.c
* subversion/libsvn_wc/wc_db_update_move.c
* subversion/libsvn_wc/wc_db_wcroot.c
* subversion/libsvn_wc/workqueue.c
Modified:
subversion/trunk/subversion/libsvn_wc/adm_crawler.c
subversion/trunk/subversion/libsvn_wc/adm_ops.c
subversion/trunk/subversion/libsvn_wc/conflicts.c
subversion/trunk/subversion/libsvn_wc/copy.c
subversion/trunk/subversion/libsvn_wc/deprecated.c
subversion/trunk/subversion/libsvn_wc/diff_local.c
subversion/trunk/subversion/libsvn_wc/entries.c
subversion/trunk/subversion/libsvn_wc/externals.c
subversion/trunk/subversion/libsvn_wc/info.c
subversion/trunk/subversion/libsvn_wc/old-and-busted.c
subversion/trunk/subversion/libsvn_wc/props.c
subversion/trunk/subversion/libsvn_wc/revert.c
subversion/trunk/subversion/libsvn_wc/status.c
subversion/trunk/subversion/libsvn_wc/translate.c
subversion/trunk/subversion/libsvn_wc/update_editor.c
subversion/trunk/subversion/libsvn_wc/upgrade.c
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c
subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c
subversion/trunk/subversion/libsvn_wc/workqueue.c
Modified: subversion/trunk/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_crawler.c?rev=1460158&r1=1460157&r2=1460158&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_crawler.c Sat Mar 23 14:09:02 2013
@@ -370,7 +370,7 @@ report_revisions_and_depths(svn_wc__db_t
/* Is the entry NOT on the disk? We may be able to restore it. */
if (restore_files
- && apr_hash_get(dirents, child, APR_HASH_KEY_STRING) == NULL)
+ && svn_hash_gets(dirents, child) == NULL)
{
svn_wc__db_status_t wrk_status;
svn_node_kind_t wrk_kind;
Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=1460158&r1=1460157&r2=1460158&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Sat Mar 23 14:09:02 2013
@@ -297,7 +297,7 @@ svn_wc__process_committed_internal(svn_w
this_abspath = svn_dirent_join(local_abspath, name, iterpool);
sha1_checksum = NULL;
- cqi = apr_hash_get(queue->queue, this_abspath, APR_HASH_KEY_STRING);
+ cqi = svn_hash_gets(queue->queue, this_abspath);
if (cqi != NULL)
sha1_checksum = cqi->sha1_checksum;
@@ -342,7 +342,7 @@ svn_wc__prop_array_to_hash(const apr_arr
{
const svn_prop_t *prop = APR_ARRAY_IDX(props, i, const svn_prop_t *);
if (prop->value != NULL)
- apr_hash_set(prophash, prop->name, APR_HASH_KEY_STRING, prop->value);
+ svn_hash_sets(prophash, prop->name, prop->value);
}
return prophash;
@@ -393,7 +393,7 @@ svn_wc_queue_committed3(svn_wc_committed
cqi->sha1_checksum = sha1_checksum;
cqi->new_dav_cache = svn_wc__prop_array_to_hash(wcprop_changes, queue->pool);
- apr_hash_set(queue->queue, local_abspath, APR_HASH_KEY_STRING, cqi);
+ svn_hash_sets(queue->queue, local_abspath, cqi);
return SVN_NO_ERROR;
}
@@ -488,11 +488,10 @@ svn_wc_process_committed_queue2(svn_wc_c
wc_ctx->db, cqi->local_abspath,
iterpool, iterpool));
- if (! apr_hash_get(run_wqs, wcroot_abspath, APR_HASH_KEY_STRING))
+ if (! svn_hash_gets(run_wqs, wcroot_abspath))
{
wcroot_abspath = apr_pstrdup(scratch_pool, wcroot_abspath);
- apr_hash_set(run_wqs, wcroot_abspath, APR_HASH_KEY_STRING,
- wcroot_abspath);
+ svn_hash_sets(run_wqs, wcroot_abspath, wcroot_abspath);
}
}
@@ -1386,8 +1385,7 @@ svn_wc__internal_changelist_match(svn_wc
}
return (changelist
- && apr_hash_get((apr_hash_t *)clhash, changelist,
- APR_HASH_KEY_STRING) != NULL);
+ && svn_hash_gets((apr_hash_t *)clhash, changelist) != NULL);
}
Modified: subversion/trunk/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/conflicts.c?rev=1460158&r1=1460157&r2=1460158&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_wc/conflicts.c Sat Mar 23 14:09:02 2013
@@ -891,10 +891,9 @@ svn_wc__conflict_read_prop_conflict(cons
for (name = c->children; name; name = name->next)
{
- apr_hash_set(*conflicted_prop_names,
- apr_pstrmemdup(result_pool, name->data, name->len),
- APR_HASH_KEY_STRING,
- "");
+ svn_hash_sets(*conflicted_prop_names,
+ apr_pstrmemdup(result_pool, name->data, name->len),
+ "");
}
}
c = c->next;
@@ -1217,20 +1216,16 @@ svn_wc__conflict_create_markers(svn_skel
SVN_ERR(prop_conflict_skel_add(
prop_data, propname,
old_props
- ? apr_hash_get(old_props, propname,
- APR_HASH_KEY_STRING)
+ ? svn_hash_gets(old_props, propname)
: NULL,
mine_props
- ? apr_hash_get(mine_props, propname,
- APR_HASH_KEY_STRING)
+ ? svn_hash_gets(mine_props, propname)
: NULL,
their_props
- ? apr_hash_get(their_props, propname,
- APR_HASH_KEY_STRING)
+ ? svn_hash_gets(their_props, propname)
: NULL,
their_original_props
- ? apr_hash_get(their_original_props, propname,
- APR_HASH_KEY_STRING)
+ ? svn_hash_gets(their_original_props, propname)
: NULL,
result_pool, scratch_pool));
}
@@ -1508,7 +1503,7 @@ generate_propconflict(svn_boolean_t *con
SVN_ERR(svn_wc__db_read_props(&props, db, local_abspath, scratch_pool,
scratch_pool));
- apr_hash_set(props, propname, APR_HASH_KEY_STRING, new_value);
+ svn_hash_sets(props, propname, new_value);
SVN_ERR(svn_wc__db_op_set_props(db, local_abspath, props,
FALSE, NULL, NULL,
@@ -1948,20 +1943,16 @@ svn_wc__conflict_invoke_resolver(svn_wc_
right_version,
propname,
old_props
- ? apr_hash_get(old_props, propname,
- APR_HASH_KEY_STRING)
+ ? svn_hash_gets(old_props, propname)
: NULL,
mine_props
- ? apr_hash_get(mine_props, propname,
- APR_HASH_KEY_STRING)
+ ? svn_hash_gets(mine_props, propname)
: NULL,
old_their_props
- ? apr_hash_get(old_their_props, propname,
- APR_HASH_KEY_STRING)
+ ? svn_hash_gets(old_their_props, propname)
: NULL,
their_props
- ? apr_hash_get(their_props, propname,
- APR_HASH_KEY_STRING)
+ ? svn_hash_gets(their_props, propname)
: NULL,
resolver_func, resolver_baton,
iterpool));
@@ -2134,9 +2125,8 @@ read_prop_conflicts(apr_array_header_t *
desc->property_name = apr_pstrdup(result_pool, propname);
- my_value = apr_hash_get(my_props, propname, APR_HASH_KEY_STRING);
- their_value = apr_hash_get(their_props, propname,
- APR_HASH_KEY_STRING);
+ my_value = svn_hash_gets(my_props, propname);
+ their_value = svn_hash_gets(their_props, propname);
/* Compute the incoming side of the conflict ('action'). */
if (their_value == NULL)
@@ -2192,7 +2182,7 @@ read_prop_conflicts(apr_array_header_t *
SVN_ERR(svn_stream_close(s));
}
- old_value = apr_hash_get(their_old_props, propname, APR_HASH_KEY_STRING);
+ old_value = svn_hash_gets(their_old_props, propname);
if (old_value)
{
svn_stream_t *s;
@@ -2596,11 +2586,9 @@ resolve_prop_conflict_on_node(svn_boolea
const char *propname = svn__apr_hash_index_key(hi);
svn_string_t *new_value = NULL;
- new_value = apr_hash_get(resolve_from, propname,
- APR_HASH_KEY_STRING);
+ new_value = svn_hash_gets(resolve_from, propname);
- apr_hash_set(actual_props, propname, APR_HASH_KEY_STRING,
- new_value);
+ svn_hash_sets(actual_props, propname, new_value);
}
SVN_ERR(svn_wc__db_op_set_props(db, local_abspath, actual_props,
FALSE, NULL, NULL,
Modified: subversion/trunk/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/copy.c?rev=1460158&r1=1460157&r2=1460158&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/copy.c (original)
+++ subversion/trunk/subversion/libsvn_wc/copy.c Sat Mar 23 14:09:02 2013
@@ -32,6 +32,7 @@
#include "svn_error.h"
#include "svn_dirent_uri.h"
#include "svn_path.h"
+#include "svn_hash.h"
#include "wc.h"
#include "workqueue.h"
@@ -447,7 +448,7 @@ copy_versioned_dir(svn_wc__db_t *db,
|| info->status == svn_wc__db_status_added))
{
/* Remove versioned child as it has been handled */
- apr_hash_set(disk_children, child_name, APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(disk_children, child_name, NULL);
}
}
@@ -481,8 +482,7 @@ copy_versioned_dir(svn_wc__db_t *db,
unver_dst_abspath = svn_dirent_join(dst_abspath, name, iterpool);
if (marker_files &&
- apr_hash_get(marker_files, unver_src_abspath,
- APR_HASH_KEY_STRING))
+ svn_hash_gets(marker_files, unver_src_abspath))
continue;
SVN_ERR(copy_to_tmpdir(&work_item, NULL, db, unver_src_abspath,
Modified: subversion/trunk/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/deprecated.c?rev=1460158&r1=1460157&r2=1460158&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_wc/deprecated.c Sat Mar 23 14:09:02 2013
@@ -32,6 +32,7 @@
#include "svn_subst.h"
#include "svn_pools.h"
#include "svn_props.h"
+#include "svn_hash.h"
#include "svn_time.h"
#include "svn_dirent_uri.h"
#include "svn_path.h"
@@ -85,8 +86,7 @@ traversal_info_update(void *baton,
{
dup_val = apr_pstrmemdup(dup_pool, old_val->data, old_val->len);
- apr_hash_set(ub->traversal->externals_old, dup_path, APR_HASH_KEY_STRING,
- dup_val);
+ svn_hash_sets(ub->traversal->externals_old, dup_path, dup_val);
}
if (new_val)
@@ -95,12 +95,10 @@ traversal_info_update(void *baton,
if (old_val != new_val)
dup_val = apr_pstrmemdup(dup_pool, new_val->data, new_val->len);
- apr_hash_set(ub->traversal->externals_new, dup_path, APR_HASH_KEY_STRING,
- dup_val);
+ svn_hash_sets(ub->traversal->externals_new, dup_path, dup_val);
}
- apr_hash_set(ub->traversal->depths, dup_path, APR_HASH_KEY_STRING,
- svn_depth_to_word(depth));
+ svn_hash_sets(ub->traversal->depths, dup_path, svn_depth_to_word(depth));
return SVN_NO_ERROR;
}
@@ -138,19 +136,15 @@ gather_traversal_info(svn_wc_context_t *
traversal_info->pool);
if (gather_as_old)
- apr_hash_set(traversal_info->externals_old,
- relpath, APR_HASH_KEY_STRING,
- svn__apr_hash_index_val(hi));
+ svn_hash_sets(traversal_info->externals_old, relpath,
+ svn__apr_hash_index_val(hi));
if (gather_as_new)
- apr_hash_set(traversal_info->externals_new,
- relpath, APR_HASH_KEY_STRING,
- svn__apr_hash_index_val(hi));
-
- apr_hash_set(traversal_info->depths,
- relpath, APR_HASH_KEY_STRING,
- apr_hash_get(ambient_depths, node_abspath,
- APR_HASH_KEY_STRING));
+ svn_hash_sets(traversal_info->externals_new, relpath,
+ svn__apr_hash_index_val(hi));
+
+ svn_hash_sets(traversal_info->depths, relpath,
+ svn_hash_gets(ambient_depths, node_abspath));
}
return SVN_NO_ERROR;
@@ -2357,8 +2351,7 @@ svn_wc_parse_externals_description(apr_h
svn_wc_external_item_t *item;
item = APR_ARRAY_IDX(list, i, svn_wc_external_item_t *);
- apr_hash_set(*externals_p, item->target_dir,
- APR_HASH_KEY_STRING, item);
+ svn_hash_sets(*externals_p, item->target_dir, item);
}
}
return SVN_NO_ERROR;
@@ -3148,8 +3141,7 @@ svn_wc_add_repos_file2(const char *dst_p
/* If the new file is special, then we can simply open the given
contents since it is already in normal form. */
- if (apr_hash_get(new_props,
- SVN_PROP_SPECIAL, APR_HASH_KEY_STRING) != NULL)
+ if (svn_hash_gets(new_props, SVN_PROP_SPECIAL) != NULL)
{
SVN_ERR(svn_stream_open_readonly(&new_contents, new_text_path,
pool, pool));
@@ -3162,8 +3154,7 @@ svn_wc_add_repos_file2(const char *dst_p
apr_hash_t *keywords = NULL;
svn_string_t *list;
- list = apr_hash_get(new_props,
- SVN_PROP_KEYWORDS, APR_HASH_KEY_STRING);
+ list = svn_hash_gets(new_props, SVN_PROP_KEYWORDS);
if (list != NULL)
{
/* Since we are detranslating, all of the keyword values
@@ -3177,9 +3168,8 @@ svn_wc_add_repos_file2(const char *dst_p
}
svn_subst_eol_style_from_value(&eol_style, &eol_str,
- apr_hash_get(new_props,
- SVN_PROP_EOL_STYLE,
- APR_HASH_KEY_STRING));
+ svn_hash_gets(new_props,
+ SVN_PROP_EOL_STYLE));
if (svn_subst_translation_required(eol_style, eol_str, keywords,
FALSE, FALSE))
Modified: subversion/trunk/subversion/libsvn_wc/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/diff_local.c?rev=1460158&r1=1460157&r2=1460158&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/trunk/subversion/libsvn_wc/diff_local.c Sat Mar 23 14:09:02 2013
@@ -246,8 +246,7 @@ diff_status_callback(void *baton,
if (eb->changelist_hash != NULL
&& (!status->changelist
- || ! apr_hash_get(eb->changelist_hash, status->changelist,
- APR_HASH_KEY_STRING)))
+ || ! svn_hash_gets(eb->changelist_hash, status->changelist)))
return SVN_NO_ERROR; /* Filtered via changelist */
/* This code does about the same thing as the inner body of
Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=1460158&r1=1460157&r2=1460158&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Sat Mar 23 14:09:02 2013
@@ -34,6 +34,7 @@
#include "svn_path.h"
#include "svn_ctype.h"
#include "svn_string.h"
+#include "svn_hash.h"
#include "wc.h"
#include "adm_files.h"
@@ -470,8 +471,7 @@ read_one_entry(const svn_wc_entry_t **ne
{
if (!tree_conflicts)
tree_conflicts = apr_hash_make(scratch_pool);
- apr_hash_set(tree_conflicts, child_name,
- APR_HASH_KEY_STRING, conflict);
+ svn_hash_sets(tree_conflicts, child_name, conflict);
}
}
}
@@ -971,7 +971,7 @@ read_entries_new(apr_hash_t **result_ent
"" /* name */,
NULL /* parent_entry */,
result_pool, iterpool));
- apr_hash_set(entries, "", APR_HASH_KEY_STRING, parent_entry);
+ svn_hash_sets(entries, "", parent_entry);
/* Use result_pool so that the child names (used by reference, rather
than copied) appear in result_pool. */
@@ -988,7 +988,7 @@ read_entries_new(apr_hash_t **result_ent
SVN_ERR(read_one_entry(&entry,
db, wc_id, local_abspath, name, parent_entry,
result_pool, iterpool));
- apr_hash_set(entries, entry->name, APR_HASH_KEY_STRING, entry);
+ svn_hash_sets(entries, entry->name, entry);
}
svn_pool_destroy(iterpool);
@@ -1365,7 +1365,7 @@ prune_deleted(apr_hash_t **entries_prune
SVN_ERR(svn_wc__entry_is_hidden(&hidden, entry));
if (!hidden)
- apr_hash_set(*entries_pruned, key, APR_HASH_KEY_STRING, entry);
+ svn_hash_sets(*entries_pruned, key, entry);
}
return SVN_NO_ERROR;
@@ -1888,9 +1888,8 @@ write_entry(struct write_baton **entry_n
/* Store in hash to be retrieved when writing the child
row. */
key = svn_dirent_skip_ancestor(root_abspath, conflict->local_abspath);
- apr_hash_set(tree_conflicts, apr_pstrdup(result_pool, key),
- APR_HASH_KEY_STRING,
- svn_skel__unparse(new_skel, result_pool)->data);
+ svn_hash_sets(tree_conflicts, apr_pstrdup(result_pool, key),
+ svn_skel__unparse(new_skel, result_pool)->data);
skel = skel->next;
}
}
@@ -1899,9 +1898,8 @@ write_entry(struct write_baton **entry_n
if (parent_node && parent_node->tree_conflicts)
{
- const char *tree_conflict_data = apr_hash_get(parent_node->tree_conflicts,
- local_relpath,
- APR_HASH_KEY_STRING);
+ const char *tree_conflict_data =
+ svn_hash_gets(parent_node->tree_conflicts, local_relpath);
if (tree_conflict_data)
{
actual_node = MAYBE_ALLOC(actual_node, scratch_pool);
@@ -1910,8 +1908,7 @@ write_entry(struct write_baton **entry_n
/* Reset hash so that we don't write the row again when writing
actual-only nodes */
- apr_hash_set(parent_node->tree_conflicts, local_relpath,
- APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(parent_node->tree_conflicts, local_relpath, NULL);
}
if (entry->file_external_path != NULL)
@@ -2355,8 +2352,7 @@ svn_wc__write_upgraded_entries(void **di
struct write_baton *dir_node;
/* Get a copy of the "this dir" entry for comparison purposes. */
- this_dir = apr_hash_get(entries, SVN_WC_ENTRY_THIS_DIR,
- APR_HASH_KEY_STRING);
+ this_dir = svn_hash_gets(entries, SVN_WC_ENTRY_THIS_DIR);
/* If there is no "this dir" entry, something is wrong. */
if (! this_dir)
@@ -2387,7 +2383,7 @@ svn_wc__write_upgraded_entries(void **di
const svn_wc_entry_t *this_entry = svn__apr_hash_index_val(hi);
const char *child_abspath, *child_relpath;
svn_wc__text_base_info_t *text_base_info
- = apr_hash_get(text_bases_info, name, APR_HASH_KEY_STRING);
+ = svn_hash_gets(text_bases_info, name);
svn_pool_clear(iterpool);
@@ -2513,8 +2509,7 @@ walker_helper(const char *dirpath,
SVN_ERR(walk_callbacks->handle_error(dirpath, err, walk_baton, pool));
/* As promised, always return the '.' entry first. */
- dot_entry = apr_hash_get(entries, SVN_WC_ENTRY_THIS_DIR,
- APR_HASH_KEY_STRING);
+ dot_entry = svn_hash_gets(entries, SVN_WC_ENTRY_THIS_DIR);
if (! dot_entry)
return walk_callbacks->handle_error
(dirpath, svn_error_createf(SVN_ERR_ENTRY_NOT_FOUND, NULL,
Modified: subversion/trunk/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/externals.c?rev=1460158&r1=1460157&r2=1460158&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/externals.c (original)
+++ subversion/trunk/subversion/libsvn_wc/externals.c Sat Mar 23 14:09:02 2013
@@ -360,7 +360,7 @@ svn_wc__externals_find_target_dups(apr_a
target = APR_ARRAY_IDX(externals, i,
svn_wc_external_item2_t*)->target_dir;
len = apr_hash_count(targets);
- apr_hash_set(targets, target, APR_HASH_KEY_STRING, "");
+ svn_hash_sets(targets, target, "");
if (len == apr_hash_count(targets))
{
/* Hashtable length is unchanged. This must be a duplicate. */
@@ -370,7 +370,7 @@ svn_wc__externals_find_target_dups(apr_a
if (! targets2)
targets2 = apr_hash_make(scratch_pool);
len2 = apr_hash_count(targets2);
- apr_hash_set(targets2, target, APR_HASH_KEY_STRING, "");
+ svn_hash_sets(targets2, target, "");
if (len2 < apr_hash_count(targets2))
{
/* The second hash list just got bigger, i.e. this target has
@@ -953,8 +953,7 @@ close_edit(void *edit_baton,
if (eb->iprops)
{
wcroot_iprops = apr_hash_make(pool);
- apr_hash_set(wcroot_iprops, eb->local_abspath, APR_HASH_KEY_STRING,
- eb->iprops);
+ svn_hash_sets(wcroot_iprops, eb->local_abspath, eb->iprops);
}
/* The node wasn't updated, so we just have to bump its revision */
@@ -1462,8 +1461,7 @@ svn_wc__externals_gather_definitions(apr
}
if (value)
- apr_hash_set(*externals, local_abspath, APR_HASH_KEY_STRING,
- value->data);
+ svn_hash_sets(*externals, local_abspath, value->data);
if (value && depths)
{
@@ -1478,8 +1476,7 @@ svn_wc__externals_gather_definitions(apr
wc_ctx->db, local_abspath,
scratch_pool, scratch_pool));
- apr_hash_set(*depths, local_abspath, APR_HASH_KEY_STRING,
- svn_depth_to_word(node_depth));
+ svn_hash_sets(*depths, local_abspath, svn_depth_to_word(node_depth));
}
return SVN_NO_ERROR;
Modified: subversion/trunk/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/info.c?rev=1460158&r1=1460157&r2=1460158&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/info.c (original)
+++ subversion/trunk/subversion/libsvn_wc/info.c Sat Mar 23 14:09:02 2013
@@ -22,6 +22,7 @@
*/
#include "svn_dirent_uri.h"
+#include "svn_hash.h"
#include "svn_path.h"
#include "svn_pools.h"
#include "svn_wc.h"
@@ -427,18 +428,17 @@ info_found_node_callback(const char *loc
{
const char *this_basename = APR_ARRAY_IDX(victims, i, const char *);
- apr_hash_set(fe_baton->tree_conflicts,
- svn_dirent_join(local_abspath, this_basename,
- fe_baton->pool),
- APR_HASH_KEY_STRING, "");
+ svn_hash_sets(fe_baton->tree_conflicts,
+ svn_dirent_join(local_abspath, this_basename,
+ fe_baton->pool),
+ "");
}
}
/* Delete this path which we are currently visiting from the list of tree
* conflicts. This relies on the walker visiting a directory before visiting
* its children. */
- apr_hash_set(fe_baton->tree_conflicts, local_abspath, APR_HASH_KEY_STRING,
- NULL);
+ svn_hash_sets(fe_baton->tree_conflicts, local_abspath, NULL);
return SVN_NO_ERROR;
}
@@ -523,8 +523,7 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
svn_error_clear(err);
- apr_hash_set(fe_baton.tree_conflicts, local_abspath,
- APR_HASH_KEY_STRING, "");
+ svn_hash_sets(fe_baton.tree_conflicts, local_abspath, "");
}
else
SVN_ERR(err);
Modified: subversion/trunk/subversion/libsvn_wc/old-and-busted.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/old-and-busted.c?rev=1460158&r1=1460157&r2=1460158&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/old-and-busted.c (original)
+++ subversion/trunk/subversion/libsvn_wc/old-and-busted.c Sat Mar 23 14:09:02 2013
@@ -26,6 +26,7 @@
#include "svn_time.h"
#include "svn_xml.h"
#include "svn_dirent_uri.h"
+#include "svn_hash.h"
#include "svn_path.h"
#include "svn_ctype.h"
#include "svn_pools.h"
@@ -716,7 +717,7 @@ do_bool_attr(svn_boolean_t *entry_flag,
apr_hash_t *atts, const char *attr_name,
const char *entry_name)
{
- const char *str = apr_hash_get(atts, attr_name, APR_HASH_KEY_STRING);
+ const char *str = svn_hash_gets(atts, attr_name);
*entry_flag = FALSE;
if (str)
@@ -741,7 +742,7 @@ extract_string(apr_hash_t *atts,
const char *att_name,
apr_pool_t *result_pool)
{
- const char *value = apr_hash_get(atts, att_name, APR_HASH_KEY_STRING);
+ const char *value = svn_hash_gets(atts, att_name);
if (value == NULL)
return NULL;
@@ -756,7 +757,7 @@ extract_string_normalize(apr_hash_t *att
const char *att_name,
apr_pool_t *result_pool)
{
- const char *value = apr_hash_get(atts, att_name, APR_HASH_KEY_STRING);
+ const char *value = svn_hash_gets(atts, att_name);
if (value == NULL)
return NULL;
@@ -790,7 +791,7 @@ atts_to_entry(svn_wc_entry_t **new_entry
const char *name;
/* Find the name and set up the entry under that name. */
- name = apr_hash_get(atts, ENTRIES_ATTR_NAME, APR_HASH_KEY_STRING);
+ name = svn_hash_gets(atts, ENTRIES_ATTR_NAME);
entry->name = name ? apr_pstrdup(pool, name) : SVN_WC_ENTRY_THIS_DIR;
/* Attempt to set revision (resolve_to_defaults may do it later, too)
@@ -798,7 +799,7 @@ atts_to_entry(svn_wc_entry_t **new_entry
### not used by loggy; no need to set MODIFY_FLAGS */
{
const char *revision_str
- = apr_hash_get(atts, ENTRIES_ATTR_REVISION, APR_HASH_KEY_STRING);
+ = svn_hash_gets(atts, ENTRIES_ATTR_REVISION);
if (revision_str)
entry->revision = SVN_STR_TO_REV(revision_str);
@@ -827,7 +828,7 @@ atts_to_entry(svn_wc_entry_t **new_entry
/* ### not used by loggy; no need to set MODIFY_FLAGS */
{
const char *kindstr
- = apr_hash_get(atts, ENTRIES_ATTR_KIND, APR_HASH_KEY_STRING);
+ = svn_hash_gets(atts, ENTRIES_ATTR_KIND);
entry->kind = svn_node_none;
if (kindstr)
@@ -848,7 +849,7 @@ atts_to_entry(svn_wc_entry_t **new_entry
/* ### not used by loggy; no need to set MODIFY_FLAGS */
{
const char *schedulestr
- = apr_hash_get(atts, ENTRIES_ATTR_SCHEDULE, APR_HASH_KEY_STRING);
+ = svn_hash_gets(atts, ENTRIES_ATTR_SCHEDULE);
entry->schedule = svn_wc_schedule_normal;
if (schedulestr)
@@ -894,8 +895,7 @@ atts_to_entry(svn_wc_entry_t **new_entry
{
const char *revstr;
- revstr = apr_hash_get(atts, ENTRIES_ATTR_COPYFROM_REV,
- APR_HASH_KEY_STRING);
+ revstr = svn_hash_gets(atts, ENTRIES_ATTR_COPYFROM_REV);
if (revstr)
entry->copyfrom_rev = SVN_STR_TO_REV(revstr);
}
@@ -921,8 +921,7 @@ atts_to_entry(svn_wc_entry_t **new_entry
{
const char *text_timestr;
- text_timestr = apr_hash_get(atts, ENTRIES_ATTR_TEXT_TIME,
- APR_HASH_KEY_STRING);
+ text_timestr = svn_hash_gets(atts, ENTRIES_ATTR_TEXT_TIME);
if (text_timestr)
SVN_ERR(svn_time_from_cstring(&entry->text_time, text_timestr, pool));
@@ -945,8 +944,7 @@ atts_to_entry(svn_wc_entry_t **new_entry
{
const char *cmt_datestr, *cmt_revstr;
- cmt_datestr = apr_hash_get(atts, ENTRIES_ATTR_CMT_DATE,
- APR_HASH_KEY_STRING);
+ cmt_datestr = svn_hash_gets(atts, ENTRIES_ATTR_CMT_DATE);
if (cmt_datestr)
{
SVN_ERR(svn_time_from_cstring(&entry->cmt_date, cmt_datestr, pool));
@@ -954,7 +952,7 @@ atts_to_entry(svn_wc_entry_t **new_entry
else
entry->cmt_date = 0;
- cmt_revstr = apr_hash_get(atts, ENTRIES_ATTR_CMT_REV, APR_HASH_KEY_STRING);
+ cmt_revstr = svn_hash_gets(atts, ENTRIES_ATTR_CMT_REV);
if (cmt_revstr)
{
entry->cmt_rev = SVN_STR_TO_REV(cmt_revstr);
@@ -971,7 +969,7 @@ atts_to_entry(svn_wc_entry_t **new_entry
entry->lock_comment = extract_string(atts, ENTRIES_ATTR_LOCK_COMMENT, pool);
{
const char *cdate_str =
- apr_hash_get(atts, ENTRIES_ATTR_LOCK_CREATION_DATE, APR_HASH_KEY_STRING);
+ svn_hash_gets(atts, ENTRIES_ATTR_LOCK_CREATION_DATE);
if (cdate_str)
{
SVN_ERR(svn_time_from_cstring(&entry->lock_creation_date,
@@ -987,8 +985,7 @@ atts_to_entry(svn_wc_entry_t **new_entry
/* Translated size */
/* ### not used by loggy; no need to set MODIFY_FLAGS */
{
- const char *val = apr_hash_get(atts, ENTRIES_ATTR_WORKING_SIZE,
- APR_HASH_KEY_STRING);
+ const char *val = svn_hash_gets(atts, ENTRIES_ATTR_WORKING_SIZE);
if (val)
{
/* Cast to off_t; it's safe: we put in an off_t to start with... */
@@ -1045,7 +1042,7 @@ handle_start_tag(void *userData, const c
/* Find the name and set up the entry under that name. This
should *NOT* be NULL, since svn_wc__atts_to_entry() should
have made it into SVN_WC_ENTRY_THIS_DIR. */
- apr_hash_set(accum->entries, entry->name, APR_HASH_KEY_STRING, entry);
+ svn_hash_sets(accum->entries, entry->name, entry);
}
/* Parse BUF of size SIZE as an entries file in XML format, storing the parsed
@@ -1131,7 +1128,7 @@ resolve_to_defaults(apr_hash_t *entries,
{
apr_hash_index_t *hi;
svn_wc_entry_t *default_entry
- = apr_hash_get(entries, SVN_WC_ENTRY_THIS_DIR, APR_HASH_KEY_STRING);
+ = svn_hash_gets(entries, SVN_WC_ENTRY_THIS_DIR);
/* First check the dir's own entry for consistency. */
if (! default_entry)
@@ -1259,7 +1256,7 @@ svn_wc__read_entries_old(apr_hash_t **en
++curp;
++entryno;
- apr_hash_set(*entries, entry->name, APR_HASH_KEY_STRING, entry);
+ svn_hash_sets(*entries, entry->name, entry);
}
}
@@ -1328,7 +1325,7 @@ svn_wc_entry(const svn_wc_entry_t **entr
fetch all entries here (optimization) since we know how to filter
out a "hidden" node. */
SVN_ERR(svn_wc__entries_read_internal(&entries, dir_access, TRUE, pool));
- *entry = apr_hash_get(entries, entry_name, APR_HASH_KEY_STRING);
+ *entry = svn_hash_gets(entries, entry_name);
if (!show_hidden && *entry != NULL)
{
Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=1460158&r1=1460157&r2=1460158&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Sat Mar 23 14:09:02 2013
@@ -1142,13 +1142,13 @@ svn_wc__merge_props(svn_skel_t **conflic
= &APR_ARRAY_IDX(propchanges, i, svn_prop_t);
const char *propname = incoming_change->name;
const svn_string_t *base_val /* Pristine in WC */
- = apr_hash_get(pristine_props, propname, APR_HASH_KEY_STRING);
+ = svn_hash_gets(pristine_props, propname);
const svn_string_t *from_val /* Merge left */
- = apr_hash_get(server_baseprops, propname, APR_HASH_KEY_STRING);
+ = svn_hash_gets(server_baseprops, propname);
const svn_string_t *to_val /* Merge right */
= incoming_change->value;
const svn_string_t *working_val /* Mine */
- = apr_hash_get(actual_props, propname, APR_HASH_KEY_STRING);
+ = svn_hash_gets(actual_props, propname);
const svn_string_t *result_val;
svn_boolean_t conflict_remains;
svn_boolean_t did_merge = FALSE;
@@ -1157,7 +1157,7 @@ svn_wc__merge_props(svn_skel_t **conflic
to_val = to_val ? svn_string_dup(to_val, result_pool) : NULL;
- apr_hash_set(their_props, propname, APR_HASH_KEY_STRING, to_val);
+ svn_hash_sets(their_props, propname, to_val);
/* We already know that state is at least `changed', so mark
@@ -1185,8 +1185,7 @@ svn_wc__merge_props(svn_skel_t **conflic
result_pool, iterpool));
if (result_val != working_val)
- apr_hash_set(*new_actual_props, propname, APR_HASH_KEY_STRING,
- result_val);
+ svn_hash_sets(*new_actual_props, propname, result_val);
if (did_merge)
set_prop_merge_state(state, svn_wc_notify_state_merged);
@@ -1200,7 +1199,7 @@ svn_wc__merge_props(svn_skel_t **conflic
if (!conflict_props)
conflict_props = apr_hash_make(scratch_pool);
- apr_hash_set(conflict_props, propname, APR_HASH_KEY_STRING, "");
+ svn_hash_sets(conflict_props, propname, "");
}
} /* foreach propchange ... */
@@ -1256,7 +1255,7 @@ wcprop_set(svn_wc__db_t *db,
if (prophash == NULL)
prophash = apr_hash_make(scratch_pool);
- apr_hash_set(prophash, name, APR_HASH_KEY_STRING, value);
+ svn_hash_sets(prophash, name, value);
return svn_error_trace(svn_wc__db_base_set_dav_cache(db, local_abspath,
prophash,
scratch_pool));
@@ -1308,13 +1307,12 @@ propname_filter_receiver(void *baton,
apr_pool_t *scratch_pool)
{
struct propname_filter_baton_t *pfb = baton;
- const svn_string_t *propval = apr_hash_get(props, pfb->propname,
- APR_HASH_KEY_STRING);
+ const svn_string_t *propval = svn_hash_gets(props, pfb->propname);
if (propval)
{
props = apr_hash_make(scratch_pool);
- apr_hash_set(props, pfb->propname, APR_HASH_KEY_STRING, propval);
+ svn_hash_sets(props, pfb->propname, propval);
SVN_ERR(pfb->receiver_func(pfb->receiver_baton, local_abspath, props,
scratch_pool));
@@ -1510,7 +1508,7 @@ svn_wc__internal_propget(const svn_strin
}
if (prophash)
- *value = apr_hash_get(prophash, name, APR_HASH_KEY_STRING);
+ *value = svn_hash_gets(prophash, name);
else
*value = NULL;
@@ -1684,8 +1682,7 @@ do_propset(svn_wc__db_t *db,
const svn_string_t *new_value;
struct getter_baton gb;
- gb.mime_type = apr_hash_get(prophash,
- SVN_PROP_MIME_TYPE, APR_HASH_KEY_STRING);
+ gb.mime_type = svn_hash_gets(prophash, SVN_PROP_MIME_TYPE);
gb.local_abspath = local_abspath;
SVN_ERR(svn_wc_canonicalize_svn_prop(&new_value, name, value,
@@ -1714,8 +1711,7 @@ do_propset(svn_wc__db_t *db,
*/
if (kind == svn_node_file && strcmp(name, SVN_PROP_KEYWORDS) == 0)
{
- svn_string_t *old_value = apr_hash_get(prophash, SVN_PROP_KEYWORDS,
- APR_HASH_KEY_STRING);
+ svn_string_t *old_value = svn_hash_gets(prophash, SVN_PROP_KEYWORDS);
apr_hash_t *old_keywords, *new_keywords;
if (old_value)
@@ -1755,8 +1751,7 @@ do_propset(svn_wc__db_t *db,
}
else if (kind == svn_node_file && strcmp(name, SVN_PROP_EOL_STYLE) == 0)
{
- svn_string_t *old_value = apr_hash_get(prophash, SVN_PROP_EOL_STYLE,
- APR_HASH_KEY_STRING);
+ svn_string_t *old_value = svn_hash_gets(prophash, SVN_PROP_EOL_STYLE);
if (((value == NULL) != (old_value == NULL))
|| (value && ! svn_string_compare(value, old_value)))
@@ -1767,7 +1762,7 @@ do_propset(svn_wc__db_t *db,
/* Find out what type of property change we are doing: add, modify, or
delete. */
- if (apr_hash_get(prophash, name, APR_HASH_KEY_STRING) == NULL)
+ if (svn_hash_gets(prophash, name) == NULL)
{
if (value == NULL)
/* Deleting a non-existent property. */
@@ -1788,7 +1783,7 @@ do_propset(svn_wc__db_t *db,
/* Now we have all the properties in our hash. Simply merge the new
property into it. */
- apr_hash_set(prophash, name, APR_HASH_KEY_STRING, value);
+ svn_hash_sets(prophash, name, value);
/* Drop it right into the db.. */
SVN_ERR(svn_wc__db_op_set_props(db, local_abspath, prophash,
@@ -2004,16 +1999,14 @@ svn_wc__canonicalize_props(apr_hash_t **
/* Before we can canonicalize svn:eol-style we need to know svn:mime-type,
* so process that first. */
- mime_type = apr_hash_get((apr_hash_t *)props,
- SVN_PROP_MIME_TYPE, APR_HASH_KEY_STRING);
+ mime_type = svn_hash_gets((apr_hash_t *)props, SVN_PROP_MIME_TYPE);
if (mime_type)
{
SVN_ERR(svn_wc_canonicalize_svn_prop(
&mime_type, SVN_PROP_MIME_TYPE, mime_type,
local_abspath, node_kind, skip_some_checks,
NULL, NULL, scratch_pool));
- apr_hash_set(*prepared_props, SVN_PROP_MIME_TYPE, APR_HASH_KEY_STRING,
- mime_type);
+ svn_hash_sets(*prepared_props, SVN_PROP_MIME_TYPE, mime_type);
}
/* Set up the context for canonicalizing the other properties. */
@@ -2035,7 +2028,7 @@ svn_wc__canonicalize_props(apr_hash_t **
&value, name, value,
local_abspath, node_kind, skip_some_checks,
get_file_for_validation, &gb, scratch_pool));
- apr_hash_set(*prepared_props, name, APR_HASH_KEY_STRING, value);
+ svn_hash_sets(*prepared_props, name, value);
}
return SVN_NO_ERROR;
Modified: subversion/trunk/subversion/libsvn_wc/revert.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/revert.c?rev=1460158&r1=1460157&r2=1460158&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/revert.c (original)
+++ subversion/trunk/subversion/libsvn_wc/revert.c Sat Mar 23 14:09:02 2013
@@ -445,8 +445,7 @@ revert_restore(svn_wc__db_t *db,
scratch_pool, scratch_pool));
#ifdef HAVE_SYMLINK
- special_prop = apr_hash_get(props, SVN_PROP_SPECIAL,
- APR_HASH_KEY_STRING);
+ special_prop = svn_hash_gets(props, SVN_PROP_SPECIAL);
if ((special_prop != NULL) != special)
{
@@ -499,8 +498,8 @@ revert_restore(svn_wc__db_t *db,
SVN_ERR(svn_io__is_finfo_read_only(&read_only, &finfo,
scratch_pool));
- needs_lock_prop = apr_hash_get(props, SVN_PROP_NEEDS_LOCK,
- APR_HASH_KEY_STRING);
+ needs_lock_prop = svn_hash_gets(props,
+ SVN_PROP_NEEDS_LOCK);
if (needs_lock_prop && !read_only)
{
SVN_ERR(svn_io_set_file_read_only(local_abspath,
@@ -527,8 +526,8 @@ revert_restore(svn_wc__db_t *db,
SVN_ERR(svn_io__is_finfo_executable(&executable, &finfo,
scratch_pool));
- executable_prop = apr_hash_get(props, SVN_PROP_EXECUTABLE,
- APR_HASH_KEY_STRING);
+ executable_prop = svn_hash_gets(props,
+ SVN_PROP_EXECUTABLE);
if (executable_prop && !executable)
{
SVN_ERR(svn_io_set_file_executable(local_abspath,
Modified: subversion/trunk/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/status.c?rev=1460158&r1=1460157&r2=1460158&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/status.c (original)
+++ subversion/trunk/subversion/libsvn_wc/status.c Sat Mar 23 14:09:02 2013
@@ -373,8 +373,7 @@ read_info(const struct svn_wc__db_info_t
SVN_ERR(svn_wc__db_read_pristine_props(&properties, db, local_abspath,
scratch_pool, scratch_pool));
- mtb->special = (NULL != apr_hash_get(properties, SVN_PROP_SPECIAL,
- APR_HASH_KEY_STRING));
+ mtb->special = (NULL != svn_hash_gets(properties, SVN_PROP_SPECIAL));
}
#endif
*info = mtb;
@@ -915,10 +914,9 @@ send_status_structure(const struct walk_
{
/* repos_lock still uses the deprecated filesystem absolute path
format */
- repos_lock = apr_hash_get(wb->repos_locks,
- svn_fspath__join("/", repos_relpath,
- scratch_pool),
- APR_HASH_KEY_STRING);
+ repos_lock = svn_hash_gets(wb->repos_locks,
+ svn_fspath__join("/", repos_relpath,
+ scratch_pool));
}
}
@@ -1037,7 +1035,7 @@ is_external_path(apr_hash_t *externals,
apr_hash_index_t *hi;
/* First try: does the path exist as a key in the hash? */
- if (apr_hash_get(externals, local_abspath, APR_HASH_KEY_STRING))
+ if (svn_hash_gets(externals, local_abspath))
return TRUE;
/* Failing that, we need to check if any external is a child of
@@ -1560,9 +1558,9 @@ hash_stash(void *baton,
{
apr_hash_t *stat_hash = baton;
apr_pool_t *hash_pool = apr_hash_pool_get(stat_hash);
- assert(! apr_hash_get(stat_hash, path, APR_HASH_KEY_STRING));
- apr_hash_set(stat_hash, apr_pstrdup(hash_pool, path),
- APR_HASH_KEY_STRING, svn_wc_dup_status3(status, hash_pool));
+ assert(! svn_hash_gets(stat_hash, path));
+ svn_hash_sets(stat_hash, apr_pstrdup(hash_pool, path),
+ svn_wc_dup_status3(status, hash_pool));
return SVN_NO_ERROR;
}
@@ -1621,7 +1619,7 @@ tweak_statushash(void *baton,
pool = apr_hash_pool_get(statushash);
/* Is PATH already a hash-key? */
- statstruct = apr_hash_get(statushash, local_abspath, APR_HASH_KEY_STRING);
+ statstruct = svn_hash_gets(statushash, local_abspath);
/* If not, make it so. */
if (! statstruct)
@@ -1644,8 +1642,7 @@ tweak_statushash(void *baton,
SVN_ERR(internal_status(&statstruct, db, local_abspath, pool,
scratch_pool));
statstruct->repos_lock = repos_lock;
- apr_hash_set(statushash, apr_pstrdup(pool, local_abspath),
- APR_HASH_KEY_STRING, statstruct);
+ svn_hash_sets(statushash, apr_pstrdup(pool, local_abspath), statstruct);
}
/* Merge a repos "delete" + "add" into a single "replace". */
@@ -1747,9 +1744,8 @@ find_dir_repos_relpath(const struct dir_
{
const char *repos_relpath;
struct dir_baton *pb = db->parent_baton;
- const svn_wc_status3_t *status = apr_hash_get(pb->statii,
- db->local_abspath,
- APR_HASH_KEY_STRING);
+ const svn_wc_status3_t *status = svn_hash_gets(pb->statii,
+ db->local_abspath);
/* Note that status->repos_relpath could be NULL in the case of a missing
* directory, which means we need to recurse up another level to get
* a useful relpath. */
@@ -1829,8 +1825,7 @@ make_dir_baton(void **dir_baton,
/* Get the status for this path's children. Of course, we only want
to do this if the path is versioned as a directory. */
if (pb)
- status_in_parent = apr_hash_get(pb->statii, d->local_abspath,
- APR_HASH_KEY_STRING);
+ status_in_parent = svn_hash_gets(pb->statii, d->local_abspath);
else
status_in_parent = eb->anchor_status;
@@ -1862,8 +1857,7 @@ make_dir_baton(void **dir_baton,
dir_pool));
/* If we found a depth here, it should govern. */
- this_dir_status = apr_hash_get(d->statii, d->local_abspath,
- APR_HASH_KEY_STRING);
+ this_dir_status = svn_hash_gets(d->statii, d->local_abspath);
if (this_dir_status && this_dir_status->versioned
&& (d->depth == svn_depth_unknown
|| d->depth > status_in_parent->depth))
@@ -2266,8 +2260,7 @@ close_directory(void *dir_baton,
const svn_wc_status3_t *dir_status;
/* See if the directory was deleted or replaced. */
- dir_status = apr_hash_get(pb->statii, db->local_abspath,
- APR_HASH_KEY_STRING);
+ dir_status = svn_hash_gets(pb->statii, db->local_abspath);
if (dir_status &&
((dir_status->repos_node_status == svn_wc_status_deleted)
|| (dir_status->repos_node_status == svn_wc_status_replaced)))
@@ -2283,7 +2276,7 @@ close_directory(void *dir_baton,
eb->get_all))
SVN_ERR((eb->status_func)(eb->status_baton, db->local_abspath,
dir_status, scratch_pool));
- apr_hash_set(pb->statii, db->local_abspath, APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(pb->statii, db->local_abspath, NULL);
}
else if (! pb)
{
@@ -2293,8 +2286,7 @@ close_directory(void *dir_baton,
{
const svn_wc_status3_t *tgt_status;
- tgt_status = apr_hash_get(db->statii, eb->target_abspath,
- APR_HASH_KEY_STRING);
+ tgt_status = svn_hash_gets(db->statii, eb->target_abspath);
if (tgt_status)
{
if (tgt_status->versioned
@@ -2469,10 +2461,9 @@ close_file(void *file_baton,
const char *repos_relpath = svn_relpath_join(dir_repos_relpath,
fb->name, pool);
- repos_lock = apr_hash_get(fb->edit_baton->wb.repos_locks,
- svn_fspath__join("/", repos_relpath,
- pool),
- APR_HASH_KEY_STRING);
+ repos_lock = svn_hash_gets(fb->edit_baton->wb.repos_locks,
+ svn_fspath__join("/", repos_relpath,
+ pool));
}
}
else
@@ -2847,9 +2838,9 @@ svn_wc_get_default_ignores(apr_array_hea
apr_hash_t *config,
apr_pool_t *pool)
{
- svn_config_t *cfg = config ? apr_hash_get(config,
- SVN_CONFIG_CATEGORY_CONFIG,
- APR_HASH_KEY_STRING) : NULL;
+ svn_config_t *cfg = config
+ ? svn_hash_gets(config, SVN_CONFIG_CATEGORY_CONFIG)
+ : NULL;
const char *val;
/* Check the Subversion run-time configuration for global ignores.
Modified: subversion/trunk/subversion/libsvn_wc/translate.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/translate.c?rev=1460158&r1=1460157&r2=1460158&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/translate.c (original)
+++ subversion/trunk/subversion/libsvn_wc/translate.c Sat Mar 23 14:09:02 2013
@@ -33,6 +33,7 @@
#include "svn_types.h"
#include "svn_string.h"
#include "svn_dirent_uri.h"
+#include "svn_hash.h"
#include "svn_path.h"
#include "svn_error.h"
#include "svn_subst.h"
@@ -407,7 +408,7 @@ svn_wc__sync_flags_with_props(svn_boolea
/* Handle the read-write bit. */
if (status != svn_wc__db_status_normal
|| props == NULL
- || ! apr_hash_get(props, SVN_PROP_NEEDS_LOCK, APR_HASH_KEY_STRING)
+ || ! svn_hash_gets(props, SVN_PROP_NEEDS_LOCK)
|| lock)
{
SVN_ERR(svn_io_set_file_read_write(local_abspath, FALSE, scratch_pool));
@@ -427,8 +428,7 @@ svn_wc__sync_flags_with_props(svn_boolea
pristine_props = NULL;
if (pristine_props
- && apr_hash_get(pristine_props,
- SVN_PROP_NEEDS_LOCK, APR_HASH_KEY_STRING) )
+ && svn_hash_gets(pristine_props, SVN_PROP_NEEDS_LOCK) )
/*&& props
&& apr_hash_get(props, SVN_PROP_NEEDS_LOCK, APR_HASH_KEY_STRING) )*/
SVN_ERR(svn_io_set_file_read_only(local_abspath, FALSE, scratch_pool));
@@ -438,7 +438,7 @@ svn_wc__sync_flags_with_props(svn_boolea
#ifndef WIN32
if (props == NULL
- || ! apr_hash_get(props, SVN_PROP_EXECUTABLE, APR_HASH_KEY_STRING))
+ || ! svn_hash_gets(props, SVN_PROP_EXECUTABLE))
{
/* Turn off the execute bit */
SVN_ERR(svn_io_set_file_executable(local_abspath, FALSE, FALSE,
Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1460158&r1=1460157&r2=1460158&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Sat Mar 23 14:09:02 2013
@@ -275,11 +275,11 @@ remember_skipped_tree(struct edit_baton
{
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
- apr_hash_set(eb->skipped_trees,
- apr_pstrdup(eb->pool,
- svn_dirent_skip_ancestor(eb->wcroot_abspath,
- local_abspath)),
- APR_HASH_KEY_STRING, (void*)1);
+ svn_hash_sets(eb->skipped_trees,
+ apr_pstrdup(eb->pool,
+ svn_dirent_skip_ancestor(eb->wcroot_abspath,
+ local_abspath)),
+ (void *)1);
return SVN_NO_ERROR;
}
@@ -1834,8 +1834,8 @@ delete_entry(const char *path,
if (!pb->deletion_conflicts)
pb->deletion_conflicts = apr_hash_make(pb->pool);
- apr_hash_set(pb->deletion_conflicts, apr_pstrdup(pb->pool, base),
- APR_HASH_KEY_STRING, tree_conflict);
+ svn_hash_sets(pb->deletion_conflicts, apr_pstrdup(pb->pool, base),
+ tree_conflict);
SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, NULL, NULL,
eb->db, local_abspath,
@@ -2081,8 +2081,7 @@ add_directory(const char *path,
if (conflicted)
{
if (pb->deletion_conflicts)
- tree_conflict = apr_hash_get(pb->deletion_conflicts, db->name,
- APR_HASH_KEY_STRING);
+ tree_conflict = svn_hash_gets(pb->deletion_conflicts, db->name);
if (tree_conflict)
{
@@ -2554,8 +2553,7 @@ close_directory(void *dir_baton,
{
const svn_prop_t *prop;
prop = &APR_ARRAY_IDX(regular_prop_changes, i, svn_prop_t);
- apr_hash_set(props_to_delete, prop->name,
- APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(props_to_delete, prop->name, NULL);
}
/* Add these props to the incoming propchanges (in
@@ -2590,8 +2588,7 @@ close_directory(void *dir_baton,
const svn_string_t *new_val_s = change->value;
const svn_string_t *old_val_s;
- old_val_s = apr_hash_get(base_props, SVN_PROP_EXTERNALS,
- APR_HASH_KEY_STRING);
+ old_val_s = svn_hash_gets(base_props, SVN_PROP_EXTERNALS);
if ((new_val_s == NULL) && (old_val_s == NULL))
; /* No value before, no value after... so do nothing. */
@@ -2648,8 +2645,7 @@ close_directory(void *dir_baton,
/* Check if we should add some not-present markers before marking the
directory complete (Issue #3569) */
{
- apr_hash_t *new_children = apr_hash_get(eb->dir_dirents, db->new_relpath,
- APR_HASH_KEY_STRING);
+ apr_hash_t *new_children = svn_hash_gets(eb->dir_dirents, db->new_relpath);
if (new_children != NULL)
{
@@ -2835,8 +2831,7 @@ close_directory(void *dir_baton,
/* Any inherited props to be set set for this base node? */
if (eb->wcroot_iprops)
{
- iprops = apr_hash_get(eb->wcroot_iprops, db->local_abspath,
- APR_HASH_KEY_STRING);
+ iprops = svn_hash_gets(eb->wcroot_iprops, db->local_abspath);
/* close_edit may also update iprops for switched nodes, catching
those for which close_directory is never called (e.g. a switch
@@ -2844,8 +2839,7 @@ close_directory(void *dir_baton,
iprops from the hash so as not to set them again in
close_edit. */
if (iprops)
- apr_hash_set(eb->wcroot_iprops, db->local_abspath,
- APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(eb->wcroot_iprops, db->local_abspath, NULL);
}
/* Update the BASE data for the directory and mark the directory
@@ -3120,8 +3114,8 @@ add_file(const char *path,
The only thing we can do is add a not-present node, to allow
a future update to bring in the new files when the problem is
resolved. */
- apr_hash_set(pb->not_present_files, apr_pstrdup(pb->pool, fb->name),
- APR_HASH_KEY_STRING, (void*)1);
+ svn_hash_sets(pb->not_present_files, apr_pstrdup(pb->pool, fb->name),
+ (void *)1);
SVN_ERR(remember_skipped_tree(eb, fb->local_abspath, pool));
fb->skip_this = TRUE;
@@ -3171,8 +3165,7 @@ add_file(const char *path,
else if (conflicted)
{
if (pb->deletion_conflicts)
- tree_conflict = apr_hash_get(pb->deletion_conflicts, fb->name,
- APR_HASH_KEY_STRING);
+ tree_conflict = svn_hash_gets(pb->deletion_conflicts, fb->name);
if (tree_conflict)
{
@@ -3229,8 +3222,8 @@ add_file(const char *path,
Note that we can safely assume that no present base node exists,
because then we would not have received an add_file.
*/
- apr_hash_set(pb->not_present_files, apr_pstrdup(pb->pool, fb->name),
- APR_HASH_KEY_STRING, (void*)1);
+ svn_hash_sets(pb->not_present_files, apr_pstrdup(pb->pool, fb->name),
+ (void *)1);
do_notification(eb, fb->local_abspath, svn_node_unknown,
svn_wc_notify_skip_conflicted, scratch_pool);
@@ -3330,8 +3323,8 @@ add_file(const char *path,
|| *eb->target_basename == '\0'
|| (strcmp(fb->local_abspath, eb->target_abspath) != 0))
{
- apr_hash_set(pb->not_present_files, apr_pstrdup(pb->pool, fb->name),
- APR_HASH_KEY_STRING, (void*)1);
+ svn_hash_sets(pb->not_present_files, apr_pstrdup(pb->pool, fb->name),
+ (void *)1);
}
if (tree_conflict != NULL)
@@ -3677,8 +3670,7 @@ change_file_prop(void *file_baton,
scratch_pool, scratch_pool));
was_symlink = ((props
- && apr_hash_get(props, SVN_PROP_SPECIAL,
- APR_HASH_KEY_STRING) != NULL)
+ && svn_hash_gets(props, SVN_PROP_SPECIAL) != NULL)
? svn_tristate_true
: svn_tristate_false);
}
@@ -4440,8 +4432,7 @@ close_file(void *file_baton,
/* Any inherited props to be set set for this base node? */
if (eb->wcroot_iprops)
{
- iprops = apr_hash_get(eb->wcroot_iprops, fb->local_abspath,
- APR_HASH_KEY_STRING);
+ iprops = svn_hash_gets(eb->wcroot_iprops, fb->local_abspath);
/* close_edit may also update iprops for switched nodes, catching
those for which close_directory is never called (e.g. a switch
@@ -4449,8 +4440,7 @@ close_file(void *file_baton,
iprops from the hash so as not to set them again in
close_edit. */
if (iprops)
- apr_hash_set(eb->wcroot_iprops, fb->local_abspath,
- APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(eb->wcroot_iprops, fb->local_abspath, NULL);
}
SVN_ERR(svn_wc__db_base_add_file(eb->db, fb->local_abspath,
@@ -4490,8 +4480,7 @@ close_file(void *file_baton,
/* Deal with the WORKING tree, based on updates to the BASE tree. */
- apr_hash_set(fb->dir_baton->not_present_files, fb->name,
- APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(fb->dir_baton->not_present_files, fb->name, NULL);
/* Send a notification to the callback function. (Skip notifications
about files which were already notified for another reason.) */
@@ -4838,10 +4827,9 @@ make_editor(svn_revnum_t *target_revisio
edit_pool, scratch_pool));
if (dirents != NULL && apr_hash_count(dirents))
- apr_hash_set(eb->dir_dirents,
- apr_pstrdup(edit_pool, dir_repos_relpath),
- APR_HASH_KEY_STRING,
- dirents);
+ svn_hash_sets(eb->dir_dirents,
+ apr_pstrdup(edit_pool, dir_repos_relpath),
+ dirents);
}
if (depth == svn_depth_immediates)
@@ -4895,10 +4883,10 @@ make_editor(svn_revnum_t *target_revisio
edit_pool, iterpool));
if (dirents != NULL && apr_hash_count(dirents))
- apr_hash_set(eb->dir_dirents,
- apr_pstrdup(edit_pool, dir_repos_relpath),
- APR_HASH_KEY_STRING,
- dirents);
+ svn_hash_sets(eb->dir_dirents,
+ apr_pstrdup(edit_pool,
+ dir_repos_relpath),
+ dirents);
}
}
}
Modified: subversion/trunk/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/upgrade.c?rev=1460158&r1=1460157&r2=1460158&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/trunk/subversion/libsvn_wc/upgrade.c Sat Mar 23 14:09:02 2013
@@ -151,7 +151,7 @@ read_one_proplist(apr_hash_t *all_wcprop
proplist = apr_hash_make(result_pool);
SVN_ERR(svn_hash_read2(proplist, stream, SVN_HASH_TERMINATOR, result_pool));
- apr_hash_set(all_wcprops, name, APR_HASH_KEY_STRING, proplist);
+ svn_hash_sets(all_wcprops, name, proplist);
return SVN_NO_ERROR;
}
@@ -180,8 +180,7 @@ read_many_wcprops(apr_hash_t **all_wcpro
scratch_pool);
SVN_ERR(read_propfile(&wcprops, propfile_abspath, result_pool, iterpool));
if (wcprops != NULL)
- apr_hash_set(*all_wcprops, SVN_WC_ENTRY_THIS_DIR, APR_HASH_KEY_STRING,
- wcprops);
+ svn_hash_sets(*all_wcprops, SVN_WC_ENTRY_THIS_DIR, wcprops);
props_dir_abspath = svn_wc__adm_child(dir_abspath, WCPROPS_SUBDIR_FOR_FILES,
scratch_pool);
@@ -203,9 +202,7 @@ read_many_wcprops(apr_hash_t **all_wcpro
SVN_ERR(read_propfile(&wcprops, propfile_abspath,
result_pool, iterpool));
SVN_ERR_ASSERT(wcprops != NULL);
- apr_hash_set(*all_wcprops,
- apr_pstrdup(result_pool, name), APR_HASH_KEY_STRING,
- wcprops);
+ svn_hash_sets(*all_wcprops, apr_pstrdup(result_pool, name), wcprops);
}
svn_pool_destroy(iterpool);
@@ -701,9 +698,9 @@ read_tree_conflicts(apr_hash_t **conflic
SVN_ERR(svn_wc__deserialize_conflict(&conflict, skel, dir_path,
pool, iterpool));
if (conflict != NULL)
- apr_hash_set(*conflicts, svn_dirent_basename(conflict->local_abspath,
- pool),
- APR_HASH_KEY_STRING, conflict);
+ svn_hash_sets(*conflicts,
+ svn_dirent_basename(conflict->local_abspath, pool),
+ conflict);
}
svn_pool_destroy(iterpool);
@@ -1121,16 +1118,14 @@ migrate_text_bases(apr_hash_t **text_bas
/* Create a new info struct for this versioned file, or fill in the
* existing one if this is the second text-base we've found for it. */
- info = apr_hash_get(*text_bases_info, versioned_file_name,
- APR_HASH_KEY_STRING);
+ info = svn_hash_gets(*text_bases_info, versioned_file_name);
if (info == NULL)
info = apr_pcalloc(result_pool, sizeof (*info));
file_info = (is_revert_base ? &info->revert_base : &info->normal_base);
file_info->sha1_checksum = svn_checksum_dup(sha1_checksum, result_pool);
file_info->md5_checksum = svn_checksum_dup(md5_checksum, result_pool);
- apr_hash_set(*text_bases_info, versioned_file_name, APR_HASH_KEY_STRING,
- info);
+ svn_hash_sets(*text_bases_info, versioned_file_name, info);
}
}
@@ -1710,21 +1705,20 @@ upgrade_to_wcng(void **dir_baton,
SVN_ERR(svn_wc__read_entries_old(&entries, dir_abspath,
scratch_pool, scratch_pool));
- this_dir = apr_hash_get(entries, SVN_WC_ENTRY_THIS_DIR, APR_HASH_KEY_STRING);
+ this_dir = svn_hash_gets(entries, SVN_WC_ENTRY_THIS_DIR);
SVN_ERR(ensure_repos_info(this_dir, dir_abspath,
repos_info_func, repos_info_baton,
repos_cache,
scratch_pool, scratch_pool));
/* Cache repos UUID pairs for when a subdir doesn't have this information */
- if (!apr_hash_get(repos_cache, this_dir->repos, APR_HASH_KEY_STRING))
+ if (!svn_hash_gets(repos_cache, this_dir->repos))
{
apr_pool_t *hash_pool = apr_hash_pool_get(repos_cache);
- apr_hash_set(repos_cache,
- apr_pstrdup(hash_pool, this_dir->repos),
- APR_HASH_KEY_STRING,
- apr_pstrdup(hash_pool, this_dir->uuid));
+ svn_hash_sets(repos_cache,
+ apr_pstrdup(hash_pool, this_dir->repos),
+ apr_pstrdup(hash_pool, this_dir->uuid));
}
old_wcroot_abspath = svn_dirent_get_longest_ancestor(dir_abspath,
@@ -2056,7 +2050,7 @@ is_old_wcroot(const char *local_abspath,
return SVN_NO_ERROR;
}
- entry = apr_hash_get(entries, name, APR_HASH_KEY_STRING);
+ entry = svn_hash_gets(entries, name);
if (!entry
|| entry->absent
|| (entry->deleted && entry->schedule != svn_wc_schedule_add)
@@ -2076,7 +2070,7 @@ is_old_wcroot(const char *local_abspath,
parent_abspath = svn_dirent_join(parent_abspath, name, scratch_pool);
break;
}
- entry = apr_hash_get(entries, name, APR_HASH_KEY_STRING);
+ entry = svn_hash_gets(entries, name);
if (!entry
|| entry->absent
|| (entry->deleted && entry->schedule != svn_wc_schedule_add)
@@ -2196,18 +2190,16 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx,
SVN_ERR(svn_wc__read_entries_old(&entries, local_abspath,
scratch_pool, scratch_pool));
- this_dir = apr_hash_get(entries, SVN_WC_ENTRY_THIS_DIR,
- APR_HASH_KEY_STRING);
+ this_dir = svn_hash_gets(entries, SVN_WC_ENTRY_THIS_DIR);
SVN_ERR(ensure_repos_info(this_dir, local_abspath, repos_info_func,
repos_info_baton, repos_cache,
scratch_pool, scratch_pool));
/* Cache repos UUID pairs for when a subdir doesn't have this information */
- if (!apr_hash_get(repos_cache, this_dir->repos, APR_HASH_KEY_STRING))
- apr_hash_set(repos_cache,
- apr_pstrdup(scratch_pool, this_dir->repos),
- APR_HASH_KEY_STRING,
- apr_pstrdup(scratch_pool, this_dir->uuid));
+ if (!svn_hash_gets(repos_cache, this_dir->repos))
+ svn_hash_sets(repos_cache,
+ apr_pstrdup(scratch_pool, this_dir->repos),
+ apr_pstrdup(scratch_pool, this_dir->uuid));
/* Create the new DB in the temporary root wc/.svn/tmp/wcng/.svn */
data.root_abspath = svn_dirent_join(svn_wc__adm_child(local_abspath, "tmp",
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1460158&r1=1460157&r2=1460158&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Sat Mar 23 14:09:02 2013
@@ -888,8 +888,8 @@ insert_incomplete_children(svn_sqlite__d
iterpool)));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
if (have_row && !svn_sqlite__column_is_null(stmt, 14))
- apr_hash_set(moved_to_relpaths, name, APR_HASH_KEY_STRING,
- svn_sqlite__column_text(stmt, 14, scratch_pool));
+ svn_hash_sets(moved_to_relpaths, name,
+ svn_sqlite__column_text(stmt, 14, scratch_pool));
SVN_ERR(svn_sqlite__reset(stmt));
}
@@ -913,8 +913,7 @@ insert_incomplete_children(svn_sqlite__d
"incomplete", /* 8, presence */
"unknown", /* 10, kind */
/* 21, moved_to */
- apr_hash_get(moved_to_relpaths, name,
- APR_HASH_KEY_STRING)));
+ svn_hash_gets(moved_to_relpaths, name)));
if (repos_id != INVALID_REPOS_ID)
{
SVN_ERR(svn_sqlite__bind_int64(stmt, 5, repos_id));
@@ -1107,7 +1106,7 @@ add_children_to_hash(apr_hash_t *childre
const char *child_relpath = svn_sqlite__column_text(stmt, 0, NULL);
const char *name = svn_relpath_basename(child_relpath, result_pool);
- apr_hash_set(children, name, APR_HASH_KEY_STRING, name);
+ svn_hash_sets(children, name, name);
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
@@ -1227,9 +1226,9 @@ svn_wc__db_get_children_op_depth(apr_has
svn_node_kind_t *child_kind = apr_palloc(result_pool, sizeof(svn_node_kind_t));
*child_kind = svn_sqlite__column_token(stmt, 1, kind_map);
- apr_hash_set(*children,
- svn_relpath_basename(child_relpath, result_pool),
- APR_HASH_KEY_STRING, child_kind);
+ svn_hash_sets(*children,
+ svn_relpath_basename(child_relpath, result_pool),
+ child_kind);
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
@@ -1260,7 +1259,7 @@ remove_from_access_cache(apr_hash_t *acc
{
svn_wc_adm_access_t *adm_access;
- adm_access = apr_hash_get(access_cache, local_abspath, APR_HASH_KEY_STRING);
+ adm_access = svn_hash_gets(access_cache, local_abspath);
if (adm_access)
svn_wc__adm_access_set_entries(adm_access, NULL);
}
@@ -1534,7 +1533,7 @@ svn_wc__db_init(svn_wc__db_t *db,
db->state_pool, scratch_pool));
/* The WCROOT is complete. Stash it into DB. */
- apr_hash_set(db->dir_data, wcroot->abspath, APR_HASH_KEY_STRING, wcroot);
+ svn_hash_sets(db->dir_data, wcroot->abspath, wcroot);
return SVN_NO_ERROR;
}
@@ -2610,7 +2609,7 @@ svn_wc__db_base_get_children_info(apr_ha
svn_sqlite__reset(stmt)));
- apr_hash_set(*nodes, name, APR_HASH_KEY_STRING, info);
+ svn_hash_sets(*nodes, name, info);
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
@@ -3567,12 +3566,11 @@ svn_wc__db_externals_defined_below(apr_h
local_relpath = svn_sqlite__column_text(stmt, 0, NULL);
def_local_relpath = svn_sqlite__column_text(stmt, 1, NULL);
- apr_hash_set(*externals,
- svn_dirent_join(wcroot->abspath, local_relpath,
- result_pool),
- APR_HASH_KEY_STRING,
- svn_dirent_join(wcroot->abspath, def_local_relpath,
- result_pool));
+ svn_hash_sets(*externals,
+ svn_dirent_join(wcroot->abspath, local_relpath,
+ result_pool),
+ svn_dirent_join(wcroot->abspath, def_local_relpath,
+ result_pool));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
@@ -3634,8 +3632,8 @@ svn_wc__db_externals_gather_definitions(
node_abspath = svn_dirent_join(wcroot->abspath, node_relpath,
result_pool);
- apr_hash_set(*externals, node_abspath, APR_HASH_KEY_STRING,
- apr_pstrdup(result_pool, external_value));
+ svn_hash_sets(*externals, node_abspath,
+ apr_pstrdup(result_pool, external_value));
if (depths)
{
@@ -3643,10 +3641,9 @@ svn_wc__db_externals_gather_definitions(
= svn_sqlite__column_token_null(stmt, 2, depth_map,
svn_depth_unknown);
- apr_hash_set(*depths, node_abspath,
- APR_HASH_KEY_STRING,
- svn_token__to_word(depth_map,
- depth)); /* Use static string */
+ svn_hash_sets(*depths, node_abspath,
+ /* Use static string */
+ svn_token__to_word(depth_map, depth));
}
}
@@ -8511,7 +8508,7 @@ read_children_info(svn_wc__db_wcroot_t *
int op_depth;
svn_boolean_t new_child;
- child_item = apr_hash_get(nodes, name, APR_HASH_KEY_STRING);
+ child_item = svn_hash_gets(nodes, name);
if (child_item)
new_child = FALSE;
else
@@ -8628,8 +8625,7 @@ read_children_info(svn_wc__db_wcroot_t *
SVN_ERR(svn_error_compose_create(err, svn_sqlite__reset(stmt)));
child->special = (child->had_props
- && apr_hash_get(properties, SVN_PROP_SPECIAL,
- APR_HASH_KEY_STRING));
+ && svn_hash_gets(properties, SVN_PROP_SPECIAL));
}
#endif
if (op_depth == 0)
@@ -8637,8 +8633,7 @@ read_children_info(svn_wc__db_wcroot_t *
else
child->op_root = (op_depth == relpath_depth(child_relpath));
- apr_hash_set(nodes, apr_pstrdup(result_pool, name),
- APR_HASH_KEY_STRING, child);
+ svn_hash_sets(nodes, apr_pstrdup(result_pool, name), child);
}
if (op_depth == 0)
@@ -8691,7 +8686,7 @@ read_children_info(svn_wc__db_wcroot_t *
const char *child_relpath = svn_sqlite__column_text(stmt, 0, NULL);
const char *name = svn_relpath_basename(child_relpath, NULL);
- child_item = apr_hash_get(nodes, name, APR_HASH_KEY_STRING);
+ child_item = svn_hash_gets(nodes, name);
if (!child_item)
{
child_item = apr_pcalloc(result_pool, sizeof(*child_item));
@@ -8713,16 +8708,15 @@ read_children_info(svn_wc__db_wcroot_t *
scratch_pool, scratch_pool);
if (err)
SVN_ERR(svn_error_compose_create(err, svn_sqlite__reset(stmt)));
- child->special = (NULL != apr_hash_get(properties, SVN_PROP_SPECIAL,
- APR_HASH_KEY_STRING));
+ child->special = (NULL != svn_hash_gets(properties,
+ SVN_PROP_SPECIAL));
}
#endif
child->conflicted = !svn_sqlite__column_is_null(stmt, 3); /* conflict */
if (child->conflicted)
- apr_hash_set(conflicts, apr_pstrdup(result_pool, name),
- APR_HASH_KEY_STRING, "");
+ svn_hash_sets(conflicts, apr_pstrdup(result_pool, name), "");
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
@@ -8964,8 +8958,7 @@ svn_wc__db_read_children_walker_info(apr
SVN_ERR(svn_error_compose_create(err, svn_sqlite__reset(stmt)));
}
child->kind = svn_sqlite__column_token(stmt, 3, kind_map);
- apr_hash_set(*nodes, apr_pstrdup(result_pool, name),
- APR_HASH_KEY_STRING, child);
+ svn_hash_sets(*nodes, apr_pstrdup(result_pool, name), child);
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
@@ -9541,17 +9534,16 @@ svn_wc__db_prop_retrieve_recursive(apr_h
iterpool, iterpool));
value = (node_props
- ? apr_hash_get(node_props, propname, APR_HASH_KEY_STRING)
+ ? svn_hash_gets(node_props, propname)
: NULL);
if (value)
{
- apr_hash_set(*values,
- svn_dirent_join(wcroot->abspath,
- svn_sqlite__column_text(stmt, 1, NULL),
- result_pool),
- APR_HASH_KEY_STRING,
- svn_string_dup(value, result_pool));
+ svn_hash_sets(*values,
+ svn_dirent_join(wcroot->abspath,
+ svn_sqlite__column_text(stmt, 1, NULL),
+ result_pool),
+ svn_string_dup(value, result_pool));
}
SVN_ERR(svn_sqlite__step(&have_row, stmt));
@@ -9640,7 +9632,7 @@ filter_unwanted_props(apr_hash_t *prop_h
const char *ipropname = svn__apr_hash_index_key(hi);
if (strcmp(ipropname, propname) != 0)
- apr_hash_set(prop_hash, ipropname, APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(prop_hash, ipropname, NULL);
}
return;
}
@@ -9913,8 +9905,8 @@ get_children_with_cached_iprops(apr_hash
const char *abspath_with_cache = svn_dirent_join(wcroot->abspath,
relpath_with_cache,
result_pool);
- apr_hash_set(*iprop_paths, abspath_with_cache, APR_HASH_KEY_STRING,
- svn_sqlite__column_text(stmt, 1, result_pool));
+ svn_hash_sets(*iprop_paths, abspath_with_cache,
+ svn_sqlite__column_text(stmt, 1, result_pool));
}
SVN_ERR(svn_sqlite__reset(stmt));
@@ -9944,8 +9936,8 @@ get_children_with_cached_iprops(apr_hash
const char *abspath_with_cache = svn_dirent_join(wcroot->abspath,
relpath_with_cache,
result_pool);
- apr_hash_set(*iprop_paths, abspath_with_cache, APR_HASH_KEY_STRING,
- svn_sqlite__column_text(stmt, 1, result_pool));
+ svn_hash_sets(*iprop_paths, abspath_with_cache,
+ svn_sqlite__column_text(stmt, 1, result_pool));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
@@ -9986,8 +9978,7 @@ get_children_with_cached_iprops(apr_hash
/* Filter if not a file */
if (child_kind != svn_node_file)
{
- apr_hash_set(*iprop_paths, child_abspath, APR_HASH_KEY_STRING,
- NULL);
+ svn_hash_sets(*iprop_paths, child_abspath, NULL);
}
}
@@ -11036,7 +11027,7 @@ bump_node_revision(svn_wc__db_wcroot_t *
apr_array_header_t *iprops = NULL;
/* Skip an excluded path and its descendants. */
- if (apr_hash_get(exclude_relpaths, local_relpath, APR_HASH_KEY_STRING))
+ if (svn_hash_gets(exclude_relpaths, local_relpath))
return SVN_NO_ERROR;
SVN_ERR(svn_wc__db_base_get_info_internal(&status, &db_kind, &revision,
@@ -11076,10 +11067,9 @@ bump_node_revision(svn_wc__db_wcroot_t *
set_repos_relpath = TRUE;
if (wcroot_iprops)
- iprops = apr_hash_get(wcroot_iprops,
- svn_dirent_join(wcroot->abspath, local_relpath,
- scratch_pool),
- APR_HASH_KEY_STRING);
+ iprops = svn_hash_gets(wcroot_iprops,
+ svn_dirent_join(wcroot->abspath, local_relpath,
+ scratch_pool));
if (iprops
|| set_repos_relpath
@@ -11234,7 +11224,7 @@ svn_wc__db_op_bump_revisions_post_update
VERIFY_USABLE_WCROOT(wcroot);
- if (apr_hash_get(exclude_relpaths, local_relpath, APR_HASH_KEY_STRING))
+ if (svn_hash_gets(exclude_relpaths, local_relpath))
return SVN_NO_ERROR;
if (depth == svn_depth_unknown)
@@ -12302,7 +12292,7 @@ svn_wc__db_upgrade_begin(svn_sqlite__db_
wc_db->state_pool, scratch_pool));
/* The WCROOT is complete. Stash it into DB. */
- apr_hash_set(wc_db->dir_data, wcroot->abspath, APR_HASH_KEY_STRING, wcroot);
+ svn_hash_sets(wc_db->dir_data, wcroot->abspath, wcroot);
return SVN_NO_ERROR;
}
@@ -12823,8 +12813,7 @@ svn_wc__db_temp_get_access(svn_wc__db_t
if (!wcroot)
return NULL;
- return apr_hash_get(wcroot->access_cache, local_dir_abspath,
- APR_HASH_KEY_STRING);
+ return svn_hash_gets(wcroot->access_cache, local_dir_abspath);
}
@@ -12852,11 +12841,10 @@ svn_wc__db_temp_set_access(svn_wc__db_t
}
/* Better not override something already there. */
- SVN_ERR_ASSERT_NO_RETURN(apr_hash_get(wcroot->access_cache,
- local_dir_abspath,
- APR_HASH_KEY_STRING) == NULL);
- apr_hash_set(wcroot->access_cache, local_dir_abspath,
- APR_HASH_KEY_STRING, adm_access);
+ SVN_ERR_ASSERT_NO_RETURN(
+ svn_hash_gets(wcroot->access_cache, local_dir_abspath) == NULL
+ );
+ svn_hash_sets(wcroot->access_cache, local_dir_abspath, adm_access);
}
@@ -12875,8 +12863,7 @@ svn_wc__db_temp_close_access(svn_wc__db_
SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
local_dir_abspath, scratch_pool, scratch_pool));
- apr_hash_set(wcroot->access_cache, local_dir_abspath,
- APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(wcroot->access_cache, local_dir_abspath, NULL);
return SVN_NO_ERROR;
}
@@ -12903,8 +12890,7 @@ svn_wc__db_temp_clear_access(svn_wc__db_
return;
}
- apr_hash_set(wcroot->access_cache, local_dir_abspath,
- APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(wcroot->access_cache, local_dir_abspath, NULL);
}
@@ -13034,7 +13020,7 @@ get_conflict_marker_files(apr_hash_t **m
{
const char *marker_abspath = APR_ARRAY_IDX(markers, i, const char*);
- apr_hash_set(marker_files, marker_abspath, APR_HASH_KEY_STRING, "");
+ svn_hash_sets(marker_files, marker_abspath, "");
}
}
SVN_ERR(svn_sqlite__reset(stmt));
@@ -13065,7 +13051,7 @@ get_conflict_marker_files(apr_hash_t **m
{
const char *marker_abspath = APR_ARRAY_IDX(markers, i, const char*);
- apr_hash_set(marker_files, marker_abspath, APR_HASH_KEY_STRING, "");
+ svn_hash_sets(marker_files, marker_abspath, "");
}
}
@@ -14561,8 +14547,7 @@ svn_wc__db_get_excluded_subtrees(apr_has
svn_dirent_join(wcroot->abspath,
svn_sqlite__column_text(stmt, 0, NULL),
result_pool);
- apr_hash_set(*excluded_subtrees, abs_path, APR_HASH_KEY_STRING,
- abs_path);
+ svn_hash_sets(*excluded_subtrees, abs_path, abs_path);
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
@@ -14883,12 +14868,10 @@ svn_wc__db_base_get_lock_tokens_recursiv
}
SVN_ERR_ASSERT(last_repos_root_url != NULL);
- apr_hash_set(*lock_tokens,
- svn_path_url_add_component2(last_repos_root_url,
- child_relpath,
- result_pool),
- APR_HASH_KEY_STRING,
- lock_token);
+ svn_hash_sets(*lock_tokens,
+ svn_path_url_add_component2(last_repos_root_url,
+ child_relpath, result_pool),
+ lock_token);
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
Modified: subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c?rev=1460158&r1=1460157&r2=1460158&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c Sat Mar 23 14:09:02 2013
@@ -2249,10 +2249,10 @@ bump_moved_away(svn_wc__db_wcroot_t *wcr
src_root_relpath = svn_relpath_dirname(src_root_relpath,
iterpool);
- if (!apr_hash_get(src_done, src_relpath, APR_HASH_KEY_STRING))
+ if (!svn_hash_gets(src_done, src_relpath))
{
- apr_hash_set(src_done, apr_pstrdup(result_pool, src_relpath),
- APR_HASH_KEY_STRING, "");
+ svn_hash_sets(src_done,
+ apr_pstrdup(result_pool, src_relpath), "");
err = svn_wc__db_read_conflict_internal(&conflict, wcroot,
src_root_relpath,
iterpool, iterpool);