You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/07/20 01:06:07 UTC
svn commit: r1148581 [6/12] - in
/subversion/branches/gpg-agent-password-store: ./ build/ build/ac-macros/
build/generator/ build/generator/templates/ contrib/hook-scripts/
contrib/hook-scripts/enforcer/ contrib/server-side/
contrib/server-side/fsfsfix...
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/serf.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/serf.c Tue Jul 19 23:05:44 2011
@@ -1087,6 +1087,9 @@ svn_ra_serf__init(const svn_version_t *l
{ "svn_delta", svn_delta_version },
{ NULL, NULL }
};
+ int serf_major;
+ int serf_minor;
+ int serf_patch;
SVN_ERR(svn_ver_check_list(ra_serf_version(), checklist));
@@ -1094,12 +1097,27 @@ svn_ra_serf__init(const svn_version_t *l
VTABLE parameter. The RA loader does a more exhaustive check. */
if (loader_version->major != SVN_VER_MAJOR)
{
- return svn_error_createf
- (SVN_ERR_VERSION_MISMATCH, NULL,
+ return svn_error_createf(
+ SVN_ERR_VERSION_MISMATCH, NULL,
_("Unsupported RA loader version (%d) for ra_serf"),
loader_version->major);
}
+ /* Make sure that we have loaded a compatible library: the MAJOR must
+ match, and the minor must be at *least* what we compiled against.
+ The patch level is simply ignored. */
+ serf_lib_version(&serf_major, &serf_minor, &serf_patch);
+ if (serf_major != SERF_MAJOR_VERSION
+ || serf_minor < SERF_MINOR_VERSION)
+ {
+ return svn_error_createf(
+ SVN_ERR_VERSION_MISMATCH, NULL,
+ _("ra_serf was compiled for serf %d.%d.%d but loaded "
+ "an incompatible %d.%d.%d library"),
+ SERF_MAJOR_VERSION, SERF_MINOR_VERSION, SERF_PATCH_VERSION,
+ serf_major, serf_minor, serf_patch);
+ }
+
*vtable = &serf_vtable;
return SVN_NO_ERROR;
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/update.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/update.c Tue Jul 19 23:05:44 2011
@@ -115,9 +115,13 @@ typedef struct report_dir_t
/* the expanded directory name (including all parent names) */
const char *name;
- /* the canonical url for this directory. */
+ /* the canonical url for this directory after updating. (received) */
const char *url;
+ /* The original repos_relpath of this url (from the workingcopy)
+ or NULL if the repos_relpath can be calculated from the edit root. */
+ const char *repos_relpath;
+
/* Our base revision - SVN_INVALID_REVNUM if we're adding this dir. */
svn_revnum_t base_rev;
@@ -199,7 +203,7 @@ typedef struct report_info_t
svn_revnum_t target_rev;
/* our delta base, if present (NULL if we're adding the file) */
- const svn_string_t *delta_base;
+ const char *delta_base;
/* Path of original item if add with history */
const char *copyfrom_path;
@@ -225,6 +229,7 @@ typedef struct report_info_t
/* controlling file_baton and textdelta handler */
void *file_baton;
const char *base_checksum;
+ const char *final_sha1_checksum; /* ### currently unused */
svn_txdelta_window_handler_t textdelta;
void *textdelta_baton;
@@ -314,6 +319,13 @@ struct report_context_t {
/* Path -> lock token mapping. */
apr_hash_t *lock_path_tokens;
+ /* Path -> const char *repos_relpath mapping */
+ apr_hash_t *switched_paths;
+
+ /* Boolean indicating whether "" is switched.
+ (This indicates that the we are updating a single file) */
+ svn_boolean_t root_is_switched;
+
/* Our master update editor and baton. */
const svn_delta_editor_t *update_editor;
void *update_baton;
@@ -463,9 +475,9 @@ set_file_props(void *baton,
prop_name = svn_ra_serf__svnname_from_wirename(ns, name, scratch_pool);
if (prop_name != NULL)
return svn_error_trace(editor->change_file_prop(info->file_baton,
- prop_name,
- val,
- scratch_pool));
+ prop_name,
+ val,
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -484,9 +496,9 @@ set_dir_props(void *baton,
prop_name = svn_ra_serf__svnname_from_wirename(ns, name, scratch_pool);
if (prop_name != NULL)
return svn_error_trace(editor->change_dir_prop(dir->dir_baton,
- prop_name,
- val,
- scratch_pool));
+ prop_name,
+ val,
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -505,9 +517,9 @@ remove_file_props(void *baton,
prop_name = svn_ra_serf__svnname_from_wirename(ns, name, scratch_pool);
if (prop_name != NULL)
return svn_error_trace(editor->change_file_prop(info->file_baton,
- prop_name,
- NULL,
- scratch_pool));
+ prop_name,
+ NULL,
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -526,9 +538,9 @@ remove_dir_props(void *baton,
prop_name = svn_ra_serf__svnname_from_wirename(ns, name, scratch_pool);
if (prop_name != NULL)
return svn_error_trace(editor->change_dir_prop(dir->dir_baton,
- prop_name,
- NULL,
- scratch_pool));
+ prop_name,
+ NULL,
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -715,7 +727,7 @@ headers_fetch(serf_bucket_t *headers,
fetch_ctx->info->delta_base)
{
serf_bucket_headers_setn(headers, SVN_DAV_DELTA_BASE_HEADER,
- fetch_ctx->info->delta_base->data);
+ fetch_ctx->info->delta_base);
serf_bucket_headers_setn(headers, "Accept-Encoding",
"svndiff1;q=0.9,svndiff;q=0.8");
}
@@ -1360,6 +1372,15 @@ start_report(svn_ra_serf__xml_parser_t *
info->base_name = info->dir->base_name;
info->name = info->dir->name;
+
+ info->dir->repos_relpath = apr_hash_get(ctx->switched_paths, "",
+ APR_HASH_KEY_STRING);
+
+ if (!info->dir->repos_relpath)
+ SVN_ERR(svn_ra_serf__get_relative_path(&info->dir->repos_relpath,
+ ctx->sess->session_url.path,
+ ctx->sess, ctx->conn,
+ info->dir->pool));
}
else if (state == NONE)
{
@@ -1407,6 +1428,13 @@ start_report(svn_ra_serf__xml_parser_t *
dir->name = svn_relpath_join(dir->parent_dir->name, dir->base_name,
dir->pool);
info->name = dir->name;
+
+ dir->repos_relpath = apr_hash_get(ctx->switched_paths, dir->name,
+ APR_HASH_KEY_STRING);
+
+ if (!dir->repos_relpath)
+ dir->repos_relpath = svn_relpath_join(dir->parent_dir->repos_relpath,
+ dir->base_name, dir->pool);
}
else if ((state == OPEN_DIR || state == ADD_DIR) &&
strcmp(name.name, "add-directory") == 0)
@@ -1445,6 +1473,9 @@ start_report(svn_ra_serf__xml_parser_t *
dir->base_rev = info->base_rev;
dir->target_rev = ctx->target_rev;
dir->fetch_props = TRUE;
+
+ dir->repos_relpath = svn_relpath_join(dir->parent_dir->repos_relpath,
+ dir->base_name, dir->pool);
}
else if ((state == OPEN_DIR || state == ADD_DIR) &&
strcmp(name.name, "open-file") == 0)
@@ -1508,6 +1539,12 @@ start_report(svn_ra_serf__xml_parser_t *
info->copyfrom_path = cf ? apr_pstrdup(info->pool, cf) : NULL;
info->copyfrom_rev = cr ? SVN_STR_TO_REV(cr) : SVN_INVALID_REVNUM;
+
+ info->final_sha1_checksum =
+ svn_xml_get_attr_value("sha1-checksum", attrs);
+ if (info->final_sha1_checksum)
+ info->final_sha1_checksum = apr_pstrdup(info->pool,
+ info->final_sha1_checksum);
}
else if ((state == OPEN_DIR || state == ADD_DIR) &&
strcmp(name.name, "delete-entry") == 0)
@@ -1679,8 +1716,13 @@ start_report(svn_ra_serf__xml_parser_t *
if (info->base_checksum)
info->base_checksum = apr_pstrdup(info->pool, info->base_checksum);
- info->fetch_file = TRUE;
+ info->final_sha1_checksum =
+ svn_xml_get_attr_value("sha1-checksum", attrs);
+ if (info->final_sha1_checksum)
+ info->final_sha1_checksum = apr_pstrdup(info->pool,
+ info->final_sha1_checksum);
+ info->fetch_file = TRUE;
}
else if (strcmp(name.name, "set-prop") == 0 ||
strcmp(name.name, "remove-prop") == 0)
@@ -1833,126 +1875,54 @@ end_report(svn_ra_serf__xml_parser_t *pa
* rather than fetching a fulltext.
*
* In HTTP v2, we can simply construct the URL we need given the
- * path and base revision number.
+ * repos_relpath and base revision number.
*/
if (SVN_RA_SERF__HAVE_HTTPV2_SUPPORT(ctx->sess))
{
- const char *fs_path;
- const char *full_path =
- svn_fspath__join(ctx->sess->session_url.path,
- svn_path_uri_encode(info->name, info->pool),
- info->pool);
-
- SVN_ERR(svn_ra_serf__get_relative_path(&fs_path, full_path,
- ctx->sess, NULL, info->pool));
- info->delta_base = svn_string_createf(info->pool, "%s/%ld/%s",
- ctx->sess->rev_root_stub,
- info->base_rev, fs_path);
- }
-
- /* Still no base URL? If we have a WC, we might be able to dive all
- * the way into the WC to get the previous URL so we can do a
- * differential GET with the base URL.
- */
- if ((! info->delta_base) && (ctx->sess->wc_callbacks->get_wc_prop))
- {
- SVN_ERR(ctx->sess->wc_callbacks->get_wc_prop(
- ctx->sess->wc_callback_baton, info->name,
- SVN_RA_SERF__WC_CHECKED_IN_URL, &info->delta_base, info->pool));
- }
+ const char *repos_relpath;
-#if 0 /* ### FIXME: Something's not quite right with this algorithm.
- ### Would be great to figure out the problem and correct it,
- ### but that'll only bring a performance enhancement to the
- ### technical correctness of not falling back to this URL
- ### construction. Motivation is low on this, though, because
- ### HTTP v2 won't hit this block. */
-
- /* STILL no base URL? Well, all else has failed, but we can
- * manually reconstruct the base URL. This avoids us having to
- * grab two full-text for URL<->URL diffs. Instead, we can just
- * grab one full-text and a diff from the server against that
- * other file.
- */
- if (! info->delta_base)
- {
- const char *c;
- apr_size_t comp_count;
- svn_stringbuf_t *path;
-
- c = svn_ra_serf__get_ver_prop(info->props, info->base_name,
- info->base_rev, "DAV:", "checked-in");
-
- path = svn_stringbuf_create(c, info->pool);
-
- comp_count = svn_path_component_count(info->name);
-
- svn_path_remove_components(path, comp_count);
-
- /* Find out the difference of the destination compared to
- * the repos root url. Cut off this difference from path,
- * which will give us our version resource root path.
- *
- * Example:
- * path:
- * /repositories/log_tests-17/!svn/ver/4/branches/a
- * repos_root:
- * http://localhost/repositories/log_tests-17
- * destination:
- * http://localhost/repositories/log_tests-17/branches/a
- *
- * So, find 'branches/a' as the difference. Cutting it off
- * path, gives us:
- * /repositories/log_tests-17/!svn/ver/4
+ /* If this file is switched vs the editor root we should provide
+ its real url instead of the one calculated from the session root.
*/
- if (ctx->destination &&
- strcmp(ctx->destination, ctx->sess->repos_root_str) != 0)
- {
- apr_size_t root_count, src_count;
-
- src_count = svn_path_component_count(ctx->destination);
- root_count = svn_path_component_count(ctx->sess->repos_root_str);
+ repos_relpath = apr_hash_get(ctx->switched_paths, info->name,
+ APR_HASH_KEY_STRING);
- svn_path_remove_components(path, src_count - root_count);
- }
-
- /* At this point, we should just have the version number
- * remaining. We know our target revision, so we'll replace it
- * and recreate what we just chopped off.
- */
- svn_path_remove_component(path);
-
- svn_path_add_component(path, apr_ltoa(info->pool, info->base_rev));
-
- /* Similar as above, we now have to add the relative path between
- * source and root path.
- *
- * Example:
- * path:
- * /repositories/log_tests-17/!svn/ver/2
- * repos_root path:
- * /repositories/log_tests-17
- * source:
- * /repositories/log_tests-17/trunk
- *
- * So, find 'trunk' as the difference. Addding it to path, gives us:
- * /repositories/log_tests-17/!svn/ver/2/trunk
- */
- if (strcmp(ctx->source, ctx->sess->repos_root.path) != 0)
+ if (!repos_relpath)
{
- apr_size_t root_len;
-
- root_len = strlen(ctx->sess->repos_root.path) + 1;
+ if (ctx->root_is_switched)
+ {
+ /* We are updating a direct target (most likely a file)
+ that is switched vs its parent url */
+ SVN_ERR_ASSERT(*svn_relpath_dirname(info->name, info->pool)
+ == '\0');
- svn_path_add_component(path, &ctx->source[root_len]);
+ repos_relpath = apr_hash_get(ctx->switched_paths, "",
+ APR_HASH_KEY_STRING);
+ }
+ else
+ repos_relpath = svn_relpath_join(info->dir->repos_relpath,
+ info->base_name, info->pool);
}
- /* Re-add the filename. */
- svn_path_add_component(path, info->name);
+ info->delta_base = apr_psprintf(info->pool, "%s/%ld/%s",
+ ctx->sess->rev_root_stub,
+ info->base_rev,
+ svn_path_uri_encode(repos_relpath,
+ info->pool));
+ }
+ else if (ctx->sess->wc_callbacks->get_wc_prop)
+ {
+ /* If we have a WC, we might be able to dive all the way into the WC
+ * to get the previous URL so we can do a differential GET with the
+ * base URL.
+ */
+ const svn_string_t *value = NULL;
+ SVN_ERR(ctx->sess->wc_callbacks->get_wc_prop(
+ ctx->sess->wc_callback_baton, info->name,
+ SVN_RA_SERF__WC_CHECKED_IN_URL, &value, info->pool));
- info->delta_base = svn_string_create_from_buf(path, info->pool);
+ info->delta_base = value ? value->data : NULL;
}
-#endif
SVN_ERR(fetch_file(ctx, info));
svn_ra_serf__xml_pop_state(parser);
@@ -2202,11 +2172,18 @@ link_path(void *report_baton,
SVN_ERR(svn_io_file_write_full(report->body_file, buf->data, buf->len,
NULL, pool));
+ /* Store the switch roots to allow generating repos_relpaths from just
+ the working copy paths. (Needed for HTTPv2) */
+ path = apr_pstrdup(report->pool, path);
+ apr_hash_set(report->switched_paths, path, APR_HASH_KEY_STRING,
+ apr_pstrdup(report->pool, link+1));
+
+ if (!*path)
+ report->root_is_switched = TRUE;
+
if (lock_token)
{
- apr_hash_set(report->lock_path_tokens,
- apr_pstrdup(report->pool, path),
- APR_HASH_KEY_STRING,
+ apr_hash_set(report->lock_path_tokens, path, APR_HASH_KEY_STRING,
apr_pstrdup(report->pool, lock_token));
}
@@ -2627,6 +2604,7 @@ make_update_reporter(svn_ra_session_t *r
report->send_copyfrom_args = send_copyfrom_args;
report->text_deltas = text_deltas;
report->lock_path_tokens = apr_hash_make(report->pool);
+ report->switched_paths = apr_hash_make(report->pool);
report->source = src_path;
report->destination = dest_path;
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/util.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/util.c Tue Jul 19 23:05:44 2011
@@ -102,6 +102,9 @@ struct svn_ra_serf__pending_t {
into a temporary file. */
#define SPILL_SIZE 1000000
+/* See notes/ra-serf-testing.txt for some information on testing this
+ new "paused" feature. */
+
static const apr_uint32_t serf_failure_map[][2] =
@@ -197,7 +200,9 @@ ssl_server_cert(void *baton, int failure
const char *realmstring;
apr_uint32_t svn_failures;
apr_hash_t *issuer, *subject, *serf_cert;
+ apr_array_header_t *san;
void *creds;
+ int found_matching_hostname = 0;
/* Implicitly approve any non-server certs. */
if (serf_ssl_cert_depth(cert) > 0)
@@ -211,6 +216,7 @@ ssl_server_cert(void *baton, int failure
serf_cert = serf_ssl_cert_certificate(cert, scratch_pool);
cert_info.hostname = apr_hash_get(subject, "CN", APR_HASH_KEY_STRING);
+ san = apr_hash_get(serf_cert, "subjectAltName", APR_HASH_KEY_STRING);
cert_info.fingerprint = apr_hash_get(serf_cert, "sha1", APR_HASH_KEY_STRING);
if (! cert_info.fingerprint)
cert_info.fingerprint = apr_pstrdup(scratch_pool, "<unknown>");
@@ -227,8 +233,22 @@ ssl_server_cert(void *baton, int failure
svn_failures = ssl_convert_serf_failures(failures);
+ /* Try to find matching server name via subjectAltName first... */
+ if (san) {
+ int i;
+ for (i = 0; i < san->nelts; i++) {
+ char *s = APR_ARRAY_IDX(san, i, char*);
+ if (apr_fnmatch(s, conn->hostinfo,
+ APR_FNM_PERIOD) == APR_SUCCESS) {
+ found_matching_hostname = 1;
+ cert_info.hostname = s;
+ break;
+ }
+ }
+ }
+
/* Match server certificate CN with the hostname of the server */
- if (cert_info.hostname)
+ if (!found_matching_hostname && cert_info.hostname)
{
if (apr_fnmatch(cert_info.hostname, conn->hostinfo,
APR_FNM_PERIOD) == APR_FNM_NOMATCH)
@@ -343,6 +363,10 @@ conn_setup(apr_socket_t *sock,
{
conn->ssl_context = serf_bucket_ssl_encrypt_context_get(*read_bkt);
+#if SERF_VERSION_AT_LEAST(1,0,0)
+ serf_ssl_set_hostname(conn->ssl_context, conn->hostinfo);
+#endif
+
serf_ssl_client_cert_provider_set(conn->ssl_context,
svn_ra_serf__handle_client_cert,
conn, conn->session->pool);
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_svn/client.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_svn/client.c Tue Jul 19 23:05:44 2011
@@ -1185,7 +1185,7 @@ static svn_error_t *ra_svn_get_mergeinfo
const apr_array_header_t *paths,
svn_revnum_t revision,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t *validate_inherited_mergeinfo,
+ svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool)
{
@@ -1195,7 +1195,6 @@ static svn_error_t *ra_svn_get_mergeinfo
apr_array_header_t *mergeinfo_tuple;
svn_ra_svn_item_t *elt;
const char *path;
- apr_uint64_t validated_inherited_mergeinfo;
SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "w((!", "get-mergeinfo"));
for (i = 0; i < paths->nelts; i++)
@@ -1206,14 +1205,10 @@ static svn_error_t *ra_svn_get_mergeinfo
SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!)(?r)wbb)", revision,
svn_inheritance_to_word(inherit),
include_descendants,
- *validate_inherited_mergeinfo));
+ validate_inherited_mergeinfo));
SVN_ERR(handle_auth_request(sess_baton, pool));
- SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, "l?B", &mergeinfo_tuple,
- &validated_inherited_mergeinfo));
-
- *validate_inherited_mergeinfo =
- (optbool_to_tristate(validated_inherited_mergeinfo) == svn_tristate_true);
+ SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, "l", &mergeinfo_tuple));
*catalog = NULL;
if (mergeinfo_tuple->nelts > 0)
@@ -2471,6 +2466,10 @@ static svn_error_t *ra_svn_has_capabilit
*has = svn_ra_svn_has_capability(sess->conn, SVN_RA_SVN_CAP_DEPTH);
else if (strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
*has = svn_ra_svn_has_capability(sess->conn, SVN_RA_SVN_CAP_MERGEINFO);
+ else if (strcmp(capability,
+ SVN_RA_SVN_CAP_VALIDATE_INHERITED_MERGEINFO) == 0)
+ *has = svn_ra_svn_has_capability(
+ sess->conn, SVN_RA_SVN_CAP_VALIDATE_INHERITED_MERGEINFO);
else if (strcmp(capability, SVN_RA_CAPABILITY_LOG_REVPROPS) == 0)
*has = svn_ra_svn_has_capability(sess->conn, SVN_RA_SVN_CAP_LOG_REVPROPS);
else if (strcmp(capability, SVN_RA_CAPABILITY_PARTIAL_REPLAY) == 0)
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_svn/editorp.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_svn/editorp.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_svn/editorp.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_svn/editorp.c Tue Jul 19 23:05:44 2011
@@ -914,6 +914,17 @@ svn_error_t *svn_ra_svn_drive_editor2(sv
}
if (ra_svn_edit_cmds[i].cmd)
err = (*ra_svn_edit_cmds[i].handler)(conn, subpool, params, &state);
+ else if (strcmp(cmd, "failure") == 0)
+ {
+ /* While not really an editor command this can occur when
+ reporter->finish_report() fails before the first editor command */
+ if (aborted)
+ *aborted = TRUE;
+ err = svn_ra_svn__handle_failure_status(params, pool);
+ return svn_error_compose_create(
+ err,
+ editor->abort_edit(edit_baton, subpool));
+ }
else
{
err = svn_error_createf(SVN_ERR_RA_SVN_UNKNOWN_CMD, NULL,
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_svn/marshal.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_svn/marshal.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_svn/marshal.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_svn/marshal.c Tue Jul 19 23:05:44 2011
@@ -44,6 +44,7 @@
#include "private/svn_string_private.h"
#include "private/svn_dep_compat.h"
+#include "private/svn_error_private.h"
#define svn_iswhitespace(c) ((c) == ' ' || (c) == '\n')
@@ -1096,7 +1097,14 @@ svn_error_t *svn_ra_svn_write_cmd_failur
SVN_ERR(svn_ra_svn_start_list(conn, pool));
for (; err; err = err->child)
{
- const char *msg = svn_err_best_message(err, buffer, sizeof(buffer));
+ const char *msg;
+
+#ifdef SVN_ERR__TRACING
+ if (svn_error__is_tracing_link(err))
+ msg = err->message;
+ else
+#endif
+ msg = svn_err_best_message(err, buffer, sizeof(buffer));
/* The message string should have been optional, but we can't
easily change that, so marshal nonexistent messages as "". */
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_svn/protocol
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_svn/protocol?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_svn/protocol (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_svn/protocol Tue Jul 19 23:05:44 2011
@@ -202,6 +202,11 @@ capability and C indicates a client capa
[S] atomic-revprops If the server presents this capability, it
supports the change-rev-prop2 command.
See section 3.1.1.
+[S] validate-inherited-mergeinfo If the server presents this capability, it
+ understands the optional
+ validate-inherited-mergeinfo parameter in
+ the get-mergeinfo command. See section
+ 3.1.1.
3. Commands
-----------
@@ -325,7 +330,8 @@ second place for auth-request point as n
get-mergeinfo
params: ( ( path:string ... ) [ rev:number ] inherit:word
- descendents:bool)
+ descendents:bool
+ ? validate-inherited-mergeinfo:bool)
response: ( ( ( path:string merge-info:string ) ... ) )
New in svn 1.5. If no paths are specified, an empty response is
returned. If rev is not specified, the youngest revision is used.
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/commit.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/commit.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/commit.c Tue Jul 19 23:05:44 2011
@@ -531,39 +531,6 @@ open_file(const char *path,
}
-/* Verify the mergeinfo property value VALUE and return an error if it
- * is invalid. The PATH on which that property is set is used for error
- * messages only. Use SCRATCH_POOL for temporary allocations. */
-static svn_error_t *
-verify_mergeinfo(const svn_string_t *value,
- const char *path,
- apr_pool_t *scratch_pool)
-{
- svn_error_t *err;
- svn_mergeinfo_t mergeinfo;
-
- /* It's okay to delete svn:mergeinfo. */
- if (value == NULL)
- return SVN_NO_ERROR;
-
- /* Mergeinfo is UTF-8 encoded so the number of bytes returned by strlen()
- * should match VALUE->LEN. Prevents trailing garbage in the property. */
- if (strlen(value->data) != value->len)
- return svn_error_createf(SVN_ERR_MERGEINFO_PARSE_ERROR, NULL,
- _("Commit rejected because mergeinfo on '%s' "
- "contains unexpected string terminator"),
- path);
-
- err = svn_mergeinfo_parse(&mergeinfo, value->data, scratch_pool);
- if (err)
- return svn_error_createf(err->apr_err, err,
- _("Commit rejected because mergeinfo on '%s' "
- "is syntactically invalid"),
- path);
- return SVN_NO_ERROR;
-}
-
-
static svn_error_t *
change_file_prop(void *file_baton,
const char *name,
@@ -577,9 +544,6 @@ change_file_prop(void *file_baton,
SVN_ERR(check_authz(eb, fb->path, eb->txn_root,
svn_authz_write, pool));
- if (value && strcmp(name, SVN_PROP_MERGEINFO) == 0)
- SVN_ERR(verify_mergeinfo(value, fb->path, pool));
-
return svn_repos_fs_change_node_prop(eb->txn_root, fb->path,
name, value, pool);
}
@@ -638,9 +602,6 @@ change_dir_prop(void *dir_baton,
return out_of_date(db->path, svn_node_dir);
}
- if (value && strcmp(name, SVN_PROP_MERGEINFO) == 0)
- SVN_ERR(verify_mergeinfo(value, db->path, pool));
-
return svn_repos_fs_change_node_prop(eb->txn_root, db->path,
name, value, pool);
}
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/deprecated.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/deprecated.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/deprecated.c Tue Jul 19 23:05:44 2011
@@ -429,9 +429,9 @@ svn_repos_fs_get_locks(apr_hash_t **lock
apr_pool_t *pool)
{
return svn_error_trace(svn_repos_fs_get_locks2(locks, repos, path,
- svn_depth_infinity,
- authz_read_func,
- authz_read_baton, pool));
+ svn_depth_infinity,
+ authz_read_func,
+ authz_read_baton, pool));
}
@@ -677,18 +677,18 @@ svn_repos_dump_fs2(svn_repos_t *repos,
apr_pool_t *pool)
{
return svn_error_trace(svn_repos_dump_fs3(repos,
- stream,
- start_rev,
- end_rev,
- incremental,
- use_deltas,
- feedback_stream
- ? repos_notify_handler
- : NULL,
- feedback_stream,
- cancel_func,
- cancel_baton,
- pool));
+ stream,
+ start_rev,
+ end_rev,
+ incremental,
+ use_deltas,
+ feedback_stream
+ ? repos_notify_handler
+ : NULL,
+ feedback_stream,
+ cancel_func,
+ cancel_baton,
+ pool));
}
svn_error_t *
@@ -701,15 +701,15 @@ svn_repos_verify_fs(svn_repos_t *repos,
apr_pool_t *pool)
{
return svn_error_trace(svn_repos_verify_fs2(repos,
- start_rev,
- end_rev,
- feedback_stream
- ? repos_notify_handler
- : NULL,
- feedback_stream,
- cancel_func,
- cancel_baton,
- pool));
+ start_rev,
+ end_rev,
+ feedback_stream
+ ? repos_notify_handler
+ : NULL,
+ feedback_stream,
+ cancel_func,
+ cancel_baton,
+ pool));
}
/*** From load.c ***/
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/dump.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/dump.c Tue Jul 19 23:05:44 2011
@@ -714,7 +714,7 @@ open_directory(const char *path,
/* If the parent directory has explicit comparison path and rev,
record the same for this one. */
- if (pb && ARE_VALID_COPY_ARGS(pb->cmp_path, pb->cmp_rev))
+ if (ARE_VALID_COPY_ARGS(pb->cmp_path, pb->cmp_rev))
{
cmp_path = svn_relpath_join(pb->cmp_path,
svn_relpath_basename(path, pool), pool);
@@ -811,7 +811,7 @@ open_file(const char *path,
/* If the parent directory has explicit comparison path and rev,
record the same for this one. */
- if (pb && ARE_VALID_COPY_ARGS(pb->cmp_path, pb->cmp_rev))
+ if (ARE_VALID_COPY_ARGS(pb->cmp_path, pb->cmp_rev))
{
cmp_path = svn_relpath_join(pb->cmp_path,
svn_relpath_basename(path, pool), pool);
@@ -1282,6 +1282,11 @@ svn_repos_verify_fs2(svn_repos_t *repos,
"(youngest revision is %ld)"),
end_rev, youngest);
+ /* Verify global/auxiliary data before verifying revisions. */
+ if (start_rev == 0)
+ SVN_ERR(svn_fs_verify(svn_fs_path(fs, pool), cancel_func, cancel_baton,
+ pool));
+
/* Create a notify object that we can reuse within the loop. */
if (notify_func)
notify = svn_repos_notify_create(svn_repos_notify_verify_rev_end,
@@ -1329,10 +1334,11 @@ svn_repos_verify_fs2(svn_repos_t *repos,
/* We're done. */
if (notify_func)
{
- notify = svn_repos_notify_create(svn_repos_notify_dump_end, iterpool);
+ notify = svn_repos_notify_create(svn_repos_notify_verify_end, iterpool);
notify_func(notify_baton, notify, iterpool);
}
+ /* Per-backend verification. */
svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/fs-wrap.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/fs-wrap.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/fs-wrap.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/fs-wrap.c Tue Jul 19 23:05:44 2011
@@ -215,6 +215,39 @@ svn_repos__validate_prop(const char *nam
}
+/* Verify the mergeinfo property value VALUE and return an error if it
+ * is invalid. The PATH on which that property is set is used for error
+ * messages only. Use SCRATCH_POOL for temporary allocations. */
+static svn_error_t *
+verify_mergeinfo(const svn_string_t *value,
+ const char *path,
+ apr_pool_t *scratch_pool)
+{
+ svn_error_t *err;
+ svn_mergeinfo_t mergeinfo;
+
+ /* It's okay to delete svn:mergeinfo. */
+ if (value == NULL)
+ return SVN_NO_ERROR;
+
+ /* Mergeinfo is UTF-8 encoded so the number of bytes returned by strlen()
+ * should match VALUE->LEN. Prevents trailing garbage in the property. */
+ if (strlen(value->data) != value->len)
+ return svn_error_createf(SVN_ERR_MERGEINFO_PARSE_ERROR, NULL,
+ _("Commit rejected because mergeinfo on '%s' "
+ "contains unexpected string terminator"),
+ path);
+
+ err = svn_mergeinfo_parse(&mergeinfo, value->data, scratch_pool);
+ if (err)
+ return svn_error_createf(err->apr_err, err,
+ _("Commit rejected because mergeinfo on '%s' "
+ "is syntactically invalid"),
+ path);
+ return SVN_NO_ERROR;
+}
+
+
svn_error_t *
svn_repos_fs_change_node_prop(svn_fs_root_t *root,
const char *path,
@@ -222,6 +255,9 @@ svn_repos_fs_change_node_prop(svn_fs_roo
const svn_string_t *value,
apr_pool_t *pool)
{
+ if (value && strcmp(name, SVN_PROP_MERGEINFO) == 0)
+ SVN_ERR(verify_mergeinfo(value, path, pool));
+
/* Validate the property, then call the wrapped function. */
SVN_ERR(svn_repos__validate_prop(name, value, pool));
return svn_fs_change_node_prop(root, path, name, value, pool);
@@ -676,12 +712,12 @@ svn_repos_fs_get_mergeinfo(svn_mergeinfo
apr_pool_t *pool)
{
return svn_error_trace(svn_repos_fs_get_mergeinfo2(mergeinfo, repos,
- paths, rev, inherit,
- FALSE,
- include_descendants,
- authz_read_func,
- authz_read_baton,
- pool));
+ paths, rev, inherit,
+ FALSE,
+ include_descendants,
+ authz_read_func,
+ authz_read_baton,
+ pool));
}
struct pack_notify_baton
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/hooks.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/hooks.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/hooks.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/hooks.c Tue Jul 19 23:05:44 2011
@@ -616,8 +616,20 @@ svn_repos__hooks_pre_lock(svn_repos_t *r
SVN_ERR(run_hook_cmd(&buf, SVN_REPOS__HOOK_PRE_LOCK, hook, args, NULL,
pool));
+
if (token)
- *token = buf->data;
+ {
+ svn_error_t *err;
+ /* Convert hook output from native encoding to UTF-8. */
+ err = svn_utf_cstring_to_utf8(token, buf->data, pool);
+ if (err)
+ {
+ return svn_error_create(SVN_ERR_REPOS_HOOK_FAILURE, err,
+ _("Output of pre-lock hook could not be "
+ "translated from the native locale to "
+ "UTF-8."));
+ }
+ }
}
else if (token)
*token = "";
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/load-fs-vtable.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/load-fs-vtable.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/load-fs-vtable.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/load-fs-vtable.c Tue Jul 19 23:05:44 2011
@@ -181,6 +181,8 @@ change_node_prop(svn_fs_root_t *txn_root
/* Prepend the mergeinfo source paths in MERGEINFO_ORIG with PARENT_DIR, and
return it in *MERGEINFO_VAL. */
+/* ### FIXME: Consider somehow sharing code with
+ ### svnrdump/load_editor.c:prefix_mergeinfo_paths() */
static svn_error_t *
prefix_mergeinfo_paths(svn_string_t **mergeinfo_val,
const svn_string_t *mergeinfo_orig,
@@ -214,6 +216,8 @@ prefix_mergeinfo_paths(svn_string_t **me
/* Examine the mergeinfo in INITIAL_VAL, renumber revisions in rangelists
as appropriate, and return the (possibly new) mergeinfo in *FINAL_VAL
(allocated from POOL). */
+/* ### FIXME: Consider somehow sharing code with
+ ### svnrdump/load_editor.c:renumber_mergeinfo_revs() */
static svn_error_t *
renumber_mergeinfo_revs(svn_string_t **final_val,
const svn_string_t *initial_val,
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/log.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/log.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/log.c Tue Jul 19 23:05:44 2011
@@ -522,41 +522,37 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
svn_mergeinfo_catalog_t *added_mergeinfo_catalog,
svn_fs_t *fs,
svn_revnum_t rev,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
apr_hash_t *changes;
svn_fs_root_t *root;
- apr_pool_t *subpool = NULL, *iterpool;
+ apr_pool_t *iterpool;
apr_hash_index_t *hi;
/* Initialize return variables. */
- *deleted_mergeinfo_catalog = apr_hash_make(pool);
- *added_mergeinfo_catalog = apr_hash_make(pool);
+ *deleted_mergeinfo_catalog = apr_hash_make(result_pool);
+ *added_mergeinfo_catalog = apr_hash_make(result_pool);
/* Revision 0 has no mergeinfo and no mergeinfo changes. */
if (rev == 0)
return SVN_NO_ERROR;
- subpool = svn_pool_create(pool);
-
/* We're going to use the changed-paths information for REV to
narrow down our search. */
- SVN_ERR(svn_fs_revision_root(&root, fs, rev, subpool));
- SVN_ERR(svn_fs_paths_changed2(&changes, root, subpool));
+ SVN_ERR(svn_fs_revision_root(&root, fs, rev, scratch_pool));
+ SVN_ERR(svn_fs_paths_changed2(&changes, root, scratch_pool));
/* No changed paths? We're done. */
if (apr_hash_count(changes) == 0)
- {
- svn_pool_destroy(subpool);
- return SVN_NO_ERROR;
- }
+ return SVN_NO_ERROR;
/* Loop over changes, looking for anything that might carry an
svn:mergeinfo change and is one of our paths of interest, or a
child or [grand]parent directory thereof. */
- iterpool = svn_pool_create(subpool);
- for (hi = apr_hash_first(pool, changes); hi; hi = apr_hash_next(hi))
+ iterpool = svn_pool_create(scratch_pool);
+ for (hi = apr_hash_first(scratch_pool, changes); hi; hi = apr_hash_next(hi))
{
const void *key;
void *val;
@@ -598,7 +594,7 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
root, changed_path, iterpool));
if (copyfrom_path && SVN_IS_VALID_REVNUM(copyfrom_rev))
{
- base_path = apr_pstrdup(subpool, copyfrom_path);
+ base_path = apr_pstrdup(scratch_pool, copyfrom_path);
base_rev = copyfrom_rev;
}
break;
@@ -667,9 +663,9 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
svn_mergeinfo_catalog_t tmp_catalog;
APR_ARRAY_PUSH(query_paths, const char *) = changed_path;
- SVN_ERR(svn_fs_get_mergeinfo(&tmp_catalog, root,
- query_paths, svn_mergeinfo_inherited,
- FALSE, iterpool));
+ SVN_ERR(svn_fs_get_mergeinfo2(&tmp_catalog, root,
+ query_paths, svn_mergeinfo_inherited,
+ FALSE, FALSE, iterpool));
tmp_mergeinfo = apr_hash_get(tmp_catalog, changed_path,
APR_HASH_KEY_STRING);
if (tmp_mergeinfo)
@@ -686,9 +682,9 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
svn_mergeinfo_catalog_t tmp_catalog;
APR_ARRAY_PUSH(query_paths, const char *) = base_path;
- SVN_ERR(svn_fs_get_mergeinfo(&tmp_catalog, base_root,
- query_paths, svn_mergeinfo_inherited,
- FALSE, iterpool));
+ SVN_ERR(svn_fs_get_mergeinfo2(&tmp_catalog, base_root,
+ query_paths, svn_mergeinfo_inherited,
+ FALSE, FALSE, iterpool));
tmp_mergeinfo = apr_hash_get(tmp_catalog, base_path,
APR_HASH_KEY_STRING);
if (tmp_mergeinfo)
@@ -719,15 +715,17 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
mergeinfo, FALSE, iterpool));
/* Toss interesting stuff into our return catalogs. */
- hash_path = apr_pstrdup(pool, changed_path);
+ hash_path = apr_pstrdup(result_pool, changed_path);
apr_hash_set(*deleted_mergeinfo_catalog, hash_path,
- APR_HASH_KEY_STRING, svn_mergeinfo_dup(deleted, pool));
+ APR_HASH_KEY_STRING, svn_mergeinfo_dup(deleted,
+ result_pool));
apr_hash_set(*added_mergeinfo_catalog, hash_path,
- APR_HASH_KEY_STRING, svn_mergeinfo_dup(added, pool));
+ APR_HASH_KEY_STRING, svn_mergeinfo_dup(added,
+ result_pool));
}
}
- /* ### UNNECESSARY ###: svn_pool_destroy(iterpool); */
- svn_pool_destroy(subpool);
+
+ svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}
@@ -742,18 +740,19 @@ get_combined_mergeinfo_changes(svn_merge
svn_fs_t *fs,
const apr_array_header_t *paths,
svn_revnum_t rev,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_mergeinfo_catalog_t added_mergeinfo_catalog, deleted_mergeinfo_catalog;
apr_hash_index_t *hi;
svn_fs_root_t *root;
- apr_pool_t *subpool, *iterpool;
+ apr_pool_t *iterpool;
int i;
svn_error_t *err;
/* Initialize return value. */
- *added_mergeinfo = apr_hash_make(pool);
- *deleted_mergeinfo = apr_hash_make(pool);
+ *added_mergeinfo = apr_hash_make(result_pool);
+ *deleted_mergeinfo = apr_hash_make(result_pool);
/* If we're asking about revision 0, there's no mergeinfo to be found. */
if (rev == 0)
@@ -764,13 +763,12 @@ get_combined_mergeinfo_changes(svn_merge
return SVN_NO_ERROR;
/* Create a work subpool and get a root for REV. */
- subpool = svn_pool_create(pool);
- SVN_ERR(svn_fs_revision_root(&root, fs, rev, subpool));
+ SVN_ERR(svn_fs_revision_root(&root, fs, rev, scratch_pool));
/* Fetch the mergeinfo changes for REV. */
err = fs_mergeinfo_changed(&deleted_mergeinfo_catalog,
&added_mergeinfo_catalog,
- fs, rev, subpool);
+ fs, rev, scratch_pool, scratch_pool);
if (err)
{
if (err->apr_err == SVN_ERR_MERGEINFO_PARSE_ERROR)
@@ -779,7 +777,6 @@ get_combined_mergeinfo_changes(svn_merge
best we can do is ignore it and act as if there were
no mergeinfo modifications. */
svn_error_clear(err);
- svn_pool_destroy(subpool);
return SVN_NO_ERROR;
}
else
@@ -791,7 +788,7 @@ get_combined_mergeinfo_changes(svn_merge
/* Check our PATHS for any changes to their inherited mergeinfo.
(We deal with changes to mergeinfo directly *on* the paths in the
following loop.) */
- iterpool = svn_pool_create(subpool);
+ iterpool = svn_pool_create(scratch_pool);
for (i = 0; i < paths->nelts; i++)
{
const char *path = APR_ARRAY_IDX(paths, i, const char *);
@@ -838,8 +835,9 @@ get_combined_mergeinfo_changes(svn_merge
SVN_ERR(svn_fs_revision_root(&prev_root, fs, prev_rev, iterpool));
query_paths = apr_array_make(iterpool, 1, sizeof(const char *));
APR_ARRAY_PUSH(query_paths, const char *) = prev_path;
- err = svn_fs_get_mergeinfo(&catalog, prev_root, query_paths,
- svn_mergeinfo_inherited, FALSE, iterpool);
+ err = svn_fs_get_mergeinfo2(&catalog, prev_root, query_paths,
+ svn_mergeinfo_inherited, FALSE, FALSE,
+ iterpool);
if (err && (err->apr_err == SVN_ERR_FS_NOT_FOUND ||
err->apr_err == SVN_ERR_FS_NOT_DIRECTORY ||
err->apr_err == SVN_ERR_MERGEINFO_PARSE_ERROR))
@@ -854,23 +852,26 @@ get_combined_mergeinfo_changes(svn_merge
/* Fetch the current mergeinfo (as of REV, and including
inherited stuff) for this path. */
APR_ARRAY_IDX(query_paths, 0, const char *) = path;
- SVN_ERR(svn_fs_get_mergeinfo(&catalog, root, query_paths,
- svn_mergeinfo_inherited, FALSE, iterpool));
+ SVN_ERR(svn_fs_get_mergeinfo2(&catalog, root, query_paths,
+ svn_mergeinfo_inherited, FALSE, FALSE,
+ iterpool));
mergeinfo = apr_hash_get(catalog, path, APR_HASH_KEY_STRING);
/* Compare, constrast, and combine the results. */
SVN_ERR(svn_mergeinfo_diff(&deleted, &added, prev_mergeinfo,
mergeinfo, FALSE, iterpool));
SVN_ERR(svn_mergeinfo_merge(*deleted_mergeinfo,
- svn_mergeinfo_dup(deleted, pool), pool));
+ svn_mergeinfo_dup(deleted, result_pool),
+ result_pool));
SVN_ERR(svn_mergeinfo_merge(*added_mergeinfo,
- svn_mergeinfo_dup(added, pool), pool));
+ svn_mergeinfo_dup(added, result_pool),
+ result_pool));
}
svn_pool_destroy(iterpool);
/* Merge all the mergeinfos which are, or are children of, one of
our paths of interest into one giant delta mergeinfo. */
- for (hi = apr_hash_first(subpool, added_mergeinfo_catalog);
+ for (hi = apr_hash_first(scratch_pool, added_mergeinfo_catalog);
hi; hi = apr_hash_next(hi))
{
const void *key;
@@ -891,16 +892,16 @@ get_combined_mergeinfo_changes(svn_merge
continue;
deleted = apr_hash_get(deleted_mergeinfo_catalog, key, klen);
SVN_ERR(svn_mergeinfo_merge(*deleted_mergeinfo,
- svn_mergeinfo_dup(deleted, pool),
- pool));
+ svn_mergeinfo_dup(deleted, result_pool),
+ result_pool));
SVN_ERR(svn_mergeinfo_merge(*added_mergeinfo,
- svn_mergeinfo_dup(added, pool),
- pool));
+ svn_mergeinfo_dup(added, result_pool),
+ result_pool));
break;
}
}
- svn_pool_clear(subpool);
+
return SVN_NO_ERROR;
}
@@ -1750,7 +1751,8 @@ do_logs(svn_fs_t *fs,
SVN_ERR(get_combined_mergeinfo_changes(&added_mergeinfo,
&deleted_mergeinfo,
fs, cur_paths,
- current, iterpool));
+ current, iterpool,
+ iterpool));
has_children = (apr_hash_count(added_mergeinfo) > 0
|| apr_hash_count(deleted_mergeinfo) > 0);
}
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/reporter.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/reporter.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/reporter.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/reporter.c Tue Jul 19 23:05:44 2011
@@ -1331,9 +1331,12 @@ finish_report(report_baton_t *b, apr_poo
{
svn_error_t *err = drive(b, s_rev, info, pool);
if (err == SVN_NO_ERROR)
- return b->editor->close_edit(b->edit_baton, pool);
- svn_error_clear(b->editor->abort_edit(b->edit_baton, pool));
- return svn_error_trace(err);
+ return svn_error_trace(b->editor->close_edit(b->edit_baton, pool));
+
+ return svn_error_trace(
+ svn_error_compose_create(err,
+ b->editor->abort_edit(b->edit_baton,
+ pool)));
}
}
@@ -1421,9 +1424,8 @@ svn_repos_finish_report(void *baton, apr
finish_err = finish_report(b, pool);
close_err = svn_io_file_close(b->tempfile, pool);
- if (finish_err)
- svn_error_clear(close_err);
- return finish_err ? finish_err : close_err;
+
+ return svn_error_trace(svn_error_compose_create(finish_err, close_err));
}
svn_error_t *
@@ -1431,7 +1433,7 @@ svn_repos_abort_report(void *baton, apr_
{
report_baton_t *b = baton;
- return svn_io_file_close(b->tempfile, pool);
+ return svn_error_trace(svn_io_file_close(b->tempfile, pool));
}
/* --- BEGINNING THE REPORT --- */
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/repos.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/repos.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/repos.c Tue Jul 19 23:05:44 2011
@@ -477,7 +477,7 @@ PREWRITTEN_HOOKS_TEXT
"# arguments:" NL
"#" NL
"# [1] REPOS-PATH (the path to this repository)" NL
-"# [2] REVISION (the revision being tweaked)" NL
+"# [2] REV (the revision being tweaked)" NL
"# [3] USER (the username of the person tweaking the property)" NL
"# [4] PROPNAME (the property being set on the revision)" NL
"# [5] ACTION (the property is being 'A'dded, 'M'odified, or 'D'eleted)"
@@ -1262,9 +1262,13 @@ svn_repos_create(svn_repos_t **repos_p,
/* If there was an error making the filesytem, e.g. unknown/supported
* filesystem type. Clean up after ourselves. Yes this is safe because
* create_repos_structure will fail if the path existed before we started
- * so we can't accidentally remove a directory that previously existed. */
- svn_error_clear(svn_io_remove_dir2(path, FALSE, NULL, NULL, pool));
- return svn_error_trace(err);
+ * so we can't accidentally remove a directory that previously existed.
+ */
+
+ return svn_error_trace(
+ svn_error_compose_create(
+ err,
+ svn_io_remove_dir2(path, FALSE, NULL, NULL, pool)));
}
/* This repository is ready. Stamp it with a format number. */
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/rev_hunt.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/rev_hunt.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/rev_hunt.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_repos/rev_hunt.c Tue Jul 19 23:05:44 2011
@@ -997,8 +997,9 @@ get_path_mergeinfo(apr_hash_t **mergeinf
/* We do not need to call svn_repos_fs_get_mergeinfo() (which performs authz)
because we will filter out unreadable revisions in
find_interesting_revision(), above */
- SVN_ERR(svn_fs_get_mergeinfo(&tmp_catalog, root, paths,
- svn_mergeinfo_inherited, FALSE, subpool));
+ SVN_ERR(svn_fs_get_mergeinfo2(&tmp_catalog, root, paths,
+ svn_mergeinfo_inherited, FALSE, FALSE,
+ subpool));
*mergeinfo = apr_hash_get(tmp_catalog, path, APR_HASH_KEY_STRING);
if (*mergeinfo)
Propchange: subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/adler32.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 19 23:05:44 2011
@@ -1,3 +1,5 @@
/subversion/branches/diff-optimizations/subversion/libsvn_subr/adler32.c:1031270-1037352
/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/adler32.c:1037353-1067789
/subversion/branches/performance/subversion/libsvn_subr/adler32.c:1067697-1078365
+/subversion/branches/revprop-packing/subversion/libsvn_subr/adler32.c:1143907,1143971,1144017,1144568,1146145
+/subversion/trunk/subversion/libsvn_subr/adler32.c:1005036-1148548
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/cache-membuffer.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/cache-membuffer.c Tue Jul 19 23:05:44 2011
@@ -194,25 +194,25 @@ static void get_prefix_tail(const char *
/* Initialize all members of TAG except for the content hash.
*/
-static svn_error_t* store_key_part(entry_tag_t *tag,
+static svn_error_t *store_key_part(entry_tag_t *tag,
unsigned char *prefix_hash,
char *prefix_tail,
const void *key,
- apr_size_t size,
+ apr_size_t key_len,
apr_pool_t *pool)
{
svn_checksum_t *checksum;
SVN_ERR(svn_checksum(&checksum,
svn_checksum_md5,
key,
- size,
+ key_len,
pool));
memcpy(tag->prefix_hash, prefix_hash, sizeof(tag->prefix_hash));
memcpy(tag->key_hash, checksum->digest, sizeof(tag->key_hash));
memcpy(tag->prefix_tail, prefix_tail, sizeof(tag->prefix_tail));
- tag->key_len = size;
+ tag->key_len = key_len;
return SVN_NO_ERROR;
}
@@ -283,10 +283,11 @@ static svn_error_t* assert_equal_tags(co
#endif /* SVN_DEBUG_CACHE_MEMBUFFER */
-/* A single dictionary entry. Since they are allocated statically, these
- * entries can either be in use or in used state. An entry is unused, iff
- * the offset member is NO_OFFSET. In that case, it must not be linked in
- * the list of used entries.
+/* A single dictionary entry. Since all entries will be allocated once
+ * during cache creation, those entries might be either used or unused.
+ * An entry is used if and only if it is contained in the doubly-linked
+ * list of used entries. An entry is unused if and only if its OFFSET
+ * member is NO_OFFSET.
*/
typedef struct entry_t
{
@@ -395,7 +396,7 @@ struct svn_membuffer_t
/* Number of used dictionary entries, i.e. number of cached items.
- * In conjunction with hit_cout, this is used calculate the average
+ * In conjunction with hit_count, this is used calculate the average
* hit count as part of the randomized LFU algorithm.
*/
apr_uint32_t used_entries;
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/deprecated.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/deprecated.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/deprecated.c Tue Jul 19 23:05:44 2011
@@ -129,7 +129,7 @@ svn_subst_translate_stream3(svn_stream_t
keywords, expand, pool);
return svn_error_trace(svn_stream_copy3(src_stream, dst_stream,
- NULL, NULL, pool));
+ NULL, NULL, pool));
}
svn_error_t *
@@ -144,7 +144,7 @@ svn_subst_translate_stream2(svn_stream_t
apr_hash_t *kh = kwstruct_to_kwhash(keywords, pool);
return svn_error_trace(svn_subst_translate_stream3(s, d, eol_str, repair,
- kh, expand, pool));
+ kh, expand, pool));
}
svn_error_t *
@@ -174,8 +174,8 @@ svn_subst_translate_cstring(const char *
apr_hash_t *kh = kwstruct_to_kwhash(keywords, pool);
return svn_error_trace(svn_subst_translate_cstring2(src, dst, eol_str,
- repair, kh, expand,
- pool));
+ repair, kh, expand,
+ pool));
}
svn_error_t *
@@ -188,8 +188,8 @@ svn_subst_copy_and_translate(const char
apr_pool_t *pool)
{
return svn_error_trace(svn_subst_copy_and_translate2(src, dst, eol_str,
- repair, keywords,
- expand, FALSE, pool));
+ repair, keywords,
+ expand, FALSE, pool));
}
svn_error_t *
@@ -205,8 +205,8 @@ svn_subst_copy_and_translate2(const char
apr_hash_t *kh = kwstruct_to_kwhash(keywords, pool);
return svn_error_trace(svn_subst_copy_and_translate3(src, dst, eol_str,
- repair, kh, expand,
- special, pool));
+ repair, kh, expand,
+ special, pool));
}
svn_error_t *
@@ -220,10 +220,10 @@ svn_subst_copy_and_translate3(const char
apr_pool_t *pool)
{
return svn_error_trace(svn_subst_copy_and_translate4(src, dst, eol_str,
- repair, keywords,
- expand, special,
- NULL, NULL,
- pool));
+ repair, keywords,
+ expand, special,
+ NULL, NULL,
+ pool));
}
@@ -280,10 +280,10 @@ svn_subst_stream_detranslated(svn_stream
SVN_ERR(svn_stream_open_readonly(&src_stream, src, pool, pool));
return svn_error_trace(svn_subst_stream_translated_to_normal_form(
- stream_p, src_stream,
- eol_style, eol_str,
- always_repair_eols,
- keywords, pool));
+ stream_p, src_stream,
+ eol_style, eol_str,
+ always_repair_eols,
+ keywords, pool));
}
svn_error_t *
@@ -304,13 +304,13 @@ svn_subst_translate_to_normal_form(const
return svn_error_create(SVN_ERR_IO_UNKNOWN_EOL, NULL, NULL);
return svn_error_trace(svn_subst_copy_and_translate3(
- src, dst, eol_str,
- eol_style == svn_subst_eol_style_fixed
- || always_repair_eols,
- keywords,
- FALSE /* contract keywords */,
- special,
- pool));
+ src, dst, eol_str,
+ eol_style == svn_subst_eol_style_fixed
+ || always_repair_eols,
+ keywords,
+ FALSE /* contract keywords */,
+ special,
+ pool));
}
@@ -454,7 +454,7 @@ svn_opt_args_to_target_array3(apr_array_
apr_pool_t *pool)
{
return svn_error_trace(svn_opt__args_to_target_array(targets_p, os,
- known_targets, pool));
+ known_targets, pool));
}
svn_error_t *
@@ -535,16 +535,16 @@ svn_opt_print_help2(apr_getopt_t *os,
apr_pool_t *pool)
{
return svn_error_trace(svn_opt_print_help3(os,
- pgm_name,
- print_version,
- quiet,
- version_footer,
- header,
- cmd_table,
- option_table,
- NULL,
- footer,
- pool));
+ pgm_name,
+ print_version,
+ quiet,
+ version_footer,
+ header,
+ cmd_table,
+ option_table,
+ NULL,
+ footer,
+ pool));
}
svn_error_t *
@@ -643,9 +643,9 @@ svn_io_open_unique_file2(apr_file_t **fi
svn_path_split(path, &dirpath, &filename, pool);
return svn_error_trace(svn_io_open_uniquely_named(file, temp_path,
- dirpath, filename, suffix,
- delete_when,
- pool, pool));
+ dirpath, filename, suffix,
+ delete_when,
+ pool, pool));
}
svn_error_t *
@@ -657,11 +657,11 @@ svn_io_open_unique_file(apr_file_t **fil
apr_pool_t *pool)
{
return svn_error_trace(svn_io_open_unique_file2(file, temp_path,
- path, suffix,
- delete_on_close
- ? svn_io_file_del_on_close
- : svn_io_file_del_none,
- pool));
+ path, suffix,
+ delete_on_close
+ ? svn_io_file_del_on_close
+ : svn_io_file_del_none,
+ pool));
}
svn_error_t *
@@ -681,10 +681,10 @@ svn_io_run_diff(const char *dir,
SVN_ERR(svn_path_cstring_to_utf8(&diff_cmd, diff_cmd, pool));
return svn_error_trace(svn_io_run_diff2(dir, user_args, num_user_args,
- label1, label2,
- from, to, pexitcode,
- outfile, errfile, diff_cmd,
- pool));
+ label1, label2,
+ from, to, pexitcode,
+ outfile, errfile, diff_cmd,
+ pool));
}
svn_error_t *
@@ -704,10 +704,10 @@ svn_io_run_diff3_2(int *exitcode,
SVN_ERR(svn_path_cstring_to_utf8(&diff3_cmd, diff3_cmd, pool));
return svn_error_trace(svn_io_run_diff3_3(exitcode, dir,
- mine, older, yours,
- mine_label, older_label,
- yours_label, merged,
- diff3_cmd, user_args, pool));
+ mine, older, yours,
+ mine_label, older_label,
+ yours_label, merged,
+ diff3_cmd, user_args, pool));
}
svn_error_t *
@@ -724,9 +724,9 @@ svn_io_run_diff3(const char *dir,
apr_pool_t *pool)
{
return svn_error_trace(svn_io_run_diff3_2(exitcode, dir, mine, older, yours,
- mine_label, older_label,
- yours_label,
- merged, diff3_cmd, NULL, pool));
+ mine_label, older_label,
+ yours_label,
+ merged, diff3_cmd, NULL, pool));
}
svn_error_t *
@@ -821,8 +821,8 @@ svn_io_dir_walk(const char *dirname,
baton.walk_func = walk_func;
baton.walk_baton = walk_baton;
return svn_error_trace(svn_io_dir_walk2(dirname, wanted,
- walk_func_filter_func,
- &baton, pool));
+ walk_func_filter_func,
+ &baton, pool));
}
/*** From constructors.c ***/
@@ -849,7 +849,7 @@ svn_cmdline_prompt_user(const char **res
apr_pool_t *pool)
{
return svn_error_trace(svn_cmdline_prompt_user2(result, prompt_str, NULL,
- pool));
+ pool));
}
svn_error_t *
@@ -865,10 +865,10 @@ svn_cmdline_setup_auth_baton(svn_auth_ba
apr_pool_t *pool)
{
return svn_error_trace(svn_cmdline_create_auth_baton(
- ab, non_interactive,
- auth_username, auth_password,
- config_dir, no_auth_cache, FALSE,
- cfg, cancel_func, cancel_baton, pool));
+ ab, non_interactive,
+ auth_username, auth_password,
+ config_dir, no_auth_cache, FALSE,
+ cfg, cancel_func, cancel_baton, pool));
}
/*** From dso.c ***/
@@ -973,18 +973,18 @@ svn_error_t *svn_stream_copy2(svn_stream
apr_pool_t *scratch_pool)
{
return svn_error_trace(svn_stream_copy3(
- svn_stream_disown(from, scratch_pool),
- svn_stream_disown(to, scratch_pool),
- cancel_func, cancel_baton, scratch_pool));
+ svn_stream_disown(from, scratch_pool),
+ svn_stream_disown(to, scratch_pool),
+ cancel_func, cancel_baton, scratch_pool));
}
svn_error_t *svn_stream_copy(svn_stream_t *from, svn_stream_t *to,
apr_pool_t *scratch_pool)
{
return svn_error_trace(svn_stream_copy3(
- svn_stream_disown(from, scratch_pool),
- svn_stream_disown(to, scratch_pool),
- NULL, NULL, scratch_pool));
+ svn_stream_disown(from, scratch_pool),
+ svn_stream_disown(to, scratch_pool),
+ NULL, NULL, scratch_pool));
}
svn_stream_t *
@@ -1000,10 +1000,10 @@ svn_stream_contents_same(svn_boolean_t *
apr_pool_t *pool)
{
return svn_error_trace(svn_stream_contents_same2(
- same,
- svn_stream_disown(stream1, pool),
- svn_stream_disown(stream2, pool),
- pool));
+ same,
+ svn_stream_disown(stream1, pool),
+ svn_stream_disown(stream2, pool),
+ pool));
}
/*** From path.c ***/
@@ -1056,8 +1056,8 @@ svn_mergeinfo_inheritable(svn_mergeinfo_
apr_pool_t *pool)
{
return svn_error_trace(svn_mergeinfo_inheritable2(output, mergeinfo, path,
- start, end,
- TRUE, pool, pool));
+ start, end,
+ TRUE, pool, pool));
}
svn_error_t *
@@ -1068,9 +1068,9 @@ svn_rangelist_inheritable(apr_array_head
apr_pool_t *pool)
{
return svn_error_trace(svn_rangelist_inheritable2(inheritable_rangelist,
- rangelist,
- start, end, TRUE,
- pool, pool));
+ rangelist,
+ start, end, TRUE,
+ pool, pool));
}
/*** From config.c ***/
@@ -1081,9 +1081,9 @@ svn_config_read(svn_config_t **cfgp, con
apr_pool_t *pool)
{
return svn_error_trace(svn_config_read2(cfgp, file,
- must_exist,
- FALSE,
- pool));
+ must_exist,
+ FALSE,
+ pool));
}
#ifdef SVN_DISABLE_FULL_VERSION_MATCH
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/dirent_uri.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/dirent_uri.c Tue Jul 19 23:05:44 2011
@@ -2407,6 +2407,9 @@ svn_uri_get_file_url_from_dirent(const c
dirent = svn_path_uri_encode(dirent, pool);
#ifndef SVN_USE_DOS_PATHS
+ if (dirent[0] == '/' && dirent[1] == '\0')
+ dirent = NULL; /* "file://" is the canonical form of "file:///" */
+
*url = apr_pstrcat(pool, "file://", dirent, (char *)NULL);
#else
if (dirent[0] == '/')
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/dso.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/dso.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/dso.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/dso.c Tue Jul 19 23:05:44 2011
@@ -105,7 +105,7 @@ svn_dso_load(apr_dso_handle_t **dso, con
status = apr_dso_load(dso, fname, dso_pool);
if (status)
{
-#ifdef SVN_DEBUG
+#if 0
char buf[1024];
fprintf(stderr, "%s\n", apr_dso_error(*dso, buf, 1024));
#endif
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/hash.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/hash.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/hash.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/hash.c Tue Jul 19 23:05:44 2011
@@ -25,10 +25,12 @@
#include <stdlib.h>
#include <limits.h>
+
#include <apr_version.h>
#include <apr_pools.h>
#include <apr_hash.h>
#include <apr_file_io.h>
+
#include "svn_types.h"
#include "svn_string.h"
#include "svn_error.h"
@@ -36,8 +38,12 @@
#include "svn_sorts.h"
#include "svn_io.h"
#include "svn_pools.h"
+
#include "private/svn_dep_compat.h"
+#include "svn_private_config.h"
+
+
/*
@@ -106,14 +112,16 @@ hash_read(apr_hash_t *hash, svn_stream_t
/* Check for unexpected end of stream */
if (eof)
- return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL, NULL);
+ return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
+ _("Serialized hash missing terminator"));
if ((buf->len >= 3) && (buf->data[0] == 'K') && (buf->data[1] == ' '))
{
/* Get the length of the key */
keylen = (size_t) strtoul(buf->data + 2, &end, 10);
if (keylen == (size_t) ULONG_MAX || *end != '\0')
- return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL, NULL);
+ return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
+ _("Serialized hash malformed"));
/* Now read that much into a buffer. */
keybuf = apr_palloc(pool, keylen + 1);
@@ -124,7 +132,8 @@ hash_read(apr_hash_t *hash, svn_stream_t
len = 1;
SVN_ERR(svn_stream_read(stream, &c, &len));
if (c != '\n')
- return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL, NULL);
+ return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
+ _("Serialized hash malformed"));
/* Read a val length line */
SVN_ERR(svn_stream_readline(stream, &buf, "\n", &eof, iterpool));
@@ -133,7 +142,8 @@ hash_read(apr_hash_t *hash, svn_stream_t
{
vallen = (size_t) strtoul(buf->data + 2, &end, 10);
if (vallen == (size_t) ULONG_MAX || *end != '\0')
- return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL, NULL);
+ return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
+ _("Serialized hash malformed"));
valbuf = apr_palloc(iterpool, vallen + 1);
SVN_ERR(svn_stream_read(stream, valbuf, &vallen));
@@ -143,14 +153,16 @@ hash_read(apr_hash_t *hash, svn_stream_t
len = 1;
SVN_ERR(svn_stream_read(stream, &c, &len));
if (c != '\n')
- return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL, NULL);
+ return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
+ _("Serialized hash malformed"));
/* Add a new hash entry. */
apr_hash_set(hash, keybuf, keylen,
svn_string_ncreate(valbuf, vallen, pool));
}
else
- return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL, NULL);
+ return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
+ _("Serialized hash malformed"));
}
else if (incremental && (buf->len >= 3)
&& (buf->data[0] == 'D') && (buf->data[1] == ' '))
@@ -158,7 +170,8 @@ hash_read(apr_hash_t *hash, svn_stream_t
/* Get the length of the key */
keylen = (size_t) strtoul(buf->data + 2, &end, 10);
if (keylen == (size_t) ULONG_MAX || *end != '\0')
- return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL, NULL);
+ return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
+ _("Serialized hash malformed"));
/* Now read that much into a buffer. */
keybuf = apr_palloc(iterpool, keylen + 1);
@@ -169,14 +182,16 @@ hash_read(apr_hash_t *hash, svn_stream_t
len = 1;
SVN_ERR(svn_stream_read(stream, &c, &len));
if (c != '\n')
- return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL, NULL);
+ return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
+ _("Serialized hash malformed"));
/* Remove this hash entry. */
apr_hash_set(hash, keybuf, keylen, NULL);
}
else
{
- return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL, NULL);
+ return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
+ _("Serialized hash malformed"));
}
}