You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2013/05/10 16:58:56 UTC
svn commit: r1481041 [21/38] - in /subversion/branches/master-passphrase: ./
build/ build/ac-macros/ build/generator/ build/generator/templates/
contrib/client-side/svncopy/ contrib/hook-scripts/
contrib/server-side/fsfsfixer/ contrib/server-side/fsfsf...
Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/subst.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/subst.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/subst.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/subst.c Fri May 10 14:58:47 2013
@@ -33,6 +33,7 @@
#include <apr_file_io.h>
#include <apr_strings.h>
+#include "svn_hash.h"
#include "svn_cmdline.h"
#include "svn_types.h"
#include "svn_string.h"
@@ -135,16 +136,24 @@ svn_subst_translation_required(svn_subst
* %b basename of the URL of this file
* %d short format of date of this revision
* %D long format of date of this revision
+ * %P path relative to root of repos
* %r number of this revision
+ * %R root url of repository
* %u URL of this file
+ * %_ a space
* %% a literal %
*
+ * The following special format codes are also recognized:
+ * %H is equivalent to %P%_%r%_%d%_%a
+ * %I is equivalent to %b%_%r%_%d%_%a
+ *
* All memory is allocated out of @a pool.
*/
static svn_string_t *
keyword_printf(const char *fmt,
const char *rev,
const char *url,
+ const char *repos_root_url,
apr_time_t date,
const char *author,
apr_pool_t *pool)
@@ -203,6 +212,20 @@ keyword_printf(const char *fmt,
svn_stringbuf_appendcstr(value,
svn_time_to_human_cstring(date, pool));
break;
+ case 'P': /* relative path of this file */
+ if (repos_root_url && *repos_root_url != '\0' && url && *url != '\0')
+ {
+ const char *repos_relpath;
+
+ repos_relpath = svn_uri_skip_ancestor(repos_root_url, url, pool);
+ if (repos_relpath)
+ svn_stringbuf_appendcstr(value, repos_relpath);
+ }
+ break;
+ case 'R': /* root of repos */
+ if (repos_root_url && *repos_root_url != '\0')
+ svn_stringbuf_appendcstr(value, repos_root_url);
+ break;
case 'r': /* number of this revision */
if (rev)
svn_stringbuf_appendcstr(value, rev);
@@ -211,6 +234,9 @@ keyword_printf(const char *fmt,
if (url)
svn_stringbuf_appendcstr(value, url);
break;
+ case '_': /* '%_' => a space */
+ svn_stringbuf_appendbyte(value, ' ');
+ break;
case '%': /* '%%' => a literal % */
svn_stringbuf_appendbyte(value, *cur);
break;
@@ -222,6 +248,22 @@ keyword_printf(const char *fmt,
* formatting random memory contents. */
cur--;
break;
+ case 'H':
+ {
+ svn_string_t *s = keyword_printf("%P%_%r%_%d%_%a", rev, url,
+ repos_root_url, date, author,
+ pool);
+ svn_stringbuf_appendcstr(value, s->data);
+ }
+ break;
+ case 'I':
+ {
+ svn_string_t *s = keyword_printf("%b%_%r%_%d%_%a", rev, url,
+ repos_root_url, date, author,
+ pool);
+ svn_stringbuf_appendcstr(value, s->data);
+ }
+ break;
default: /* Unrecognized code, just print it literally. */
svn_stringbuf_appendbytes(value, cur, 2);
break;
@@ -234,57 +276,16 @@ keyword_printf(const char *fmt,
return svn_stringbuf__morph_into_string(value);
}
-svn_error_t *
-svn_subst_build_keywords(svn_subst_keywords_t *kw,
- const char *keywords_val,
- const char *rev,
- const char *url,
- apr_time_t date,
- const char *author,
- apr_pool_t *pool)
-{
- apr_hash_t *kwhash;
- const svn_string_t *val;
-
- SVN_ERR(svn_subst_build_keywords2(&kwhash, keywords_val, rev,
- url, date, author, pool));
-
- /* The behaviour of pre-1.3 svn_subst_build_keywords, which we are
- * replicating here, is to write to a slot in the svn_subst_keywords_t
- * only if the relevant keyword was present in keywords_val, otherwise
- * leaving that slot untouched. */
-
- val = apr_hash_get(kwhash, SVN_KEYWORD_REVISION_LONG, APR_HASH_KEY_STRING);
- if (val)
- kw->revision = val;
-
- val = apr_hash_get(kwhash, SVN_KEYWORD_DATE_LONG, APR_HASH_KEY_STRING);
- if (val)
- kw->date = val;
-
- val = apr_hash_get(kwhash, SVN_KEYWORD_AUTHOR_LONG, APR_HASH_KEY_STRING);
- if (val)
- kw->author = val;
-
- val = apr_hash_get(kwhash, SVN_KEYWORD_URL_LONG, APR_HASH_KEY_STRING);
- if (val)
- kw->url = val;
-
- val = apr_hash_get(kwhash, SVN_KEYWORD_ID, APR_HASH_KEY_STRING);
- if (val)
- kw->id = val;
-
- return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_subst_build_keywords2(apr_hash_t **kw,
- const char *keywords_val,
- const char *rev,
- const char *url,
- apr_time_t date,
- const char *author,
- apr_pool_t *pool)
+static svn_error_t *
+build_keywords(apr_hash_t **kw,
+ svn_boolean_t expand_custom_keywords,
+ const char *keywords_val,
+ const char *rev,
+ const char *url,
+ const char *repos_root_url,
+ apr_time_t date,
+ const char *author,
+ apr_pool_t *pool)
{
apr_array_header_t *keyword_tokens;
int i;
@@ -296,77 +297,120 @@ svn_subst_build_keywords2(apr_hash_t **k
for (i = 0; i < keyword_tokens->nelts; ++i)
{
const char *keyword = APR_ARRAY_IDX(keyword_tokens, i, const char *);
+ apr_array_header_t *custom_keyword_tokens = NULL;
- if ((! strcmp(keyword, SVN_KEYWORD_REVISION_LONG))
- || (! strcmp(keyword, SVN_KEYWORD_REVISION_MEDIUM))
- || (! svn_cstring_casecmp(keyword, SVN_KEYWORD_REVISION_SHORT)))
+ if (expand_custom_keywords)
+ custom_keyword_tokens = svn_cstring_split(keyword, "=",
+ TRUE /* chop */, pool);
+ if (expand_custom_keywords && custom_keyword_tokens->nelts == 2)
+ {
+ const char *custom_fmt;
+ svn_string_t *custom_val;
+
+ /* Custom keywords must be allowed to match the name of an
+ * existing fixed keyword. This is for compatibility purposes,
+ * in case new fixed keywords are added to Subversion which
+ * happen to match a custom keyword defined somewhere.
+ * There is only one global namespace for keyword names. */
+
+ keyword = APR_ARRAY_IDX(custom_keyword_tokens, 0, const char*);
+ custom_fmt = APR_ARRAY_IDX(custom_keyword_tokens, 1, const char*);
+ custom_val = keyword_printf(custom_fmt, rev, url, repos_root_url,
+ date, author, pool);
+ svn_hash_sets(*kw, keyword, custom_val);
+ }
+ else if ((! strcmp(keyword, SVN_KEYWORD_REVISION_LONG))
+ || (! strcmp(keyword, SVN_KEYWORD_REVISION_MEDIUM))
+ || (! svn_cstring_casecmp(keyword, SVN_KEYWORD_REVISION_SHORT)))
{
svn_string_t *revision_val;
- revision_val = keyword_printf("%r", rev, url, date, author, pool);
- apr_hash_set(*kw, SVN_KEYWORD_REVISION_LONG,
- APR_HASH_KEY_STRING, revision_val);
- apr_hash_set(*kw, SVN_KEYWORD_REVISION_MEDIUM,
- APR_HASH_KEY_STRING, revision_val);
- apr_hash_set(*kw, SVN_KEYWORD_REVISION_SHORT,
- APR_HASH_KEY_STRING, revision_val);
+ revision_val = keyword_printf("%r", rev, url, repos_root_url,
+ date, author, pool);
+ svn_hash_sets(*kw, SVN_KEYWORD_REVISION_LONG, revision_val);
+ svn_hash_sets(*kw, SVN_KEYWORD_REVISION_MEDIUM, revision_val);
+ svn_hash_sets(*kw, SVN_KEYWORD_REVISION_SHORT, revision_val);
}
else if ((! strcmp(keyword, SVN_KEYWORD_DATE_LONG))
|| (! svn_cstring_casecmp(keyword, SVN_KEYWORD_DATE_SHORT)))
{
svn_string_t *date_val;
- date_val = keyword_printf("%D", rev, url, date, author, pool);
- apr_hash_set(*kw, SVN_KEYWORD_DATE_LONG,
- APR_HASH_KEY_STRING, date_val);
- apr_hash_set(*kw, SVN_KEYWORD_DATE_SHORT,
- APR_HASH_KEY_STRING, date_val);
+ date_val = keyword_printf("%D", rev, url, repos_root_url, date,
+ author, pool);
+ svn_hash_sets(*kw, SVN_KEYWORD_DATE_LONG, date_val);
+ svn_hash_sets(*kw, SVN_KEYWORD_DATE_SHORT, date_val);
}
else if ((! strcmp(keyword, SVN_KEYWORD_AUTHOR_LONG))
|| (! svn_cstring_casecmp(keyword, SVN_KEYWORD_AUTHOR_SHORT)))
{
svn_string_t *author_val;
- author_val = keyword_printf("%a", rev, url, date, author, pool);
- apr_hash_set(*kw, SVN_KEYWORD_AUTHOR_LONG,
- APR_HASH_KEY_STRING, author_val);
- apr_hash_set(*kw, SVN_KEYWORD_AUTHOR_SHORT,
- APR_HASH_KEY_STRING, author_val);
+ author_val = keyword_printf("%a", rev, url, repos_root_url, date,
+ author, pool);
+ svn_hash_sets(*kw, SVN_KEYWORD_AUTHOR_LONG, author_val);
+ svn_hash_sets(*kw, SVN_KEYWORD_AUTHOR_SHORT, author_val);
}
else if ((! strcmp(keyword, SVN_KEYWORD_URL_LONG))
|| (! svn_cstring_casecmp(keyword, SVN_KEYWORD_URL_SHORT)))
{
svn_string_t *url_val;
- url_val = keyword_printf("%u", rev, url, date, author, pool);
- apr_hash_set(*kw, SVN_KEYWORD_URL_LONG,
- APR_HASH_KEY_STRING, url_val);
- apr_hash_set(*kw, SVN_KEYWORD_URL_SHORT,
- APR_HASH_KEY_STRING, url_val);
+ url_val = keyword_printf("%u", rev, url, repos_root_url, date,
+ author, pool);
+ svn_hash_sets(*kw, SVN_KEYWORD_URL_LONG, url_val);
+ svn_hash_sets(*kw, SVN_KEYWORD_URL_SHORT, url_val);
}
else if ((! svn_cstring_casecmp(keyword, SVN_KEYWORD_ID)))
{
svn_string_t *id_val;
- id_val = keyword_printf("%b %r %d %a", rev, url, date, author,
- pool);
- apr_hash_set(*kw, SVN_KEYWORD_ID,
- APR_HASH_KEY_STRING, id_val);
+ id_val = keyword_printf("%b %r %d %a", rev, url, repos_root_url,
+ date, author, pool);
+ svn_hash_sets(*kw, SVN_KEYWORD_ID, id_val);
}
else if ((! svn_cstring_casecmp(keyword, SVN_KEYWORD_HEADER)))
{
svn_string_t *header_val;
- header_val = keyword_printf("%u %r %d %a", rev, url, date, author,
- pool);
- apr_hash_set(*kw, SVN_KEYWORD_HEADER,
- APR_HASH_KEY_STRING, header_val);
+ header_val = keyword_printf("%u %r %d %a", rev, url, repos_root_url,
+ date, author, pool);
+ svn_hash_sets(*kw, SVN_KEYWORD_HEADER, header_val);
}
}
return SVN_NO_ERROR;
}
+svn_error_t *
+svn_subst_build_keywords2(apr_hash_t **kw,
+ const char *keywords_val,
+ const char *rev,
+ const char *url,
+ apr_time_t date,
+ const char *author,
+ apr_pool_t *pool)
+{
+ return svn_error_trace(build_keywords(kw, FALSE, keywords_val, rev, url,
+ NULL, date, author, pool));
+}
+
+
+svn_error_t *
+svn_subst_build_keywords3(apr_hash_t **kw,
+ const char *keywords_val,
+ const char *rev,
+ const char *url,
+ const char *repos_root_url,
+ apr_time_t date,
+ const char *author,
+ apr_pool_t *pool)
+{
+ return svn_error_trace(build_keywords(kw, TRUE, keywords_val,
+ rev, url, repos_root_url,
+ date, author, pool));
+}
+
/*** Helpers for svn_subst_translate_stream2 ***/
@@ -406,6 +450,11 @@ translate_keyword_subst(char *buf,
if (*len < keyword_len + 2)
return FALSE;
+ /* Need at least space for two $'s, two spaces and a colon, and that
+ leaves zero space for the value itself. */
+ if (keyword_len > SVN_KEYWORD_MAX_LEN - 5)
+ return FALSE;
+
/* The keyword needs to match what we're looking for. */
if (strncmp(buf + 1, keyword, keyword_len))
return FALSE;
@@ -518,8 +567,8 @@ translate_keyword_subst(char *buf,
apr_size_t vallen = value->len;
/* "$keyword: value $" */
- if (vallen > (SVN_KEYWORD_MAX_LEN - 5))
- vallen = SVN_KEYWORD_MAX_LEN - 5;
+ if (vallen > (SVN_KEYWORD_MAX_LEN - 5 - keyword_len))
+ vallen = SVN_KEYWORD_MAX_LEN - 5 - keyword_len;
strncpy(buf_ptr + 2, value->data, vallen);
buf_ptr[2 + vallen] = ' ';
buf_ptr[2 + vallen + 1] = '$';
@@ -559,7 +608,7 @@ match_keyword(char *buf,
keyword_name[i] = buf[i + 1];
keyword_name[i] = '\0';
- return apr_hash_get(keywords, keyword_name, APR_HASH_KEY_STRING) != NULL;
+ return svn_hash_gets(keywords, keyword_name) != NULL;
}
/* Try to translate keyword *KEYWORD_NAME in BUF (whose length is LEN):
@@ -595,7 +644,7 @@ translate_keyword(char *buf,
if (! keywords)
return FALSE;
- value = apr_hash_get(keywords, keyword_name, APR_HASH_KEY_STRING);
+ value = svn_hash_gets(keywords, keyword_name);
if (value)
{
@@ -1448,9 +1497,8 @@ stream_translated(svn_stream_t *stream,
void *val;
apr_hash_this(hi, &key, NULL, &val);
- apr_hash_set(copy, apr_pstrdup(result_pool, key),
- APR_HASH_KEY_STRING,
- svn_string_dup(val, result_pool));
+ svn_hash_sets(copy, apr_pstrdup(result_pool, key),
+ svn_string_dup(val, result_pool));
}
svn_pool_destroy(subpool);
@@ -1653,7 +1701,7 @@ create_special_file_from_stream(svn_stre
svn_io_file_del_none, pool));
/* Do the atomic rename from our temporary location. */
- return svn_io_file_rename(dst_tmp, dst, pool);
+ return svn_error_trace(svn_io_file_rename(dst_tmp, dst, pool));
}
@@ -1701,8 +1749,9 @@ svn_subst_copy_and_translate4(const char
SVN_ERR(svn_stream_open_readonly(&src_stream, src, pool, pool));
}
- return svn_error_trace(create_special_file_from_stream(src_stream,
- dst, pool));
+ SVN_ERR(create_special_file_from_stream(src_stream, dst, pool));
+
+ return svn_error_trace(svn_stream_close(src_stream));
}
/* else !expand */
@@ -1743,7 +1792,12 @@ svn_subst_copy_and_translate4(const char
}
/* Now that dst_tmp contains the translated data, do the atomic rename. */
- return svn_error_trace(svn_io_file_rename(dst_tmp, dst, pool));
+ SVN_ERR(svn_io_file_rename(dst_tmp, dst, pool));
+
+ /* Preserve the source file's permission bits. */
+ SVN_ERR(svn_io_copy_perms(src, dst, pool));
+
+ return SVN_NO_ERROR;
}
Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/temp_serializer.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/temp_serializer.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/temp_serializer.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/temp_serializer.c Fri May 10 14:58:47 2013
@@ -267,7 +267,7 @@ void
svn_temp_serializer__pop(svn_temp_serializer__context_t *context)
{
source_stack_t *old = context->source;
-
+
/* we may pop the original struct but not further */
assert(context->source);
Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/types.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/types.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/types.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/types.c Fri May 10 14:58:47 2013
@@ -24,6 +24,7 @@
#include <apr_pools.h>
#include <apr_uuid.h>
+#include "svn_hash.h"
#include "svn_types.h"
#include "svn_error.h"
#include "svn_string.h"
@@ -121,37 +122,6 @@ svn_depth_from_word(const char *word)
return svn_depth_unknown;
}
-svn_node_kind_t
-svn__node_kind_from_kind(svn_kind_t kind)
-{
- switch (kind)
- {
- case svn_kind_unknown: return svn_node_unknown;
- case svn_kind_none: return svn_node_none;
- case svn_kind_file: return svn_node_file;
- case svn_kind_dir: return svn_node_dir;
- case svn_kind_symlink: return svn_node_file;
- default: SVN_ERR_MALFUNCTION_NO_RETURN();
- }
-}
-
-svn_kind_t
-svn__kind_from_node_kind(svn_node_kind_t kind,
- svn_boolean_t is_symlink)
-{
- if (is_symlink)
- return svn_kind_symlink;
-
- switch (kind)
- {
- case svn_node_unknown: return svn_kind_unknown;
- case svn_node_none: return svn_kind_none;
- case svn_node_file: return svn_kind_file;
- case svn_node_dir: return svn_kind_dir;
- default: SVN_ERR_MALFUNCTION_NO_RETURN();
- }
-}
-
const char *
svn_node_kind_to_word(svn_node_kind_t kind)
{
@@ -163,6 +133,8 @@ svn_node_kind_to_word(svn_node_kind_t ki
return "file";
case svn_node_dir:
return "dir";
+ case svn_node_symlink:
+ return "symlink";
case svn_node_unknown:
default:
return "unknown";
@@ -182,6 +154,8 @@ svn_node_kind_from_word(const char *word
return svn_node_file;
else if (strcmp(word, "dir") == 0)
return svn_node_dir;
+ else if (strcmp(word, "symlink") == 0)
+ return svn_node_symlink;
else
/* This also handles word == "unknown" */
return svn_node_unknown;
@@ -339,9 +313,8 @@ svn_log_entry_dup(const svn_log_entry_t
apr_hash_this(hi, &key, NULL, &change);
- apr_hash_set(new_entry->changed_paths2, apr_pstrdup(pool, key),
- APR_HASH_KEY_STRING,
- svn_log_changed_path2_dup(change, pool));
+ svn_hash_sets(new_entry->changed_paths2, apr_pstrdup(pool, key),
+ svn_log_changed_path2_dup(change, pool));
}
}
Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/username_providers.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/username_providers.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/username_providers.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/username_providers.c Fri May 10 14:58:47 2013
@@ -28,6 +28,7 @@
/*** Includes. ***/
#include <apr_pools.h>
+#include "svn_hash.h"
#include "svn_auth.h"
#include "svn_error.h"
#include "svn_utf.h"
@@ -55,9 +56,8 @@ username_first_creds(void **credentials,
const char *realmstring,
apr_pool_t *pool)
{
- const char *username = apr_hash_get(parameters,
- SVN_AUTH_PARAM_DEFAULT_USERNAME,
- APR_HASH_KEY_STRING);
+ const char *username = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_DEFAULT_USERNAME);
svn_boolean_t may_save = !! username;
svn_error_t *err;
@@ -80,8 +80,7 @@ username_first_creds(void **credentials,
svn_error_clear(err);
if (! err && creds_hash)
{
- svn_string_t *str = apr_hash_get(creds_hash, AUTHN_USERNAME_KEY,
- APR_HASH_KEY_STRING);
+ svn_string_t *str = svn_hash_gets(creds_hash, AUTHN_USERNAME_KEY);
if (str && str->data)
username = str->data;
}
@@ -127,8 +126,8 @@ username_save_creds(svn_boolean_t *saved
/* Put the credentials in a hash and save it to disk */
creds_hash = apr_hash_make(pool);
- apr_hash_set(creds_hash, AUTHN_USERNAME_KEY, APR_HASH_KEY_STRING,
- svn_string_create(creds->username, pool));
+ svn_hash_sets(creds_hash, AUTHN_USERNAME_KEY,
+ svn_string_create(creds->username, pool));
err = svn_auth__get_store_from_parameters(&auth_store, parameters, pool);
if (! err)
@@ -206,9 +205,7 @@ prompt_for_username_creds(svn_auth_cred_
/* If we're allowed to check for default usernames, do so. */
if (first_time)
- def_username = apr_hash_get(parameters,
- SVN_AUTH_PARAM_DEFAULT_USERNAME,
- APR_HASH_KEY_STRING);
+ def_username = svn_hash_gets(parameters, SVN_AUTH_PARAM_DEFAULT_USERNAME);
/* If we have defaults, just build the cred here and return it.
*
@@ -244,9 +241,8 @@ username_prompt_first_creds(void **crede
{
username_prompt_provider_baton_t *pb = provider_baton;
username_prompt_iter_baton_t *ibaton = apr_pcalloc(pool, sizeof(*ibaton));
- const char *no_auth_cache = apr_hash_get(parameters,
- SVN_AUTH_PARAM_NO_AUTH_CACHE,
- APR_HASH_KEY_STRING);
+ const char *no_auth_cache = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_NO_AUTH_CACHE);
SVN_ERR(prompt_for_username_creds
((svn_auth_cred_username_t **) credentials_p, pb,
@@ -272,9 +268,8 @@ username_prompt_next_creds(void **creden
{
username_prompt_iter_baton_t *ib = iter_baton;
username_prompt_provider_baton_t *pb = provider_baton;
- const char *no_auth_cache = apr_hash_get(parameters,
- SVN_AUTH_PARAM_NO_AUTH_CACHE,
- APR_HASH_KEY_STRING);
+ const char *no_auth_cache = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_NO_AUTH_CACHE);
if ((pb->retry_limit >= 0) && (ib->retries >= pb->retry_limit))
{
Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/utf.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/utf.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/utf.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/utf.c Fri May 10 14:58:47 2013
@@ -32,6 +32,7 @@
#include <apr_xlate.h>
#include <apr_atomic.h>
+#include "svn_hash.h"
#include "svn_string.h"
#include "svn_error.h"
#include "svn_pools.h"
@@ -292,9 +293,8 @@ get_xlate_handle_node_internal(xlate_han
xlate_handle_node_t *old_node = NULL;
/* 2nd level: hash lookup */
- xlate_handle_node_t **old_node_p = apr_hash_get(xlate_handle_hash,
- userdata_key,
- APR_HASH_KEY_STRING);
+ xlate_handle_node_t **old_node_p = svn_hash_gets(xlate_handle_hash,
+ userdata_key);
if (old_node_p)
old_node = *old_node_p;
if (old_node)
@@ -388,9 +388,7 @@ static svn_error_t *
put_xlate_handle_node_internal(xlate_handle_node_t *node,
const char *userdata_key)
{
- xlate_handle_node_t **node_p = apr_hash_get(xlate_handle_hash,
- userdata_key,
- APR_HASH_KEY_STRING);
+ xlate_handle_node_t **node_p = svn_hash_gets(xlate_handle_hash, userdata_key);
if (node_p == NULL)
{
userdata_key = apr_pstrdup(apr_hash_pool_get(xlate_handle_hash),
@@ -398,8 +396,7 @@ put_xlate_handle_node_internal(xlate_han
node_p = apr_palloc(apr_hash_pool_get(xlate_handle_hash),
sizeof(*node_p));
*node_p = NULL;
- apr_hash_set(xlate_handle_hash, userdata_key,
- APR_HASH_KEY_STRING, node_p);
+ svn_hash_sets(xlate_handle_hash, userdata_key, node_p);
}
node->next = *node_p;
*node_p = node;
@@ -948,7 +945,7 @@ svn_utf_cstring_from_utf8(const char **d
SVN_ERR(get_uton_xlate_handle_node(&node, pool));
err = convert_cstring(dest, src, node, pool);
err = svn_error_compose_create(
- err,
+ err,
put_xlate_handle_node(node, SVN_UTF_UTON_XLATE_HANDLE, pool));
return err;
Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/utf_validate.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/utf_validate.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/utf_validate.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/utf_validate.c Fri May 10 14:58:47 2013
@@ -271,12 +271,12 @@ first_non_fsm_start_char(const char *dat
max_len -= len;
for (; len > 0; ++data, --len)
- if (*data < 0 || *data >= 0x80)
+ if ((unsigned char)*data >= 0x80)
return data;
}
-
+
#endif
-
+
/* Scan the input one machine word at a time. */
for (; max_len > sizeof(apr_uintptr_t)
; data += sizeof(apr_uintptr_t), max_len -= sizeof(apr_uintptr_t))
@@ -285,7 +285,7 @@ first_non_fsm_start_char(const char *dat
/* The remaining odd bytes will be examined the naive way: */
for (; max_len > 0; ++data, --max_len)
- if (*data < 0 || *data >= 0x80)
+ if ((unsigned char)*data >= 0x80)
break;
return data;
@@ -304,10 +304,17 @@ first_non_fsm_start_char_cstring(const c
* segfault.
*/
for (; (apr_uintptr_t)data & (sizeof(apr_uintptr_t)-1); ++data)
- if (*data <= 0 || *data >= 0x80)
+ if (*data == 0 || (unsigned char)*data >= 0x80)
return data;
/* Scan the input one machine word at a time. */
+#ifndef SVN_UTF_NO_UNINITIALISED_ACCESS
+ /* This may read allocated but initialised bytes beyond the
+ terminating null. Any such bytes are always readable and this
+ code operates correctly whatever the uninitialised values happen
+ to be. However memory checking tools such as valgrind and GCC
+ 4.8's address santitizer will object so this bit of code can be
+ disabled at compile time. */
for (; ; data += sizeof(apr_uintptr_t))
{
/* Check for non-ASCII chars: */
@@ -320,10 +327,11 @@ first_non_fsm_start_char_cstring(const c
if ((chunk & SVN__BIT_7_SET) != SVN__BIT_7_SET)
break;
}
+#endif
/* The remaining odd bytes will be examined the naive way: */
for (; ; ++data)
- if (*data <= 0 || *data >= 0x80)
+ if (*data == 0 || (unsigned char)*data >= 0x80)
break;
return data;
@@ -352,6 +360,10 @@ svn_boolean_t
svn_utf__cstring_is_valid(const char *data)
{
int state = FSM_START;
+
+ if (!data)
+ return FALSE;
+
data = first_non_fsm_start_char_cstring(data);
while (*data)
@@ -368,6 +380,10 @@ svn_utf__is_valid(const char *data, apr_
{
const char *end = data + len;
int state = FSM_START;
+
+ if (!data)
+ return FALSE;
+
data = first_non_fsm_start_char(data, len);
while (data < end)
Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/utf_width.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/utf_width.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/utf_width.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/utf_width.c Fri May 10 14:58:47 2013
@@ -195,7 +195,7 @@ mk_wcwidth(apr_uint32_t ucs)
/* if we arrive here, ucs is not a combining or C0/C1 control character */
- return 1 +
+ return 1 +
(ucs >= 0x1100 &&
(ucs <= 0x115f || /* Hangul Jamo init. consonants */
ucs == 0x2329 || ucs == 0x232a ||
Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/version.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/version.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/version.c Fri May 10 14:58:47 2013
@@ -202,11 +202,13 @@ svn_version__parse_version_string(svn_ve
{
svn_error_t *err;
svn_version_t *version;
- apr_array_header_t *pieces =
+ apr_array_header_t *pieces =
svn_cstring_split(version_string, ".", FALSE, result_pool);
if ((pieces->nelts < 2) || (pieces->nelts > 3))
- return svn_error_create(SVN_ERR_MALFORMED_VERSION_STRING, NULL, NULL);
+ return svn_error_createf(SVN_ERR_MALFORMED_VERSION_STRING, NULL,
+ _("Failed to parse version number string '%s'"),
+ version_string);
version = apr_pcalloc(result_pool, sizeof(*version));
version->tag = "";
@@ -215,11 +217,15 @@ svn_version__parse_version_string(svn_ve
err = svn_cstring_atoi(&(version->major),
APR_ARRAY_IDX(pieces, 0, const char *));
if (err)
- return svn_error_create(SVN_ERR_MALFORMED_VERSION_STRING, err, NULL);
+ return svn_error_createf(SVN_ERR_MALFORMED_VERSION_STRING, err,
+ _("Failed to parse version number string '%s'"),
+ version_string);
err = svn_cstring_atoi(&(version->minor),
APR_ARRAY_IDX(pieces, 1, const char *));
if (err)
- return svn_error_create(SVN_ERR_MALFORMED_VERSION_STRING, err, NULL);
+ return svn_error_createf(SVN_ERR_MALFORMED_VERSION_STRING, err,
+ _("Failed to parse version number string '%s'"),
+ version_string);
/* If there's a third component, we'll parse it, too. But we don't
require that it be present. */
@@ -234,10 +240,17 @@ svn_version__parse_version_string(svn_ve
}
err = svn_cstring_atoi(&(version->patch), piece);
if (err)
- return svn_error_create(SVN_ERR_MALFORMED_VERSION_STRING,
- err, NULL);
+ return svn_error_createf(SVN_ERR_MALFORMED_VERSION_STRING, err,
+ _("Failed to parse version number string '%s'"
+ ),
+ version_string);
}
+ if (version->major < 0 || version->minor < 0 || version->patch < 0)
+ return svn_error_createf(SVN_ERR_MALFORMED_VERSION_STRING, err,
+ _("Failed to parse version number string '%s'"),
+ version_string);
+
*version_p = version;
return SVN_NO_ERROR;
}
Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/win32_crashrpt.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/win32_crashrpt.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/win32_crashrpt.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/win32_crashrpt.c Fri May 10 14:58:47 2013
@@ -33,6 +33,7 @@ typedef int win32_crashrpt__dummy;
#include <direct.h>
#include <stdio.h>
#include <stdlib.h>
+#include <time.h>
#include "svn_version.h"
Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/win32_crypto.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/win32_crypto.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/win32_crypto.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/win32_crypto.c Fri May 10 14:58:47 2013
@@ -34,6 +34,7 @@ typedef int win32_crypto__dummy;
#include <apr_base64.h>
#include "svn_auth.h"
#include "svn_error.h"
+#include "svn_hash.h"
#include "svn_utf.h"
#include "svn_config.h"
#include "svn_user.h"
@@ -435,13 +436,10 @@ windows_ssl_server_trust_first_credentia
const char *realmstring,
apr_pool_t *pool)
{
- apr_uint32_t *failures = apr_hash_get(parameters,
- SVN_AUTH_PARAM_SSL_SERVER_FAILURES,
- APR_HASH_KEY_STRING);
+ apr_uint32_t *failures = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_SSL_SERVER_FAILURES);
const svn_auth_ssl_server_cert_info_t *cert_info =
- apr_hash_get(parameters,
- SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO,
- APR_HASH_KEY_STRING);
+ svn_hash_gets(parameters, SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO);
*credentials = NULL;
*iter_baton = NULL;
Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/xml.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/xml.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/xml.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/xml.c Fri May 10 14:58:47 2013
@@ -27,6 +27,7 @@
#include <assert.h>
#include "svn_private_config.h" /* for SVN_HAVE_OLD_EXPAT */
+#include "svn_hash.h"
#include "svn_pools.h"
#include "svn_xml.h"
#include "svn_error.h"
@@ -533,7 +534,7 @@ svn_xml_ap_to_hash(va_list ap, apr_pool_
while ((key = va_arg(ap, char *)) != NULL)
{
const char *val = va_arg(ap, const char *);
- apr_hash_set(ht, key, APR_HASH_KEY_STRING, val);
+ svn_hash_sets(ht, key, val);
}
return ht;
Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/adm_crawler.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/adm_crawler.c Fri May 10 14:58:47 2013
@@ -30,6 +30,7 @@
#include <apr_file_io.h>
#include <apr_hash.h>
+#include "svn_hash.h"
#include "svn_types.h"
#include "svn_pools.h"
#include "svn_wc.h"
@@ -102,7 +103,7 @@ svn_wc_restore(svn_wc_context_t *wc_ctx,
apr_pool_t *scratch_pool)
{
svn_wc__db_status_t status;
- svn_kind_t kind;
+ svn_node_kind_t kind;
svn_node_kind_t disk_kind;
const svn_checksum_t *checksum;
@@ -122,11 +123,11 @@ svn_wc_restore(svn_wc_context_t *wc_ctx,
scratch_pool, scratch_pool));
if (status != svn_wc__db_status_normal
- && !((status == svn_wc__db_status_added
+ && !((status == svn_wc__db_status_added
|| status == svn_wc__db_status_incomplete)
- && (kind == svn_kind_dir
- || (kind == svn_kind_file && checksum != NULL)
- /* || (kind == svn_kind_symlink && target)*/)))
+ && (kind == svn_node_dir
+ || (kind == svn_node_file && checksum != NULL)
+ /* || (kind == svn_node_symlink && target)*/)))
{
return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
_("The node '%s' can not be restored."),
@@ -134,7 +135,7 @@ svn_wc_restore(svn_wc_context_t *wc_ctx,
scratch_pool));
}
- if (kind == svn_kind_file || kind == svn_kind_symlink)
+ if (kind == svn_node_file || kind == svn_node_symlink)
SVN_ERR(restore_file(wc_ctx->db, local_abspath, use_commit_times,
FALSE /*mark_resolved_text_conflict*/,
scratch_pool));
@@ -154,20 +155,20 @@ svn_wc_restore(svn_wc_context_t *wc_ctx,
static svn_error_t *
restore_node(svn_wc__db_t *db,
const char *local_abspath,
- svn_kind_t kind,
+ svn_node_kind_t kind,
svn_boolean_t use_commit_times,
svn_wc_notify_func2_t notify_func,
void *notify_baton,
apr_pool_t *scratch_pool)
{
- if (kind == svn_kind_file || kind == svn_kind_symlink)
+ if (kind == svn_node_file || kind == svn_node_symlink)
{
/* Recreate file from text-base; mark any text conflict as resolved */
SVN_ERR(restore_file(db, local_abspath, use_commit_times,
TRUE /*mark_resolved_text_conflict*/,
scratch_pool));
}
- else if (kind == svn_kind_dir)
+ else if (kind == svn_node_dir)
{
/* Recreating a directory is just a mkdir */
SVN_ERR(svn_io_dir_make(local_abspath, APR_OS_DEFAULT, scratch_pool));
@@ -369,10 +370,10 @@ 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_kind_t wrk_kind;
+ svn_node_kind_t wrk_kind;
const svn_checksum_t *checksum;
SVN_ERR(svn_wc__db_read_info(&wrk_status, &wrk_kind, NULL, NULL,
@@ -385,7 +386,7 @@ report_revisions_and_depths(svn_wc__db_t
if ((wrk_status == svn_wc__db_status_normal
|| wrk_status == svn_wc__db_status_added
|| wrk_status == svn_wc__db_status_incomplete)
- && (wrk_kind == svn_kind_dir || checksum))
+ && (wrk_kind == svn_node_dir || checksum))
{
svn_node_kind_t dirent_kind;
@@ -426,8 +427,8 @@ report_revisions_and_depths(svn_wc__db_t
ths->depth = svn_depth_infinity;
/*** Files ***/
- if (ths->kind == svn_kind_file ||
- ths->kind == svn_kind_symlink)
+ if (ths->kind == svn_node_file
+ || ths->kind == svn_node_symlink)
{
if (report_everything)
{
@@ -480,7 +481,7 @@ report_revisions_and_depths(svn_wc__db_t
} /* end file case */
/*** Directories (in recursive mode) ***/
- else if (ths->kind == svn_kind_dir
+ else if (ths->kind == svn_node_dir
&& (depth > svn_depth_files
|| depth == svn_depth_unknown))
{
@@ -637,7 +638,7 @@ svn_wc_crawl_revisions5(svn_wc_context_t
svn_revnum_t target_rev = SVN_INVALID_REVNUM;
svn_boolean_t start_empty;
svn_wc__db_status_t status;
- svn_kind_t target_kind;
+ svn_node_kind_t target_kind;
const char *repos_relpath, *repos_root_url;
svn_depth_t target_depth;
svn_wc__db_lock_t *target_lock;
@@ -705,7 +706,7 @@ svn_wc_crawl_revisions5(svn_wc_context_t
&& disk_kind == svn_node_none)
{
svn_wc__db_status_t wrk_status;
- svn_kind_t wrk_kind;
+ svn_node_kind_t wrk_kind;
const svn_checksum_t *checksum;
err = svn_wc__db_read_info(&wrk_status, &wrk_kind, NULL, NULL, NULL,
@@ -721,7 +722,7 @@ svn_wc_crawl_revisions5(svn_wc_context_t
{
svn_error_clear(err);
wrk_status = svn_wc__db_status_not_present;
- wrk_kind = svn_kind_file;
+ wrk_kind = svn_node_file;
}
else
SVN_ERR(err);
@@ -729,7 +730,7 @@ svn_wc_crawl_revisions5(svn_wc_context_t
if ((wrk_status == svn_wc__db_status_normal
|| wrk_status == svn_wc__db_status_added
|| wrk_status == svn_wc__db_status_incomplete)
- && (wrk_kind == svn_kind_dir || checksum))
+ && (wrk_kind == svn_node_dir || checksum))
{
SVN_ERR(restore_node(wc_ctx->db, local_abspath,
wrk_kind, use_commit_times,
@@ -752,7 +753,7 @@ svn_wc_crawl_revisions5(svn_wc_context_t
SVN_ERR(reporter->set_path(report_baton, "", target_rev, report_depth,
start_empty, NULL, scratch_pool));
}
- if (target_kind == svn_kind_dir)
+ if (target_kind == svn_node_dir)
{
if (depth != svn_depth_empty)
{
@@ -779,7 +780,7 @@ svn_wc_crawl_revisions5(svn_wc_context_t
}
}
- else if (target_kind == svn_kind_file || target_kind == svn_kind_symlink)
+ else if (target_kind == svn_node_file || target_kind == svn_node_symlink)
{
const char *parent_abspath, *base;
svn_wc__db_status_t parent_status;
@@ -1190,7 +1191,7 @@ svn_wc__internal_transmit_prop_deltas(sv
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
int i;
apr_array_header_t *propmods;
- svn_kind_t kind;
+ svn_node_kind_t kind;
SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath,
FALSE /* allow_missing */,
@@ -1198,7 +1199,7 @@ svn_wc__internal_transmit_prop_deltas(sv
FALSE /* show_hidden */,
iterpool));
- if (kind == svn_kind_none)
+ if (kind == svn_node_none)
return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
_("The node '%s' was not found."),
svn_dirent_local_style(local_abspath, iterpool));
@@ -1214,7 +1215,7 @@ svn_wc__internal_transmit_prop_deltas(sv
svn_pool_clear(iterpool);
- if (kind == svn_kind_file)
+ if (kind == svn_node_file)
SVN_ERR(editor->change_file_prop(baton, p->name, p->value,
iterpool));
else
Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/adm_files.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/adm_files.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/adm_files.c Fri May 10 14:58:47 2013
@@ -171,7 +171,7 @@ svn_wc__text_base_path_to_read(const cha
apr_pool_t *scratch_pool)
{
svn_wc__db_status_t status;
- svn_kind_t kind;
+ svn_node_kind_t kind;
const svn_checksum_t *checksum;
SVN_ERR(svn_wc__db_read_pristine_info(&status, &kind, NULL, NULL, NULL, NULL,
@@ -180,7 +180,7 @@ svn_wc__text_base_path_to_read(const cha
scratch_pool, scratch_pool));
/* Sanity */
- if (kind != svn_kind_file)
+ if (kind != svn_node_file)
return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
_("Can only get the pristine contents of files; "
"'%s' is not a file"),
@@ -224,7 +224,7 @@ svn_wc__get_pristine_contents(svn_stream
apr_pool_t *scratch_pool)
{
svn_wc__db_status_t status;
- svn_kind_t kind;
+ svn_node_kind_t kind;
const svn_checksum_t *sha1_checksum;
if (size)
@@ -236,7 +236,7 @@ svn_wc__get_pristine_contents(svn_stream
scratch_pool, scratch_pool));
/* Sanity */
- if (kind != svn_kind_file)
+ if (kind != svn_node_file)
return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
_("Can only get the pristine contents of files; "
"'%s' is not a file"),
Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/adm_ops.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/adm_ops.c Fri May 10 14:58:47 2013
@@ -55,6 +55,7 @@
#include "svn_private_config.h"
#include "private/svn_subr_private.h"
+#include "private/svn_dep_compat.h"
struct svn_wc_committed_queue_t
@@ -113,7 +114,7 @@ process_committed_leaf(svn_wc__db_t *db,
const char *local_abspath,
svn_boolean_t via_recurse,
svn_wc__db_status_t status,
- svn_kind_t kind,
+ svn_node_kind_t kind,
svn_boolean_t prop_mods,
const svn_checksum_t *old_checksum,
svn_revnum_t new_revnum,
@@ -133,7 +134,7 @@ process_committed_leaf(svn_wc__db_t *db,
{
const char *adm_abspath;
- if (kind == svn_kind_dir)
+ if (kind == svn_node_dir)
adm_abspath = local_abspath;
else
adm_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
@@ -167,7 +168,7 @@ process_committed_leaf(svn_wc__db_t *db,
|| status == svn_wc__db_status_incomplete
|| status == svn_wc__db_status_added);
- if (kind != svn_kind_dir)
+ if (kind != svn_node_dir)
{
/* If we sent a delta (meaning: post-copy modification),
then this file will appear in the queue and so we should have
@@ -241,7 +242,7 @@ svn_wc__process_committed_internal(svn_w
apr_pool_t *scratch_pool)
{
svn_wc__db_status_t status;
- svn_kind_t kind;
+ svn_node_kind_t kind;
const svn_checksum_t *old_checksum;
svn_boolean_t prop_mods;
@@ -264,7 +265,7 @@ svn_wc__process_committed_internal(svn_w
scratch_pool));
/* Only check for recursion on nodes that have children */
- if (kind != svn_kind_file
+ if (kind != svn_node_file
|| status == svn_wc__db_status_not_present
|| status == svn_wc__db_status_excluded
|| status == svn_wc__db_status_server_excluded
@@ -296,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;
@@ -341,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;
@@ -392,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;
}
@@ -487,16 +488,15 @@ 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);
}
}
/* Make sure nothing happens if this function is called again. */
- SVN_ERR(svn_hash__clear(queue->queue, iterpool));
+ apr_hash_clear(queue->queue);
/* Ok; everything is committed now. Now we can start calling callbacks */
@@ -579,7 +579,7 @@ check_can_add_to_parent(const char **rep
{
const char *parent_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
svn_wc__db_status_t parent_status;
- svn_kind_t parent_kind;
+ svn_node_kind_t parent_kind;
svn_error_t *err;
SVN_ERR(svn_wc__write_check(db, parent_abspath, scratch_pool));
@@ -612,7 +612,7 @@ check_can_add_to_parent(const char **rep
svn_dirent_local_style(local_abspath,
scratch_pool));
}
- else if (parent_kind != svn_kind_dir)
+ else if (parent_kind != svn_node_dir)
return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
_("Can't schedule an addition of '%s'"
" below a not-directory node"),
@@ -1139,7 +1139,7 @@ svn_wc__get_pristine_contents_by_checksu
apr_pool_t *scratch_pool)
{
svn_boolean_t present;
-
+
*contents = NULL;
SVN_ERR(svn_wc__db_pristine_check(&present, wc_ctx->db, wri_abspath,
@@ -1153,9 +1153,9 @@ svn_wc__get_pristine_contents_by_checksu
gpl_baton->wc_ctx = wc_ctx;
gpl_baton->wri_abspath = wri_abspath;
gpl_baton->checksum = checksum;
-
+
*contents = svn_stream_lazyopen_create(get_pristine_lazyopen_func,
- gpl_baton, result_pool);
+ gpl_baton, FALSE, result_pool);
}
return SVN_NO_ERROR;
@@ -1385,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/branches/master-passphrase/subversion/libsvn_wc/ambient_depth_filter_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/ambient_depth_filter_editor.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/ambient_depth_filter_editor.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/ambient_depth_filter_editor.c Fri May 10 14:58:47 2013
@@ -121,7 +121,7 @@ struct dir_baton
*/
static svn_error_t *
ambient_read_info(svn_wc__db_status_t *status,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_depth_t *depth,
svn_wc__db_t *db,
const char *local_abspath,
@@ -140,7 +140,7 @@ ambient_read_info(svn_wc__db_status_t *s
{
svn_error_clear(err);
- *kind = svn_kind_unknown;
+ *kind = svn_node_unknown;
if (status)
*status = svn_wc__db_status_normal;
if (depth)
@@ -190,7 +190,7 @@ make_dir_baton(struct dir_baton **d_p,
{
svn_boolean_t exclude;
svn_wc__db_status_t status;
- svn_kind_t kind;
+ svn_node_kind_t kind;
svn_boolean_t exists = TRUE;
if (!added)
@@ -201,10 +201,10 @@ make_dir_baton(struct dir_baton **d_p,
else
{
status = svn_wc__db_status_not_present;
- kind = svn_kind_unknown;
+ kind = svn_node_unknown;
}
- exists = (kind != svn_kind_unknown);
+ exists = (kind != svn_node_unknown);
if (pb->ambient_depth == svn_depth_empty
|| pb->ambient_depth == svn_depth_files)
@@ -250,7 +250,7 @@ make_file_baton(struct file_baton **f_p,
struct file_baton *f = apr_pcalloc(pool, sizeof(*f));
struct edit_baton *eb = pb->edit_baton;
svn_wc__db_status_t status;
- svn_kind_t kind;
+ svn_node_kind_t kind;
const char *abspath;
SVN_ERR_ASSERT(path);
@@ -272,7 +272,7 @@ make_file_baton(struct file_baton **f_p,
else
{
status = svn_wc__db_status_not_present;
- kind = svn_kind_unknown;
+ kind = svn_node_unknown;
}
if (pb->ambient_depth == svn_depth_empty)
@@ -285,7 +285,7 @@ make_file_baton(struct file_baton **f_p,
if (status == svn_wc__db_status_not_present
|| status == svn_wc__db_status_server_excluded
|| status == svn_wc__db_status_excluded
- || kind == svn_kind_unknown)
+ || kind == svn_node_unknown)
{
f->ambiently_excluded = TRUE;
*f_p = f;
@@ -344,7 +344,7 @@ open_root(void *edit_baton,
if (! *eb->target)
{
/* For an update with a NULL target, this is equivalent to open_dir(): */
- svn_kind_t kind;
+ svn_node_kind_t kind;
svn_wc__db_status_t status;
svn_depth_t depth;
@@ -353,7 +353,7 @@ open_root(void *edit_baton,
eb->db, eb->anchor_abspath,
pool));
- if (kind != svn_kind_unknown
+ if (kind != svn_node_unknown
&& status != svn_wc__db_status_not_present
&& status != svn_wc__db_status_excluded
&& status != svn_wc__db_status_server_excluded)
@@ -384,7 +384,7 @@ delete_entry(const char *path,
/* If the entry we want to delete doesn't exist, that's OK.
It's probably an old server that doesn't understand
depths. */
- svn_kind_t kind;
+ svn_node_kind_t kind;
svn_wc__db_status_t status;
const char *abspath;
@@ -393,7 +393,7 @@ delete_entry(const char *path,
SVN_ERR(ambient_read_info(&status, &kind, NULL,
eb->db, abspath, pool));
- if (kind == svn_kind_unknown
+ if (kind == svn_node_unknown
|| status == svn_wc__db_status_not_present
|| status == svn_wc__db_status_excluded
|| status == svn_wc__db_status_server_excluded)
@@ -462,7 +462,7 @@ open_directory(const char *path,
struct edit_baton *eb = pb->edit_baton;
struct dir_baton *b;
const char *local_abspath;
- svn_kind_t kind;
+ svn_node_kind_t kind;
svn_wc__db_status_t status;
svn_depth_t depth;
@@ -484,7 +484,7 @@ open_directory(const char *path,
SVN_ERR(ambient_read_info(&status, &kind, &depth,
eb->db, local_abspath, pool));
- if (kind != svn_kind_unknown
+ if (kind != svn_node_unknown
&& status != svn_wc__db_status_not_present
&& status != svn_wc__db_status_excluded
&& status != svn_wc__db_status_server_excluded)
Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/cleanup.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/cleanup.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/cleanup.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/cleanup.c Fri May 10 14:58:47 2013
@@ -76,7 +76,7 @@ repair_timestamps(svn_wc__db_t *db,
void *cancel_baton,
apr_pool_t *scratch_pool)
{
- svn_kind_t kind;
+ svn_node_kind_t kind;
svn_wc__db_status_t status;
if (cancel_func)
@@ -95,15 +95,15 @@ repair_timestamps(svn_wc__db_t *db,
|| status == svn_wc__db_status_not_present)
return SVN_NO_ERROR;
- if (kind == svn_kind_file
- || kind == svn_kind_symlink)
+ if (kind == svn_node_file
+ || kind == svn_node_symlink)
{
svn_boolean_t modified;
SVN_ERR(svn_wc__internal_file_modified_p(&modified,
db, local_abspath, FALSE,
scratch_pool));
}
- else if (kind == svn_kind_dir)
+ else if (kind == svn_node_dir)
{
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
const apr_array_header_t *children;