Modified: subversion/branches/dump-load-cross-check/subversion/include/svn_diff.h URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/include/svn_diff.h?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/include/svn_diff.h (original) +++ subversion/branches/dump-load-cross-check/subversion/include/svn_diff.h Tue Feb 3 13:15:17 2015 @@ -475,6 +475,7 @@ typedef struct svn_diff_file_options_t * of the nearest preceding line that starts with a character that might be * the initial character of a C language identifier. The default is * @c FALSE. + * @since New in 1.5. */ svn_boolean_t show_c_function;
Modified: subversion/branches/dump-load-cross-check/subversion/include/svn_error_codes.h URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/include/svn_error_codes.h?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/include/svn_error_codes.h (original) +++ subversion/branches/dump-load-cross-check/subversion/include/svn_error_codes.h Tue Feb 3 13:15:17 2015 @@ -150,6 +150,8 @@ extern "C" { + (22 * SVN_ERR_CATEGORY_SIZE)) #define SVN_ERR_MALFUNC_CATEGORY_START (APR_OS_START_USERERR \ + (23 * SVN_ERR_CATEGORY_SIZE)) +#define SVN_ERR_X509_CATEGORY_START (APR_OS_START_USERERR \ + + (24 * SVN_ERR_CATEGORY_SIZE)) #endif /* DOXYGEN_SHOULD_SKIP_THIS */ @@ -1617,6 +1619,90 @@ SVN_ERROR_START SVN_ERR_MALFUNC_CATEGORY_START + 1, "No non-tracing links found in the error chain") + /* X509 parser errors. + * Names of these error codes are based on tropicssl error codes. + * @since New in 1.9 */ + + SVN_ERRDEF(SVN_ERR_ASN1_OUT_OF_DATA, + SVN_ERR_X509_CATEGORY_START + 0, + "Unexpected end of ASN1 data") + + SVN_ERRDEF(SVN_ERR_ASN1_UNEXPECTED_TAG, + SVN_ERR_X509_CATEGORY_START + 1, + "Unexpected ASN1 tag") + + SVN_ERRDEF(SVN_ERR_ASN1_INVALID_LENGTH, + SVN_ERR_X509_CATEGORY_START + 2, + "Invalid ASN1 length") + + SVN_ERRDEF(SVN_ERR_ASN1_LENGTH_MISMATCH, + SVN_ERR_X509_CATEGORY_START + 3, + "ASN1 length mismatch") + + SVN_ERRDEF(SVN_ERR_ASN1_INVALID_DATA, + SVN_ERR_X509_CATEGORY_START + 4, + "Invalid ASN1 data") + + SVN_ERRDEF(SVN_ERR_X509_FEATURE_UNAVAILABLE, + SVN_ERR_X509_CATEGORY_START + 5, + "Unavailable X509 feature") + + SVN_ERRDEF(SVN_ERR_X509_CERT_INVALID_PEM, + SVN_ERR_X509_CATEGORY_START + 6, + "Invalid PEM certificate") + + SVN_ERRDEF(SVN_ERR_X509_CERT_INVALID_FORMAT, + SVN_ERR_X509_CATEGORY_START + 7, + "Invalid certificate format") + + SVN_ERRDEF(SVN_ERR_X509_CERT_INVALID_VERSION, + SVN_ERR_X509_CATEGORY_START + 8, + "Invalid certificate version") + + SVN_ERRDEF(SVN_ERR_X509_CERT_INVALID_SERIAL, + SVN_ERR_X509_CATEGORY_START + 9, + "Invalid certificate serial number") + + SVN_ERRDEF(SVN_ERR_X509_CERT_INVALID_ALG, + SVN_ERR_X509_CATEGORY_START + 10, + "Found invalid algorithm in certificate") + + SVN_ERRDEF(SVN_ERR_X509_CERT_INVALID_NAME, + SVN_ERR_X509_CATEGORY_START + 11, + "Found invalid name in certificate") + + SVN_ERRDEF(SVN_ERR_X509_CERT_INVALID_DATE, + SVN_ERR_X509_CATEGORY_START + 12, + "Found invalid date in certificate") + + SVN_ERRDEF(SVN_ERR_X509_CERT_INVALID_PUBKEY, + SVN_ERR_X509_CATEGORY_START + 13, + "Found invalid public key in certificate") + + SVN_ERRDEF(SVN_ERR_X509_CERT_INVALID_SIGNATURE, + SVN_ERR_X509_CATEGORY_START + 14, + "Found invalid signature in certificate") + + SVN_ERRDEF(SVN_ERR_X509_CERT_INVALID_EXTENSIONS, + SVN_ERR_X509_CATEGORY_START + 15, + "Found invalid extensions in certificate") + + SVN_ERRDEF(SVN_ERR_X509_CERT_UNKNOWN_VERSION, + SVN_ERR_X509_CATEGORY_START + 16, + "Unknown certificate version") + + SVN_ERRDEF(SVN_ERR_X509_CERT_UNKNOWN_PK_ALG, + SVN_ERR_X509_CATEGORY_START + 17, + "Certificate uses unknown public key algorithm") + + SVN_ERRDEF(SVN_ERR_X509_CERT_SIG_MISMATCH, + SVN_ERR_X509_CATEGORY_START + 18, + "Certificate signature mismatch") + + SVN_ERRDEF(SVN_ERR_X509_CERT_VERIFY_FAILED, + SVN_ERR_X509_CATEGORY_START + 19, + "Certficate verification failed") + SVN_ERROR_END Modified: subversion/branches/dump-load-cross-check/subversion/include/svn_ra.h URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/include/svn_ra.h?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/include/svn_ra.h (original) +++ subversion/branches/dump-load-cross-check/subversion/include/svn_ra.h Tue Feb 3 13:15:17 2015 @@ -785,32 +785,6 @@ svn_ra_open(svn_ra_session_t **session_p apr_hash_t *config, apr_pool_t *pool); -/** - * Open a new ra session @a *new_session to the same repository as an existing - * ra session @a old_session, copying the callbacks, auth baton, etc. from the - * old session. This essentially limits the lifetime of the new, duplicated - * session to the lifetime of the old session. If the new session should - * outlive the new session, creating a new session using svn_ra_open4() is - * recommended. - * - * If @a session_url is not NULL, parent the new session at session_url. Note - * that @a session_url MUST BE in the same repository as @a old_session or an - * error will be returned. When @a session_url NULL the same session root - * will be used. - * - * Allocate @a new_session in @a result_pool. Perform temporary allocations - * in @a scratch_pool. - * - * @since New in 1.9. - */ -svn_error_t * -svn_ra_dup_session(svn_ra_session_t **new_session, - svn_ra_session_t *old_session, - const char *session_url, - apr_pool_t *result_pool, - apr_pool_t *scratch_pool); - - /** Change the root URL of an open @a ra_session to point to a new path in the * same repository. @a url is the new root URL. Use @a pool for * temporary allocations. Modified: subversion/branches/dump-load-cross-check/subversion/include/svn_version.h URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/include/svn_version.h?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/include/svn_version.h (original) +++ subversion/branches/dump-load-cross-check/subversion/include/svn_version.h Tue Feb 3 13:15:17 2015 @@ -306,6 +306,11 @@ typedef struct svn_version_extended_t sv * retrieve (for example, the OS release name, list of shared * libraries, etc.). Use @a pool for all allocations. * + * @note This function may allocate significant auxiliary resources + * (memory and file descriptors) in @a pool. It is recommended to + * copy the returned data to suitable longer-lived memory and clear + * @a pool after calling this function. + * * @since New in 1.8. */ const svn_version_extended_t * Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_client/client.h URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_client/client.h?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_client/client.h (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_client/client.h Tue Feb 3 13:15:17 2015 @@ -45,6 +45,35 @@ extern "C" { #endif /* __cplusplus */ + +/* Private client context. + * + * This is what is actually allocated by svn_client_create_context2(), + * which then returns the address of the public_ctx member. */ +typedef struct svn_client__private_ctx_t +{ + /* Reserved field, always zero, to detect misuse of the private + context as a public client context. */ + apr_uint64_t magic_null; + + /* Reserved field, always set to a known magic number, to identify + this struct as the private client context. */ + apr_uint64_t magic_id; + + /* Total number of bytes transferred over network across all RA sessions. */ + apr_off_t total_progress; + + /* The public context. */ + svn_client_ctx_t public_ctx; +} svn_client__private_ctx_t; + + +/* Given a public client context CTX, return the private context + within which it is allocated. */ +svn_client__private_ctx_t * +svn_client__get_private_ctx(svn_client_ctx_t *ctx); + + /* Set *REVNUM to the revision number identified by REVISION. If REVISION->kind is svn_opt_revision_number, just use Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_client/copy.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_client/copy.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_client/copy.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_client/copy.c Tue Feb 3 13:15:17 2015 @@ -1093,6 +1093,7 @@ repos_to_repos_copy(const apr_array_head item = svn_client_commit_item3_create(pool); item->url = svn_path_url_add_component2(top_url, relpath, pool); + item->kind = svn_node_dir; item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD; APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item; } @@ -1106,6 +1107,7 @@ repos_to_repos_copy(const apr_array_head item = svn_client_commit_item3_create(pool); item->url = svn_path_url_add_component2(top_url, info->dst_path, pool); + item->kind = info->src_kind; item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD | SVN_CLIENT_COMMIT_ITEM_IS_COPY; item->copyfrom_url = info->src_url; @@ -1117,6 +1119,7 @@ repos_to_repos_copy(const apr_array_head item = svn_client_commit_item3_create(pool); item->url = svn_path_url_add_component2(top_url, info->src_path, pool); + item->kind = info->src_kind; item->state_flags = SVN_CLIENT_COMMIT_ITEM_DELETE; APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item; } @@ -1347,52 +1350,6 @@ wc_to_repos_copy(const apr_array_header_ } } - if (SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx)) - { - /* Produce a list of new paths to add, and provide it to the - mechanism used to acquire a log message. */ - svn_client_commit_item3_t *item; - const char *tmp_file; - commit_items = apr_array_make(scratch_pool, copy_pairs->nelts, - sizeof(item)); - - /* Add any intermediate directories to the message */ - if (make_parents) - { - for (i = 0; i < new_dirs->nelts; i++) - { - const char *url = APR_ARRAY_IDX(new_dirs, i, const char *); - - item = svn_client_commit_item3_create(scratch_pool); - item->url = url; - item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD; - APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item; - } - } - - for (i = 0; i < copy_pairs->nelts; i++) - { - svn_client__copy_pair_t *pair = APR_ARRAY_IDX(copy_pairs, i, - svn_client__copy_pair_t *); - - item = svn_client_commit_item3_create(scratch_pool); - item->url = pair->dst_abspath_or_url; - item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD; - APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item; - } - - SVN_ERR(svn_client__get_log_msg(&message, &tmp_file, commit_items, - ctx, scratch_pool)); - if (! message) - { - svn_pool_destroy(iterpool); - svn_pool_destroy(session_pool); - return SVN_NO_ERROR; - } - } - else - message = ""; - cukb.session = ra_session; SVN_ERR(svn_ra_get_repos_root2(ra_session, &cukb.repos_root_url, session_pool)); cukb.should_reparent = FALSE; @@ -1423,6 +1380,7 @@ wc_to_repos_copy(const apr_array_header_ item = svn_client_commit_item3_create(scratch_pool); item->url = url; + item->kind = svn_node_dir; item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD; item->incoming_prop_changes = apr_array_make(scratch_pool, 1, sizeof(svn_prop_t *)); @@ -1450,8 +1408,6 @@ wc_to_repos_copy(const apr_array_header_ /* Set the mergeinfo for the destination to the combined merge info known to the WC and the repository. */ - item->outgoing_prop_changes = apr_array_make(scratch_pool, 1, - sizeof(svn_prop_t *)); /* Repository mergeinfo (or NULL if it's locally added)... */ if (src_origin) SVN_ERR(svn_client__get_repos_mergeinfo( @@ -1468,18 +1424,24 @@ wc_to_repos_copy(const apr_array_header_ iterpool)); else if (! mergeinfo) mergeinfo = wc_mergeinfo; + if (mergeinfo) { /* Push a mergeinfo prop representing MERGEINFO onto the * OUTGOING_PROP_CHANGES array. */ svn_prop_t *mergeinfo_prop - = apr_palloc(item->outgoing_prop_changes->pool, - sizeof(svn_prop_t)); + = apr_palloc(scratch_pool, sizeof(*mergeinfo_prop)); svn_string_t *prop_value; SVN_ERR(svn_mergeinfo_to_string(&prop_value, mergeinfo, - item->outgoing_prop_changes->pool)); + scratch_pool)); + + if (!item->outgoing_prop_changes) + { + item->outgoing_prop_changes = apr_array_make(scratch_pool, 1, + sizeof(svn_prop_t *)); + } mergeinfo_prop->name = SVN_PROP_MERGEINFO; mergeinfo_prop->value = prop_value; @@ -1488,6 +1450,22 @@ wc_to_repos_copy(const apr_array_header_ } } + if (SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx)) + { + const char *tmp_file; + + SVN_ERR(svn_client__get_log_msg(&message, &tmp_file, commit_items, + ctx, scratch_pool)); + if (! message) + { + svn_pool_destroy(iterpool); + svn_pool_destroy(session_pool); + return SVN_NO_ERROR; + } + } + else + message = ""; + /* Sort and condense our COMMIT_ITEMS. */ SVN_ERR(svn_client__condense_commit_items(&top_dst_url, commit_items, scratch_pool)); @@ -2002,7 +1980,7 @@ try_copy(svn_boolean_t *timestamp_sleep, { svn_client_copy_source_t *source = APR_ARRAY_IDX(sources, i, svn_client_copy_source_t *); - svn_client__copy_pair_t *pair = apr_palloc(pool, sizeof(*pair)); + svn_client__copy_pair_t *pair = apr_pcalloc(pool, sizeof(*pair)); const char *src_basename; svn_boolean_t src_is_url = svn_path_is_url(source->path); @@ -2024,6 +2002,7 @@ try_copy(svn_boolean_t *timestamp_sleep, pair->src_op_revision = *source->revision; pair->src_peg_revision = *source->peg_revision; + pair->src_kind = svn_node_unknown; SVN_ERR(svn_opt_resolve_revisions(&pair->src_peg_revision, &pair->src_op_revision, @@ -2052,7 +2031,7 @@ try_copy(svn_boolean_t *timestamp_sleep, else { /* Only one source path. */ - svn_client__copy_pair_t *pair = apr_palloc(pool, sizeof(*pair)); + svn_client__copy_pair_t *pair = apr_pcalloc(pool, sizeof(*pair)); svn_client_copy_source_t *source = APR_ARRAY_IDX(sources, 0, svn_client_copy_source_t *); svn_boolean_t src_is_url = svn_path_is_url(source->path); @@ -2064,6 +2043,7 @@ try_copy(svn_boolean_t *timestamp_sleep, source->path, pool)); pair->src_op_revision = *source->revision; pair->src_peg_revision = *source->peg_revision; + pair->src_kind = svn_node_unknown; SVN_ERR(svn_opt_resolve_revisions(&pair->src_peg_revision, &pair->src_op_revision, Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_client/ctx.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_client/ctx.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_client/ctx.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_client/ctx.c Tue Feb 3 13:15:17 2015 @@ -27,6 +27,7 @@ /*** Includes. ***/ +#include <stddef.h> #include <apr_pools.h> #include "svn_hash.h" #include "svn_client.h" @@ -34,6 +35,8 @@ #include "private/svn_wc_private.h" +#include "client.h" + /*** Code. ***/ @@ -76,6 +79,20 @@ call_conflict_func(svn_wc_conflict_resul return SVN_NO_ERROR; } +/* The magic number in client_ctx_t.magic_id. */ +#define CLIENT_CTX_MAGIC APR_UINT64_C(0xDEADBEEF600DF00D) + +svn_client__private_ctx_t * +svn_client__get_private_ctx(svn_client_ctx_t *ctx) +{ + svn_client__private_ctx_t *const private_ctx = + (void*)((char *)ctx - offsetof(svn_client__private_ctx_t, public_ctx)); + SVN_ERR_ASSERT_NO_RETURN(&private_ctx->public_ctx == ctx); + SVN_ERR_ASSERT_NO_RETURN(0 == private_ctx->magic_null); + SVN_ERR_ASSERT_NO_RETURN(CLIENT_CTX_MAGIC == private_ctx->magic_id); + return private_ctx; +} + svn_error_t * svn_client_create_context2(svn_client_ctx_t **ctx, apr_hash_t *cfg_hash, @@ -83,23 +100,29 @@ svn_client_create_context2(svn_client_ct { svn_config_t *cfg_config; - *ctx = apr_pcalloc(pool, sizeof(svn_client_ctx_t)); + svn_client__private_ctx_t *const private_ctx = + apr_pcalloc(pool, sizeof(*private_ctx)); + svn_client_ctx_t *const public_ctx = &private_ctx->public_ctx; + + private_ctx->magic_null = 0; + private_ctx->magic_id = CLIENT_CTX_MAGIC; - (*ctx)->notify_func2 = call_notify_func; - (*ctx)->notify_baton2 = *ctx; + public_ctx->notify_func2 = call_notify_func; + public_ctx->notify_baton2 = public_ctx; - (*ctx)->conflict_func2 = call_conflict_func; - (*ctx)->conflict_baton2 = *ctx; + public_ctx->conflict_func2 = call_conflict_func; + public_ctx->conflict_baton2 = public_ctx; - (*ctx)->config = cfg_hash; + public_ctx->config = cfg_hash; if (cfg_hash) cfg_config = svn_hash_gets(cfg_hash, SVN_CONFIG_CATEGORY_CONFIG); else cfg_config = NULL; - SVN_ERR(svn_wc_context_create(&(*ctx)->wc_ctx, cfg_config, pool, - pool)); + SVN_ERR(svn_wc_context_create(&public_ctx->wc_ctx, cfg_config, + pool, pool)); + *ctx = public_ctx; return SVN_NO_ERROR; } Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_client/diff.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_client/diff.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_client/diff.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_client/diff.c Tue Feb 3 13:15:17 2015 @@ -52,6 +52,7 @@ #include "private/svn_diff_private.h" #include "private/svn_subr_private.h" #include "private/svn_io_private.h" +#include "private/svn_ra_private.h" #include "svn_private_config.h" @@ -1805,8 +1806,8 @@ diff_repos_repos(const char **root_relpa /* Now, we open an extra RA session to the correct anchor location for URL1. This is used during the editor calls to fetch file contents. */ - SVN_ERR(svn_ra_dup_session(&extra_ra_session, ra_session, anchor1, - scratch_pool, scratch_pool)); + SVN_ERR(svn_ra__dup_session(&extra_ra_session, ra_session, anchor1, + scratch_pool, scratch_pool)); if (ddi) { Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_client/externals.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_client/externals.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_client/externals.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_client/externals.c Tue Feb 3 13:15:17 2015 @@ -146,6 +146,7 @@ relegate_dir_external(svn_wc_context_t * static svn_error_t * switch_dir_external(const char *local_abspath, const char *url, + const char *url_from_externals_definition, const svn_opt_revision_t *peg_revision, const svn_opt_revision_t *revision, const char *defining_abspath, @@ -197,7 +198,16 @@ switch_dir_external(const char *local_ab SVN_ERR(svn_wc__get_wcroot(&defining_wcroot_abspath, ctx->wc_ctx, defining_abspath, pool, pool)); if (strcmp(wcroot_abspath, defining_wcroot_abspath) == 0) - return svn_error_create(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL, NULL); + return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL, + _("The external '%s' defined in %s at '%s' " + "cannot be checked out because '%s' is " + "already a versioned path."), + url_from_externals_definition, + SVN_PROP_EXTERNALS, + svn_dirent_local_style(defining_abspath, + pool), + svn_dirent_local_style(local_abspath, + pool)); } /* If path is a directory, try to update/switch to the correct URL @@ -792,6 +802,7 @@ handle_external_item_change(svn_client_c { case svn_node_dir: SVN_ERR(switch_dir_external(local_abspath, new_loc->url, + new_item->url, &(new_item->peg_revision), &(new_item->revision), parent_dir_abspath, Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_client/import.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_client/import.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_client/import.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_client/import.c Tue Feb 3 13:15:17 2015 @@ -832,6 +832,8 @@ svn_client_import5(const char *path, SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool)); + SVN_ERR(svn_io_check_path(local_abspath, &kind, scratch_pool)); + /* Create a new commit item and add it to the array. */ if (SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx)) { @@ -845,6 +847,8 @@ svn_client_import5(const char *path, item = svn_client_commit_item3_create(scratch_pool); item->path = local_abspath; + item->url = url; + item->kind = kind; item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD; APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item; @@ -860,8 +864,6 @@ svn_client_import5(const char *path, } } - SVN_ERR(svn_io_check_path(local_abspath, &kind, scratch_pool)); - SVN_ERR(svn_client_open_ra_session2(&ra_session, url, NULL, ctx, scratch_pool, iterpool)); Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_client/mtcc.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_client/mtcc.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_client/mtcc.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_client/mtcc.c Tue Feb 3 13:15:17 2015 @@ -463,8 +463,8 @@ mtcc_verify_create(svn_client__mtcc_t *m return SVN_NO_ERROR; /* Node is explicitly deleted. We can replace */ } - /* mod_dav_svn allows overwriting existing directories. Let's hide that - for users of this api */ + /* mod_dav_svn used to allow overwriting existing directories. Let's hide + that for users of this api */ SVN_ERR(svn_client__mtcc_check_path(&kind, new_relpath, FALSE, mtcc, scratch_pool)); Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_client/prop_commands.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_client/prop_commands.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_client/prop_commands.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_client/prop_commands.c Tue Feb 3 13:15:17 2015 @@ -206,6 +206,7 @@ propset_on_url(const char *propname, item = svn_client_commit_item3_create(pool); item->url = target; + item->kind = node_kind; item->state_flags = SVN_CLIENT_COMMIT_ITEM_PROP_MODS; APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item; SVN_ERR(svn_client__get_log_msg(&message, &tmp_file, commit_items, @@ -528,9 +529,10 @@ svn_client_revprop_set2(const char *prop /* Helper for the remote case of svn_client_propget. * - * If PROPS is not null, then get the value of property PROPNAME in REVNUM, - using RA_LIB and SESSION. Store the value ('svn_string_t *') in PROPS, - under the path key "TARGET_PREFIX/TARGET_RELATIVE" ('const char *'). + * If PROPS is not null, then get the value of property PROPNAME in + * REVNUM, using RA_SESSION. Store the value ('svn_string_t *') in + * PROPS, under the path key "TARGET_PREFIX/TARGET_RELATIVE" + * ('const char *'). * * If INHERITED_PROPS is not null, then set *INHERITED_PROPS to a * depth-first ordered array of svn_prop_inherited_item_t * structures Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_client/ra.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_client/ra.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_client/ra.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_client/ra.c Tue Feb 3 13:15:17 2015 @@ -299,17 +299,20 @@ progress_func(apr_off_t progress, apr_pool_t *pool) { callback_baton_t *b = baton; - svn_client_ctx_t *ctx = b->ctx; + svn_client_ctx_t *public_ctx = b->ctx; + svn_client__private_ctx_t *private_ctx = + svn_client__get_private_ctx(public_ctx); - ctx->progress += (progress - b->last_progress); + private_ctx->total_progress += (progress - b->last_progress); b->last_progress = progress; - if (ctx->progress_func) + if (public_ctx->progress_func) { /* All RA implementations currently provide -1 for total. So it doesn't make sense to develop some complex logic to combine total across all RA sessions. */ - ctx->progress_func(ctx->progress, -1, ctx->progress_baton, pool); + public_ctx->progress_func(private_ctx->total_progress, -1, + public_ctx->progress_baton, pool); } } Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_client/util.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_client/util.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_client/util.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_client/util.c Tue Feb 3 13:15:17 2015 @@ -142,6 +142,7 @@ svn_client_commit_item3_create(apr_pool_ item->revision = SVN_INVALID_REVNUM; item->copyfrom_rev = SVN_INVALID_REVNUM; + item->kind = svn_node_unknown; return item; } Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_fs_fs/dag.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_fs_fs/dag.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_fs_fs/dag.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_fs_fs/dag.c Tue Feb 3 13:15:17 2015 @@ -1105,15 +1105,6 @@ svn_fs_fs__dag_dup(const dag_node_t *nod return new_node; } -dag_node_t * -svn_fs_fs__dag_copy_into_pool(dag_node_t *node, - apr_pool_t *pool) -{ - return (node->node_pool == pool - ? node - : svn_fs_fs__dag_dup(node, pool)); -} - svn_error_t * svn_fs_fs__dag_serialize(void **data, apr_size_t *data_len, Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_fs_fs/dag.h URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_fs_fs/dag.h?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_fs_fs/dag.h (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_fs_fs/dag.h Tue Feb 3 13:15:17 2015 @@ -80,12 +80,6 @@ dag_node_t * svn_fs_fs__dag_dup(const dag_node_t *node, apr_pool_t *pool); -/* If NODE has been allocated in POOL, return NODE. Otherwise, return - a copy created in POOL with svn_fs_fs__dag_dup. */ -dag_node_t * -svn_fs_fs__dag_copy_into_pool(dag_node_t *node, - apr_pool_t *pool); - /* Serialize a DAG node, except don't try to preserve the 'fs' member. Implements svn_cache__serialize_func_t */ svn_error_t * Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_fs_fs/tree.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_fs_fs/tree.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_fs_fs/tree.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_fs_fs/tree.c Tue Feb 3 13:15:17 2015 @@ -373,10 +373,8 @@ locate_cache(svn_cache__t **cache, } } -/* Return NODE for PATH from ROOT's node cache, or NULL if the node - isn't cached; read it from the FS. *NODE remains valid until either - POOL or the FS gets cleared or destroyed (whichever comes first). - */ +/* In *NODE_P, return the DAG node for PATH from ROOT's node cache, or NULL + if the node isn't cached. *NODE_P is allocated in POOL. */ static svn_error_t * dag_node_cache_get(dag_node_t **node_p, svn_fs_root_t *root, @@ -402,19 +400,22 @@ dag_node_cache_get(dag_node_t **node_p, if (bucket->node == NULL) { locate_cache(&cache, &key, root, path, pool); - SVN_ERR(svn_cache__get((void **)&node, &found, cache, key, - ffd->dag_node_cache->pool)); + SVN_ERR(svn_cache__get((void **)&node, &found, cache, key, pool)); if (found && node) { /* Patch up the FS, since this might have come from an old FS - * object. */ + * object. */ svn_fs_fs__dag_set_fs(node, root->fs); - bucket->node = node; + + /* Retain the DAG node in L1 cache. */ + bucket->node = svn_fs_fs__dag_dup(node, + ffd->dag_node_cache->pool); } } else { - node = bucket->node; + /* Copy the node from L1 cache into the passed-in POOL. */ + node = svn_fs_fs__dag_dup(bucket->node, pool); } } else @@ -427,7 +428,7 @@ dag_node_cache_get(dag_node_t **node_p, if (found && node) { /* Patch up the FS, since this might have come from an old FS - * object. */ + * object. */ svn_fs_fs__dag_set_fs(node, root->fs); } } @@ -450,11 +451,7 @@ dag_node_cache_set(svn_fs_root_t *root, SVN_ERR_ASSERT(*path == '/'); - /* Do *not* attempt to dup and put the node into L1. - * dup() is twice as expensive as an L2 lookup (which will set also L1). - */ locate_cache(&cache, &key, root, path, pool); - return svn_cache__set(cache, key, node, pool); } @@ -798,8 +795,7 @@ make_parent_path(dag_node_t *node, apr_pool_t *pool) { parent_path_t *parent_path = apr_pcalloc(pool, sizeof(*parent_path)); - if (node) - parent_path->node = svn_fs_fs__dag_copy_into_pool(node, pool); + parent_path->node = node; parent_path->entry = entry; parent_path->parent = parent; parent_path->copy_inherit = copy_id_inherit_unknown; @@ -1012,10 +1008,6 @@ open_path(parent_path_t **parent_path_p, svn_pool_clear(iterpool); - /* The NODE in PARENT_PATH always lives in POOL, i.e. it will - * survive the cleanup of ITERPOOL and the DAG cache.*/ - here = parent_path->node; - /* Parse out the next entry from the path. */ entry = svn_fs__next_entry_name(&next, rest, pool); @@ -1024,12 +1016,15 @@ open_path(parent_path_t **parent_path_p, path_so_far->len += strlen(entry) + 1; path_so_far->data[path_so_far->len] = '\0'; - /* Given the behavior of svn_fs__next_entry_name(), ENTRY may be an - empty string when the path either starts or ends with a slash. - In either case, we stay put: the current directory stays the - same, and we add nothing to the parent path. We only need to - process non-empty path segments. */ - if (*entry != '\0') + if (*entry == '\0') + { + /* Given the behavior of svn_fs__next_entry_name(), this + happens when the path either starts or ends with a slash. + In either case, we stay put: the current directory stays + the same, and we add nothing to the parent path. */ + child = here; + } + else { copy_id_inherit_t inherit; const char *copy_path = NULL; @@ -1078,7 +1073,7 @@ open_path(parent_path_t **parent_path_p, if (flags & open_path_node_only) { /* Shortcut: the caller only wants the final DAG node. */ - parent_path->node = svn_fs_fs__dag_copy_into_pool(child, pool); + parent_path->node = child; } else { @@ -1109,6 +1104,7 @@ open_path(parent_path_t **parent_path_p, apr_psprintf(iterpool, _("Failure opening '%s'"), path)); rest = next; + here = child; } svn_pool_destroy(iterpool); @@ -1217,8 +1213,7 @@ make_path_mutable(svn_fs_root_t *root, /* Open the node identified by PATH in ROOT. Set DAG_NODE_P to the node we find, allocated in POOL. Return the error - SVN_ERR_FS_NOT_FOUND if this node doesn't exist. - */ + SVN_ERR_FS_NOT_FOUND if this node doesn't exist. */ static svn_error_t * get_dag(dag_node_t **dag_node_p, svn_fs_root_t *root, @@ -1256,7 +1251,7 @@ get_dag(dag_node_t **dag_node_p, } } - *dag_node_p = svn_fs_fs__dag_copy_into_pool(node, pool); + *dag_node_p = node; return SVN_NO_ERROR; } @@ -1374,7 +1369,7 @@ fs_node_relation(svn_fs_node_relation_t rev_item_a = *svn_fs_fs__id_rev_item(id); node_id_a = *svn_fs_fs__id_node_id(id); - SVN_ERR(get_dag(&node, root_b, path_b, pool)); + SVN_ERR(get_dag(&node, root_b, path_b, pool)); id = svn_fs_fs__dag_get_id(node); rev_item_b = *svn_fs_fs__id_rev_item(id); node_id_b = *svn_fs_fs__id_node_id(id); @@ -1476,7 +1471,7 @@ fs_node_prop(svn_string_t **value_p, dag_node_t *node; apr_hash_t *proplist; - SVN_ERR(get_dag(&node, root, path, pool)); + SVN_ERR(get_dag(&node, root, path, pool)); SVN_ERR(svn_fs_fs__dag_get_proplist(&proplist, node, pool)); *value_p = NULL; if (proplist) Propchange: subversion/branches/dump-load-cross-check/subversion/libsvn_fs_x/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Feb 3 13:15:17 2015 @@ -68,6 +68,7 @@ /subversion/branches/revprop-caching-ng/subversion/libsvn_fs_x:1620597 /subversion/branches/revprop-packing/subversion/libsvn_fs_x:1143907,1143971,1143997,1144017,1144499,1144568,1146145 /subversion/branches/subtree-mergeinfo/subversion/libsvn_fs_x:876734-878766 +/subversion/branches/svn-auth-x509/subversion/libsvn_fs_x:1603509-1655900 /subversion/branches/svn-mergeinfo-enhancements/subversion/libsvn_fs_x:870119-870195,870197-870288 /subversion/branches/svn-patch-improvements/subversion/libsvn_fs_x:918519-934609 /subversion/branches/svn_mutex/subversion/libsvn_fs_x:1141683-1182099 @@ -87,4 +88,4 @@ /subversion/branches/verify-keep-going/subversion/libsvn_fs_x:1439280-1492639,1546002-1546110 /subversion/branches/wc-collate-path/subversion/libsvn_fs_x:1402685-1480384 /subversion/trunk/subversion/libsvn_fs_fs:1415133-1596500,1596567,1597414,1597989,1598273,1599140,1600872,1601633,1603485-1603487,1603499,1603605,1604128,1604188,1604413-1604414,1604416-1604417,1604421,1604442,1604700,1604717,1604720,1604726,1604755,1604794,1604802,1604824,1604836,1604844,1604902-1604903,1604911,1604925,1604933,1604947,1605059-1605060,1605064-1605065,1605068,1605071-1605073,1605075,1605123,1605188-1605189,1605191,1605197,1605444,1605633,1606132,1606142,1606144,1606514,1606526,1606528,1606551,1606554,1606564,1606598-1606599,1606656,1606658,1606662,1606744,1606840,1607085,1607572,1612407,1612810,1613339,1613872,1614611,1615348,1615351-1615352,1615356,1616338-1616339,1616613,1617586,1617688,1618138,1618151,1618153,1618226,1618641,1618653,1618662,1619068,1619358,1619413,1619769,1619774,1620602,1620909,1620912,1620928,1620930,1621275,1621635,1622931,1622937,1622942,1622946,1622959-1622960,1622963,1622987,1623007,1623368,1623373,1623377,1623379,1623381,1623398,1623402,162 4011,1624265,1624512,1626246,1626871,1626873,1626886,1627497-1627498,1627502,1627947-1627949,1627966,1628083,1628093,1628158-1628159,1628161,1628392-1628393,1628415,1628427,1628676,1628738,1628762,1628764,1629854-1629855,1629857,1629865,1629873,1629875,1629879,1630067,1630070,1631049-1631051,1631075,1631115,1631171,1631180,1631185-1631186,1631196-1631197,1631239-1631240,1631548,1631550,1631563,1631567,1631588,1631598,1632646,1632776,1632849,1632851-1632853,1632856-1632857,1632868,1632908,1632926,1633232,1633617-1633618,1634872,1634875,1634879-1634880,1634920,1636478,1636483,1636629,1636644,1637184,1637186,1637330,1637358,1637363,1637393,1639319,1639322,1639335,1639348,1639352,1639355,1639358,1639414,1639419,1639426,1639430,1639436,1639440,1639549,1640061-1640062,1640197,1640915,1640966,1641013,1643139,1643233,1645567,1646021,1646712,1646716,1647537,1647540-1647541,1647820,1647905,1648230,1648238,1648241-1648243,1648253,1648272,1648532,1648537-1648539,1648542,1648591,1648612 -/subversion/trunk/subversion/libsvn_fs_x:1414756-1509914 +/subversion/trunk/subversion/libsvn_fs_x:1414756-1509914,1654853-1656714 Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_ra/ra_loader.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_ra/ra_loader.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_ra/ra_loader.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_ra/ra_loader.c Tue Feb 3 13:15:17 2015 @@ -279,7 +279,6 @@ svn_error_t *svn_ra_open4(svn_ra_session svn_boolean_t store_pp = SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP; const char *store_pp_plaintext = SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT; - const char *corrected_url; /* Initialize the return variable. */ *session_p = NULL; @@ -482,34 +481,29 @@ svn_error_t *svn_ra_open4(svn_ra_session session->pool = sesspool; /* Ask the library to open the session. */ - err = vtable->open_session(session, &corrected_url, repos_URL, + err = vtable->open_session(session, corrected_url_p, + repos_URL, callbacks, callback_baton, config, sesspool); if (err) - return svn_error_createf( + { + if (err->apr_err == SVN_ERR_RA_SESSION_URL_MISMATCH) + return svn_error_trace(err); + + return svn_error_createf( SVN_ERR_RA_CANNOT_CREATE_SESSION, err, _("Unable to connect to a repository at URL '%s'"), repos_URL); + } /* If the session open stuff detected a server-provided URL correction (a 301 or 302 redirect response during the initial OPTIONS request), then kill the session so the caller can decide what to do. */ - if (corrected_url_p && corrected_url) + if (corrected_url_p && *corrected_url_p) { - if (! svn_path_is_url(corrected_url)) - { - /* RFC1945 and RFC2616 state that the Location header's - value (from whence this CORRECTED_URL ultimately comes), - if present, must be an absolute URI. But some Apache - versions (those older than 2.2.11, it seems) transmit - only the path portion of the URI. See issue #3775 for - details. */ - apr_uri_t corrected_URI = repos_URI; - corrected_URI.path = (char *)corrected_url; - corrected_url = apr_uri_unparse(pool, &corrected_URI, 0); - } - *corrected_url_p = svn_uri_canonicalize(corrected_url, pool); + /* *session_p = NULL; */ + *corrected_url_p = apr_pstrdup(pool, *corrected_url_p); svn_pool_destroy(sesspool); return SVN_NO_ERROR; } @@ -537,11 +531,11 @@ svn_error_t *svn_ra_open4(svn_ra_session } svn_error_t * -svn_ra_dup_session(svn_ra_session_t **new_session, - svn_ra_session_t *old_session, - const char *session_url, - apr_pool_t *result_pool, - apr_pool_t *scratch_pool) +svn_ra__dup_session(svn_ra_session_t **new_session, + svn_ra_session_t *old_session, + const char *session_url, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool) { svn_ra_session_t *session; @@ -1016,8 +1010,8 @@ svn_error_t *svn_ra_stat(svn_ra_session_ svn_uri_split(&parent_url, &base_name, session_url, scratch_pool); - SVN_ERR(svn_ra_dup_session(&parent_session, session, parent_url, - scratch_pool, scratch_pool)); + SVN_ERR(svn_ra__dup_session(&parent_session, session, parent_url, + scratch_pool, scratch_pool)); /* Get all parent's entries, no props. */ SVN_ERR(svn_ra_get_dir2(parent_session, &parent_ents, NULL, Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/get_file.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/get_file.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/get_file.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/get_file.c Tue Feb 3 13:15:17 2015 @@ -397,9 +397,6 @@ svn_ra_serf__get_file(svn_ra_session_t * handler = svn_ra_serf__create_handler(session, pool); - /* What connection should we go on? */ - handler->conn = session->conns[session->cur_conn]; - handler->method = "GET"; handler->path = fetch_url; Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/options.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/options.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/options.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/options.c Tue Feb 3 13:15:17 2015 @@ -30,6 +30,7 @@ #include "svn_dirent_uri.h" #include "svn_hash.h" #include "svn_pools.h" +#include "svn_path.h" #include "svn_ra.h" #include "svn_dav.h" #include "svn_xml.h" @@ -511,6 +512,8 @@ svn_ra_serf__exchange_capabilities(svn_r /* This routine automatically fills in serf_sess->capabilities */ SVN_ERR(create_options_req(&opt_ctx, serf_sess, scratch_pool)); + opt_ctx->handler->no_fail_on_http_redirect_status = TRUE; + SVN_ERR(svn_ra_serf__context_run_one(opt_ctx->handler, scratch_pool)); /* If our caller cares about server redirections, and our response @@ -519,9 +522,44 @@ svn_ra_serf__exchange_capabilities(svn_r successfully parsing as XML or somesuch. */ if (corrected_url && (opt_ctx->handler->sline.code == 301)) { - *corrected_url = apr_pstrdup(result_pool, opt_ctx->handler->location); + if (!opt_ctx->handler->location || !*opt_ctx->handler->location) + { + return svn_error_create( + SVN_ERR_RA_DAV_RESPONSE_HEADER_BADNESS, NULL, + _("Location header not set on redirect response")); + } + else if (svn_path_is_url(opt_ctx->handler->location)) + { + *corrected_url = svn_uri_canonicalize(opt_ctx->handler->location, + result_pool); + } + else + { + /* RFC1945 and RFC2616 state that the Location header's value + (from whence this CORRECTED_URL comes), if present, must be an + absolute URI. But some Apache versions (those older than 2.2.11, + it seems) transmit only the path portion of the URI. + See issue #3775 for details. */ + + apr_uri_t corrected_URI = serf_sess->session_url; + + corrected_URI.path = (char *)corrected_url; + *corrected_url = svn_uri_canonicalize( + apr_uri_unparse(scratch_pool, &corrected_URI, 0), + result_pool); + } + return SVN_NO_ERROR; } + else if (opt_ctx->handler->sline.code >= 300 + && opt_ctx->handler->sline.code < 399) + { + return svn_error_createf(SVN_ERR_RA_SESSION_URL_MISMATCH, NULL, + (opt_ctx->handler->sline.code == 301 + ? _("Repository moved permanently to '%s'") + : _("Repository moved temporarily to '%s'")), + opt_ctx->handler->location); + } if (opt_ctx->handler->sline.code != 200) return svn_error_trace(svn_ra_serf__unexpected_status(opt_ctx->handler)); Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/ra_serf.h URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/ra_serf.h?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/ra_serf.h (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/ra_serf.h Tue Feb 3 13:15:17 2015 @@ -431,10 +431,13 @@ typedef struct svn_ra_serf__handler_t { for request. */ svn_boolean_t no_dav_headers; - /* If TRUE doesn't end the context directly on certain HTTP errors like 405, - 408, 500 (see util.c handle_response()) */ + /* If TRUE doesn't fail requests on HTTP error statuses like 405, 408, 500 + (see util.c response_done()) */ svn_boolean_t no_fail_on_http_failure_status; + /* If TRUE doesn't fail requests on HTTP redirect statuses like 301, 307 */ + svn_boolean_t no_fail_on_http_redirect_status; + /* Has the request/response been completed? */ svn_boolean_t done; svn_boolean_t scheduled; /* Is the request scheduled in a context */ Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/serf.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/serf.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/serf.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/serf.c Tue Feb 3 13:15:17 2015 @@ -776,6 +776,7 @@ ra_serf_dup_session(svn_ra_session_t *ne new_sess); new_sess->num_conns = 1; + new_sess->cur_conn = 0; new_session->priv = new_sess; Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/util.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/util.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/util.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_ra_serf/util.c Tue Feb 3 13:15:17 2015 @@ -1751,10 +1751,9 @@ svn_ra_serf__error_on_status(serf_status case 308: return svn_error_createf(SVN_ERR_RA_DAV_RELOCATED, NULL, (sline.code == 301) - ? _("Repository moved permanently to '%s';" - " please relocate") - : _("Repository moved temporarily to '%s';" - " please relocate"), location); + ? _("Repository moved permanently to '%s'") + : _("Repository moved temporarily to '%s'"), + location); case 403: return svn_error_createf(SVN_ERR_RA_DAV_FORBIDDEN, NULL, _("Access to '%s' forbidden"), path); @@ -1853,9 +1852,13 @@ response_done(serf_request_t *request, if (handler->server_error) return svn_ra_serf__server_error_create(handler, scratch_pool); - if ((handler->sline.code >= 400 || handler->sline.code <= 199) - && !handler->session->pending_error - && !handler->no_fail_on_http_failure_status) + if (handler->sline.code >= 400 || handler->sline.code <= 199) + { + return svn_error_trace(svn_ra_serf__unexpected_status(handler)); + } + + if ((handler->sline.code >= 300 && handler->sline.code < 399) + && !handler->no_fail_on_http_redirect_status) { return svn_error_trace(svn_ra_serf__unexpected_status(handler)); } Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_subr/ssl_server_trust_providers.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_subr/ssl_server_trust_providers.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_subr/ssl_server_trust_providers.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_subr/ssl_server_trust_providers.c Tue Feb 3 13:15:17 2015 @@ -74,57 +74,13 @@ ssl_server_trust_file_first_credentials( if (failstr) SVN_ERR(svn_cstring_atoui(&last_failures, failstr->data)); + /* If the cert is trusted and there are no new failures, we + * accept it by clearing all failures. */ if (trusted_cert && - svn_string_compare(this_cert, trusted_cert)) + svn_string_compare(this_cert, trusted_cert) && + (*failures & ~last_failures) == 0) { - svn_boolean_t save_cert = FALSE; - - /* If the cert is trusted and there are no new failures, we - * accept it by clearing all failures. */ - if ((*failures & ~last_failures) == 0) - { - *failures = 0; - } - - /* If the on-disk cert info is lacking new-in-1.9 human-readable - info, add the info now and save the cert. */ - if (!svn_hash_gets(creds_hash, SVN_CONFIG_AUTHN_HOSTNAME_KEY)) - { - svn_hash_sets(creds_hash, SVN_CONFIG_AUTHN_HOSTNAME_KEY, - svn_string_create(cert_info->hostname, pool)); - save_cert = TRUE; - } - if (!svn_hash_gets(creds_hash, SVN_CONFIG_AUTHN_FINGERPRINT_KEY)) - { - svn_hash_sets(creds_hash, SVN_CONFIG_AUTHN_FINGERPRINT_KEY, - svn_string_create(cert_info->fingerprint, pool)); - save_cert = TRUE; - } - if (!svn_hash_gets(creds_hash, SVN_CONFIG_AUTHN_VALID_FROM_KEY)) - { - svn_hash_sets(creds_hash, SVN_CONFIG_AUTHN_VALID_FROM_KEY, - svn_string_create(cert_info->valid_from, pool)); - save_cert = TRUE; - } - if (!svn_hash_gets(creds_hash, SVN_CONFIG_AUTHN_VALID_UNTIL_KEY)) - { - svn_hash_sets(creds_hash, SVN_CONFIG_AUTHN_VALID_UNTIL_KEY, - svn_string_create(cert_info->valid_until, pool)); - save_cert = TRUE; - } - if (!svn_hash_gets(creds_hash, SVN_CONFIG_AUTHN_ISSUER_DN_KEY)) - { - svn_hash_sets(creds_hash, SVN_CONFIG_AUTHN_ISSUER_DN_KEY, - svn_string_create(cert_info->issuer_dname, pool)); - save_cert = TRUE; - } - - if (save_cert) - SVN_ERR(svn_config_write_auth_data(creds_hash, - SVN_AUTH_CRED_SSL_SERVER_TRUST, - realmstring, - config_dir, - pool)); + *failures = 0; } } @@ -167,16 +123,6 @@ ssl_server_trust_file_save_credentials(s svn_hash_sets(creds_hash, SVN_CONFIG_AUTHN_FAILURES_KEY, svn_string_createf(pool, "%lu", (unsigned long)creds->accepted_failures)); - svn_hash_sets(creds_hash, SVN_CONFIG_AUTHN_HOSTNAME_KEY, - svn_string_create(cert_info->hostname, pool)); - svn_hash_sets(creds_hash, SVN_CONFIG_AUTHN_FINGERPRINT_KEY, - svn_string_create(cert_info->fingerprint, pool)); - svn_hash_sets(creds_hash, SVN_CONFIG_AUTHN_VALID_FROM_KEY, - svn_string_create(cert_info->valid_from, pool)); - svn_hash_sets(creds_hash, SVN_CONFIG_AUTHN_VALID_UNTIL_KEY, - svn_string_create(cert_info->valid_until, pool)); - svn_hash_sets(creds_hash, SVN_CONFIG_AUTHN_ISSUER_DN_KEY, - svn_string_create(cert_info->issuer_dname, pool)); SVN_ERR(svn_config_write_auth_data(creds_hash, SVN_AUTH_CRED_SSL_SERVER_TRUST, Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_subr/sysinfo.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_subr/sysinfo.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_subr/sysinfo.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_subr/sysinfo.c Tue Feb 3 13:15:17 2015 @@ -410,6 +410,63 @@ lsb_release(apr_pool_t *pool) return NULL; } +/* Read /etc/os-release, as documented here: + * http://www.freedesktop.org/software/systemd/man/os-release.html + */ +static const char * +systemd_release(apr_pool_t *pool) +{ + svn_error_t *err; + svn_stream_t *stream; + + /* Open the file. */ + err = svn_stream_open_readonly(&stream, "/etc/os-release", pool, pool); + if (err && APR_STATUS_IS_ENOENT(err->apr_err)) + { + svn_error_clear(err); + err = svn_stream_open_readonly(&stream, "/usr/lib/os-release", pool, + pool); + } + if (err) + { + svn_error_clear(err); + return NULL; + } + + /* Look for the PRETTY_NAME line. */ + while (TRUE) + { + svn_stringbuf_t *line; + svn_boolean_t eof; + + err = svn_stream_readline(stream, &line, "\n", &eof, pool); + if (err) + { + svn_error_clear(err); + return NULL; + } + + if (!strncmp(line->data, "PRETTY_NAME=", 12)) + { + svn_stringbuf_t *release_name; + + /* The value may or may not be enclosed by double quotes. We don't + * attempt to strip them. */ + release_name = svn_stringbuf_create(line->data + 12, pool); + svn_error_clear(svn_stream_close(stream)); + svn_stringbuf_strip_whitespace(release_name); + return release_name->data; + } + + if (eof) + break; + } + + /* The file did not contain a PRETTY_NAME line. */ + svn_error_clear(svn_stream_close(stream)); + return NULL; +} + /* Read the whole contents of a file. */ static svn_stringbuf_t * read_file_contents(const char *filename, apr_pool_t *pool) @@ -527,6 +584,10 @@ linux_release_name(apr_pool_t *pool) Covers, for example, Debian, Ubuntu and SuSE. */ const char *release_name = lsb_release(pool); + /* Try the systemd way (covers Arch). */ + if (!release_name) + release_name = systemd_release(pool); + /* Try RHEL/Fedora/CentOS */ if (!release_name) release_name = redhat_release(pool); Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_subr/utf.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_subr/utf.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_subr/utf.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_subr/utf.c Tue Feb 3 13:15:17 2015 @@ -59,6 +59,12 @@ static const char *SVN_APR_UTF8_CHARSET static svn_mutex__t *xlate_handle_mutex = NULL; static svn_boolean_t assume_native_charset_is_utf8 = FALSE; +#if defined(WIN32) +typedef svn_subr__win32_xlate_t xlate_handle_t; +#else +typedef apr_xlate_t xlate_handle_t; +#endif + /* The xlate handle cache is a global hash table with linked lists of xlate * handles. In multi-threaded environments, a thread "borrows" an xlate * handle from the cache during a translation and puts it back afterwards. @@ -69,7 +75,7 @@ static svn_boolean_t assume_native_chars * is the number of simultanous handles in use for that key. */ typedef struct xlate_handle_node_t { - apr_xlate_t *handle; + xlate_handle_t *handle; /* FALSE if the handle is not valid, since its pool is being destroyed. */ svn_boolean_t valid; @@ -205,7 +211,7 @@ xlate_alloc_handle(xlate_handle_node_t * apr_pool_t *pool) { apr_status_t apr_err; - apr_xlate_t *handle; + xlate_handle_t *handle; const char *name; /* The error handling doesn't support the following cases, since we don't @@ -217,7 +223,7 @@ xlate_alloc_handle(xlate_handle_node_t * /* Try to create a handle. */ #if defined(WIN32) - apr_err = svn_subr__win32_xlate_open((win32_xlate_t **)&handle, topage, + apr_err = svn_subr__win32_xlate_open(&handle, topage, frompage, pool); name = "win32-xlate: "; #else @@ -486,9 +492,8 @@ convert_to_stringbuf(xlate_handle_node_t #ifdef WIN32 apr_status_t apr_err; - apr_err = svn_subr__win32_xlate_to_stringbuf((win32_xlate_t *) node->handle, - src_data, src_length, - dest, pool); + apr_err = svn_subr__win32_xlate_to_stringbuf(node->handle, src_data, + src_length, dest, pool); #else apr_size_t buflen = src_length * 2; apr_status_t apr_err; @@ -1016,6 +1021,161 @@ svn_utf_cstring_from_utf8_string(const c } +/* Insert the given UCS-4 VALUE into BUF at the given OFFSET. */ +static void +membuf_insert_ucs4(svn_membuf_t *buf, apr_size_t offset, apr_int32_t value) +{ + svn_membuf__resize(buf, (offset + 1) * sizeof(value)); + ((apr_int32_t*)buf->data)[offset] = value; +} + +/* TODO: Use compiler intrinsics for byte swaps. */ +#define SWAP_SHORT(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff)) +#define SWAP_LONG(x) ((((x) & 0xff) << 24) | (((x) & 0xff00) << 8) \ + | (((x) >> 8) & 0xff00) | (((x) >> 24) & 0xff)) + +#define IS_UTF16_LEAD_SURROGATE(c) ((c) >= 0xd800 && (c) <= 0xdbff) +#define IS_UTF16_TRAIL_SURROGATE(c) ((c) >= 0xdc00 && (c) <= 0xdfff) + +svn_error_t * +svn_utf__utf16_to_utf8(const svn_string_t **result, + const apr_uint16_t *utf16str, + apr_size_t utf16len, + svn_boolean_t big_endian, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool) +{ + static const apr_uint16_t endiancheck = 0xa55a; + const svn_boolean_t arch_big_endian = + (((const char*)&endiancheck)[sizeof(endiancheck) - 1] == '\x5a'); + const svn_boolean_t swap_order = (!big_endian != !arch_big_endian); + + apr_uint16_t lead_surrogate; + apr_size_t length; + apr_size_t offset; + svn_membuf_t ucs4buf; + svn_membuf_t resultbuf; + svn_string_t *res; + + if (utf16len == SVN_UTF__UNKNOWN_LENGTH) + { + const apr_uint16_t *endp = utf16str; + while (*endp++) + ; + utf16len = (endp - utf16str); + } + + svn_membuf__create(&ucs4buf, utf16len * sizeof(apr_int32_t), scratch_pool); + + for (lead_surrogate = 0, length = 0, offset = 0; + offset < utf16len; ++offset) + { + const apr_uint16_t code = + (swap_order ? SWAP_SHORT(utf16str[offset]) : utf16str[offset]); + + if (lead_surrogate) + { + if (IS_UTF16_TRAIL_SURROGATE(code)) + { + /* Combine the lead and trail currogates into a 32-bit code. */ + membuf_insert_ucs4(&ucs4buf, length++, + (0x010000 + + (((lead_surrogate & 0x03ff) << 10) + | (code & 0x03ff)))); + lead_surrogate = 0; + continue; + } + else + { + /* If we didn't find a surrogate pair, just dump the + lead surrogate into the stream. */ + membuf_insert_ucs4(&ucs4buf, length++, lead_surrogate); + lead_surrogate = 0; + } + } + + if ((offset + 1) < utf16len && IS_UTF16_LEAD_SURROGATE(code)) + { + /* Store a lead surrogate that is followed by at least one + code for the next iteration. */ + lead_surrogate = code; + continue; + } + else + membuf_insert_ucs4(&ucs4buf, length++, code); + } + + /* Convert the UCS-4 buffer to UTF-8, assuming an average of 2 bytes + per code point for encoding. The buffer will grow as + necessary. */ + svn_membuf__create(&resultbuf, length * 2, result_pool); + SVN_ERR(svn_utf__encode_ucs4_string( + &resultbuf, ucs4buf.data, length, &length)); + + res = apr_palloc(result_pool, sizeof(*res)); + res->data = resultbuf.data; + res->len = length; + *result = res; + return SVN_NO_ERROR; +} + + +svn_error_t * +svn_utf__utf32_to_utf8(const svn_string_t **result, + const apr_int32_t *utf32str, + apr_size_t utf32len, + svn_boolean_t big_endian, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool) +{ + static const apr_int32_t endiancheck = 0xa5cbbc5a; + const svn_boolean_t arch_big_endian = + (((const char*)&endiancheck)[sizeof(endiancheck) - 1] == '\x5a'); + const svn_boolean_t swap_order = (!big_endian != !arch_big_endian); + + apr_size_t length; + svn_membuf_t resultbuf; + svn_string_t *res; + + if (utf32len == SVN_UTF__UNKNOWN_LENGTH) + { + const apr_int32_t *endp = utf32str; + while (*endp++) + ; + utf32len = (endp - utf32str); + } + + if (swap_order) + { + apr_size_t offset; + svn_membuf_t ucs4buf; + + svn_membuf__create(&ucs4buf, utf32len * sizeof(apr_int32_t), + scratch_pool); + + for (offset = 0; offset < utf32len; ++offset) + { + const apr_int32_t code = SWAP_LONG(utf32str[offset]); + membuf_insert_ucs4(&ucs4buf, offset, code); + } + utf32str = ucs4buf.data; + } + + /* Convert the UCS-4 buffer to UTF-8, assuming an average of 2 bytes + per code point for encoding. The buffer will grow as + necessary. */ + svn_membuf__create(&resultbuf, utf32len * 2, result_pool); + SVN_ERR(svn_utf__encode_ucs4_string( + &resultbuf, utf32str, utf32len, &length)); + + res = apr_palloc(result_pool, sizeof(*res)); + res->data = resultbuf.data; + res->len = length; + *result = res; + return SVN_NO_ERROR; +} + + #ifdef WIN32 Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_subr/utf8proc.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_subr/utf8proc.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_subr/utf8proc.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_subr/utf8proc.c Tue Feb 3 13:15:17 2015 @@ -218,20 +218,14 @@ encode_ucs4(svn_membuf_t *buffer, apr_in return SVN_NO_ERROR; } -/* Decode an UCS-4 string to UTF-8, placing the result into BUFFER. - * While utf8proc does have a similar function, it does more checking - * and processing than we want here. Return the length of the result - * (excluding the NUL terminator) in *result_length. - * - * A returned error indicates that the codepoint is invalid. - */ -static svn_error_t * -encode_ucs4_string(svn_membuf_t *buffer, - apr_int32_t *ucs4str, apr_size_t len, - apr_size_t *result_length) +svn_error_t * +svn_utf__encode_ucs4_string(svn_membuf_t *buffer, + const apr_int32_t *ucs4str, + apr_size_t length, + apr_size_t *result_length) { *result_length = 0; - while (len-- > 0) + while (length-- > 0) SVN_ERR(encode_ucs4(buffer, *ucs4str++, result_length)); svn_membuf__resize(buffer, *result_length + 1); ((char*)buffer->data)[*result_length] = '\0'; @@ -262,8 +256,8 @@ svn_utf__glob(svn_boolean_t *match, because apr_fnmatch can't handle it.*/ SVN_ERR(decompose_normalized(&tempbuf_len, pattern, pattern_len, temp_buf)); if (!sql_like) - SVN_ERR(encode_ucs4_string(pattern_buf, temp_buf->data, tempbuf_len, - &patternbuf_len)); + SVN_ERR(svn_utf__encode_ucs4_string(pattern_buf, temp_buf->data, + tempbuf_len, &patternbuf_len)); else { /* Convert a LIKE pattern to a GLOB pattern that apr_fnmatch can use. */ @@ -338,8 +332,8 @@ svn_utf__glob(svn_boolean_t *match, /* Now normalize the string */ SVN_ERR(decompose_normalized(&tempbuf_len, string, string_len, temp_buf)); - SVN_ERR(encode_ucs4_string(string_buf, temp_buf->data, - tempbuf_len, &tempbuf_len)); + SVN_ERR(svn_utf__encode_ucs4_string(string_buf, temp_buf->data, + tempbuf_len, &tempbuf_len)); *match = !apr_fnmatch(pattern_buf->data, string_buf->data, 0); return SVN_NO_ERROR; Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_subr/win32_xlate.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_subr/win32_xlate.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_subr/win32_xlate.c (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_subr/win32_xlate.c Tue Feb 3 13:15:17 2015 @@ -77,11 +77,11 @@ initialize_com(void *baton, apr_pool_t* return SVN_NO_ERROR; } -typedef struct win32_xlate_t +typedef struct svn_subr__win32_xlate_t { UINT from_page_id; UINT to_page_id; -} win32_xlate_t; +} svn_subr__win32_xlate_t; static apr_status_t get_page_id_from_name(UINT *page_id_p, const char *page_name, apr_pool_t *pool) @@ -166,12 +166,12 @@ get_page_id_from_name(UINT *page_id_p, c } apr_status_t -svn_subr__win32_xlate_open(win32_xlate_t **xlate_p, const char *topage, +svn_subr__win32_xlate_open(svn_subr__win32_xlate_t **xlate_p, const char *topage, const char *frompage, apr_pool_t *pool) { UINT from_page_id, to_page_id; apr_status_t apr_err = APR_SUCCESS; - win32_xlate_t *xlate; + svn_subr__win32_xlate_t *xlate; apr_err = get_page_id_from_name(&to_page_id, topage, pool); if (apr_err == APR_SUCCESS) @@ -190,7 +190,7 @@ svn_subr__win32_xlate_open(win32_xlate_t } apr_status_t -svn_subr__win32_xlate_to_stringbuf(win32_xlate_t *handle, +svn_subr__win32_xlate_to_stringbuf(svn_subr__win32_xlate_t *handle, const char *src_data, apr_size_t src_length, svn_stringbuf_t **dest, Modified: subversion/branches/dump-load-cross-check/subversion/libsvn_subr/win32_xlate.h URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/libsvn_subr/win32_xlate.h?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/libsvn_subr/win32_xlate.h (original) +++ subversion/branches/dump-load-cross-check/subversion/libsvn_subr/win32_xlate.h Tue Feb 3 13:15:17 2015 @@ -27,25 +27,27 @@ #ifdef WIN32 /* Opaque translation buffer. */ -typedef struct win32_xlate_t win32_xlate_t; +typedef struct svn_subr__win32_xlate_t svn_subr__win32_xlate_t; /* Set *XLATE_P to a handle node for converting from FROMPAGE to TOPAGE. Returns APR_EINVAL or APR_ENOTIMPL, if a conversion isn't supported. If fail for any other reason, return the error. Allocate *RET in POOL. */ -apr_status_t svn_subr__win32_xlate_open(win32_xlate_t **xlate_p, - const char *topage, - const char *frompage, - apr_pool_t *pool); +apr_status_t +svn_subr__win32_xlate_open(svn_subr__win32_xlate_t **xlate_p, + const char *topage, + const char *frompage, + apr_pool_t *pool); /* Convert SRC_LENGTH bytes of SRC_DATA in NODE->handle, store the result in *DEST, which is allocated in POOL. */ -apr_status_t svn_subr__win32_xlate_to_stringbuf(win32_xlate_t *handle, - const char *src_data, - apr_size_t src_length, - svn_stringbuf_t **dest, - apr_pool_t *pool); +apr_status_t +svn_subr__win32_xlate_to_stringbuf(svn_subr__win32_xlate_t *handle, + const char *src_data, + apr_size_t src_length, + svn_stringbuf_t **dest, + apr_pool_t *pool); #endif /* WIN32 */ Modified: subversion/branches/dump-load-cross-check/subversion/mod_dav_svn/repos.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/mod_dav_svn/repos.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/mod_dav_svn/repos.c (original) +++ subversion/branches/dump-load-cross-check/subversion/mod_dav_svn/repos.c Tue Feb 3 13:15:17 2015 @@ -1035,6 +1035,28 @@ prep_working(dav_resource_combined *comb comb->res.exists = (kind != svn_node_none); comb->res.collection = (kind == svn_node_dir); + if (comb->res.exists + && comb->priv.r->method_number == M_MKCOL + && comb->priv.repos->is_svn_client) + { + /* mod_dav will now continue returning a generic HTTP_METHOD_NOT_ALLOWED + error, which doesn't produce nice output on SVN, nor gives any details + on why the operation failed. + + Let's error out a bit earlier and produce an error message that is + easier to understand for both clients and users. */ + + /* It would be nice if we could error out a bit later (see issue #2295), + like in create_collection(), but mod_dav outsmarts us by just + returning the error when the node exists. */ + + return dav_svn__convert_err( + svn_error_createf(SVN_ERR_FS_ALREADY_EXISTS, NULL, + "Path already exists, path '%s'", + comb->priv.repos_path), + HTTP_METHOD_NOT_ALLOWED, NULL, pool); + } + return NULL; } Modified: subversion/branches/dump-load-cross-check/subversion/svn/auth-cmd.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/svn/auth-cmd.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/svn/auth-cmd.c (original) +++ subversion/branches/dump-load-cross-check/subversion/svn/auth-cmd.c Tue Feb 3 13:15:17 2015 @@ -41,6 +41,9 @@ #include "svn_config.h" #include "svn_auth.h" #include "svn_sorts.h" +#include "svn_base64.h" +#include "svn_x509.h" +#include "svn_time.h" #include "private/svn_cmdline_private.h" #include "private/svn_token.h" @@ -150,9 +153,6 @@ match_credential(svn_boolean_t *match, continue; /* don't match secrets */ else if (strcmp(key, SVN_CONFIG_AUTHN_ASCII_CERT_KEY) == 0) continue; /* don't match base64 data */ - else if (strcmp(key, SVN_CONFIG_AUTHN_HOSTNAME_KEY) == 0 || - strcmp(key, SVN_CONFIG_AUTHN_FINGERPRINT_KEY) == 0) - *match = match_pattern(pattern, value->data, TRUE, iterpool); else *match = match_pattern(pattern, value->data, FALSE, iterpool); @@ -168,6 +168,63 @@ match_credential(svn_boolean_t *match, } static svn_error_t * +show_cert(const svn_string_t *pem_cert, apr_pool_t *scratch_pool) +{ + const svn_string_t *der_cert; + svn_x509_certinfo_t *certinfo; + const apr_array_header_t *hostnames; + svn_error_t *err; + + /* Convert header-less PEM to DER by undoing base64 encoding. */ + der_cert = svn_base64_decode_string(pem_cert, scratch_pool); + + err = svn_x509_parse_cert(&certinfo, der_cert->data, der_cert->len, + scratch_pool, scratch_pool); + if (err) + { + /* Just display X.509 parsing errors as warnings and continue */ + svn_handle_warning2(stderr, err, "svn: "); + svn_error_clear(err); + return SVN_NO_ERROR; + } + + SVN_ERR(svn_cmdline_printf(scratch_pool, _("Subject: %s\n"), + svn_x509_certinfo_get_subject(certinfo, scratch_pool))); + SVN_ERR(svn_cmdline_printf(scratch_pool, _("Valid from: %s\n"), + svn_time_to_human_cstring( + svn_x509_certinfo_get_valid_from(certinfo), + scratch_pool))); + SVN_ERR(svn_cmdline_printf(scratch_pool, _("Valid until: %s\n"), + svn_time_to_human_cstring( + svn_x509_certinfo_get_valid_to(certinfo), + scratch_pool))); + SVN_ERR(svn_cmdline_printf(scratch_pool, _("Issuer: %s\n"), + svn_x509_certinfo_get_issuer(certinfo, scratch_pool))); + SVN_ERR(svn_cmdline_printf(scratch_pool, _("Fingerprint: %s\n"), + svn_checksum_to_cstring_display( + svn_x509_certinfo_get_digest(certinfo), + scratch_pool))); + + hostnames = svn_x509_certinfo_get_hostnames(certinfo); + if (hostnames && !apr_is_empty_array(hostnames)) + { + int i; + svn_stringbuf_t *buf = svn_stringbuf_create_empty(scratch_pool); + for (i = 0; i < hostnames->nelts; ++i) + { + const char *hostname = APR_ARRAY_IDX(hostnames, i, const char*); + if (i > 0) + svn_stringbuf_appendbytes(buf, ", ", 2); + svn_stringbuf_appendbytes(buf, hostname, strlen(hostname)); + } + SVN_ERR(svn_cmdline_printf(scratch_pool, _("Hostnames: %s\n"), + buf->data)); + } + + return SVN_NO_ERROR; +} + +static svn_error_t * list_credential(const char *cred_kind, const char *realmstring, apr_array_header_t *cred_items, @@ -188,7 +245,7 @@ list_credential(const char *cred_kind, svn_sort__item_t item; const char *key; svn_string_t *value; - + svn_pool_clear(iterpool); item = APR_ARRAY_IDX(cred_items, i, svn_sort__item_t); key = item.key; @@ -218,20 +275,7 @@ list_credential(const char *cred_kind, else if (strcmp(key, SVN_CONFIG_AUTHN_USERNAME_KEY) == 0) SVN_ERR(svn_cmdline_printf(iterpool, _("Username: %s\n"), value->data)); else if (strcmp(key, SVN_CONFIG_AUTHN_ASCII_CERT_KEY) == 0) - continue; /* don't show data which is not human-readable */ - else if (strcmp(key, SVN_CONFIG_AUTHN_HOSTNAME_KEY) == 0) - SVN_ERR(svn_cmdline_printf(iterpool, _("Hostname: %s\n"), value->data)); - else if (strcmp(key, SVN_CONFIG_AUTHN_VALID_FROM_KEY) == 0) - SVN_ERR(svn_cmdline_printf(iterpool, _("Valid from: %s\n"), - value->data)); - else if (strcmp(key, SVN_CONFIG_AUTHN_VALID_UNTIL_KEY) == 0) - SVN_ERR(svn_cmdline_printf(iterpool, _("Valid until: %s\n"), - value->data)); - else if (strcmp(key, SVN_CONFIG_AUTHN_ISSUER_DN_KEY) == 0) - SVN_ERR(svn_cmdline_printf(iterpool, _("Issuer: %s\n"), value->data)); - else if (strcmp(key, SVN_CONFIG_AUTHN_FINGERPRINT_KEY) == 0) - SVN_ERR(svn_cmdline_printf(iterpool, _("Fingerprint: %s\n"), - value->data)); + SVN_ERR(show_cert(value, iterpool)); else if (strcmp(key, SVN_CONFIG_AUTHN_FAILURES_KEY) == 0) SVN_ERR(show_cert_failures(value->data, iterpool)); else Modified: subversion/branches/dump-load-cross-check/subversion/svn/svn.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/svn/svn.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/svn/svn.c (original) +++ subversion/branches/dump-load-cross-check/subversion/svn/svn.c Tue Feb 3 13:15:17 2015 @@ -1300,7 +1300,9 @@ const svn_opt_subcommand_desc2_t svn_cl_ "\n" " 1. Removes versioned props in working copy.\n" " 2. Removes unversioned remote prop on repos revision.\n" - " TARGET only determines which repository to access.\n"), + " TARGET only determines which repository to access.\n" + "\n" + " See 'svn help propset' for descriptions of the svn:* special properties.\n"), {'q', 'R', opt_depth, 'r', opt_revprop, opt_changelist} }, { "propedit", svn_cl__propedit, {"pedit", "pe"}, N_ @@ -1312,7 +1314,7 @@ const svn_opt_subcommand_desc2_t svn_cl_ " 2. Edits unversioned remote prop on repos revision.\n" " TARGET only determines which repository to access.\n" "\n" - " See 'svn help propset' for more on setting properties.\n"), + " See 'svn help propset' for descriptions of the svn:* special properties.\n"), {'r', opt_revprop, SVN_CL__LOG_MSG_OPTIONS, opt_force} }, { "propget", svn_cl__propget, {"pget", "pg"}, N_ @@ -1333,7 +1335,9 @@ const svn_opt_subcommand_desc2_t svn_cl_ " By default, an extra newline is printed after the property value so that\n" " the output looks pretty. With a single TARGET, depth 'empty' and without\n" " --show-inherited-props, you can use the --strict option to disable this\n" - " (useful when redirecting a binary property value to a file, for example).\n"), + " (useful when redirecting a binary property value to a file, for example).\n" + "\n" + " See 'svn help propset' for descriptions of the svn:* special properties.\n"), {'v', 'R', opt_depth, 'r', opt_revprop, opt_strict, opt_xml, opt_changelist, opt_show_inherited_props }, {{'v', N_("print path, name and value on separate lines")}, @@ -1350,7 +1354,9 @@ const svn_opt_subcommand_desc2_t svn_cl_ " TARGET only determines which repository to access.\n" "\n" " With --verbose, the property values are printed as well, like 'svn propget\n" - " --verbose'. With --quiet, the paths are not printed.\n"), + " --verbose'. With --quiet, the paths are not printed.\n" + "\n" + " See 'svn help propset' for descriptions of the svn:* special properties.\n"), {'v', 'R', opt_depth, 'r', 'q', opt_revprop, opt_xml, opt_changelist, opt_show_inherited_props }, {{'v', N_("print path, name and value on separate lines")}, Modified: subversion/branches/dump-load-cross-check/subversion/svnserve/serve.c URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/svnserve/serve.c?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/svnserve/serve.c (original) +++ subversion/branches/dump-load-cross-check/subversion/svnserve/serve.c Tue Feb 3 13:15:17 2015 @@ -1725,6 +1725,11 @@ static svn_error_t *get_dir(svn_ra_svn_c &ab, root, full_path, pool)); + /* Fetch the directories' entries before starting the response, to allow + proper error handling in cases like when FULL_PATH doesn't exist */ + if (want_contents) + SVN_CMD_ERR(svn_fs_dir_entries(&entries, root, full_path, pool)); + /* Begin response ... */ SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w(r(!", "success", rev)); SVN_ERR(svn_ra_svn__write_proplist(conn, pool, props)); @@ -1736,8 +1741,6 @@ static svn_error_t *get_dir(svn_ra_svn_c /* Use epoch for a placeholder for a missing date. */ const char *missing_date = svn_time_to_cstring(0, pool); - SVN_CMD_ERR(svn_fs_dir_entries(&entries, root, full_path, pool)); - /* Transform the hash table's FS entries into dirents. This probably * belongs in libsvn_repos. */ subpool = svn_pool_create(pool); Modified: subversion/branches/dump-load-cross-check/subversion/tests/cmdline/blame_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/dump-load-cross-check/subversion/tests/cmdline/blame_tests.py?rev=1656719&r1=1656718&r2=1656719&view=diff ============================================================================== --- subversion/branches/dump-load-cross-check/subversion/tests/cmdline/blame_tests.py (original) +++ subversion/branches/dump-load-cross-check/subversion/tests/cmdline/blame_tests.py Tue Feb 3 13:15:17 2015 @@ -819,53 +819,33 @@ def blame_multiple_targets(sbox): sbox.build() # First, make a new revision of iota. - iota = os.path.join(sbox.wc_dir, 'iota') - svntest.main.file_append(iota, "New contents for iota\n") - svntest.main.run_svn(None, 'ci', '-m', '', iota) + sbox.simple_append('iota', "New contents for iota\n") + sbox.simple_commit() + iota = sbox.ospath('iota') expected_output = [ " 1 jrandom This is the file 'iota'.\n", " 2 jrandom New contents for iota\n", ] - def multiple_wc_targets(): - "multiple wc targets" + # We use --force to avoid an early bail from the current blame code, + # that performs a property check before the actual blame. - non_existent = os.path.join(sbox.wc_dir, 'non-existent') + non_existent = os.path.join(sbox.wc_dir, 'non-existent') + svntest.actions.run_and_verify_svn(None, None, + ".*W155010: The node.*non-existent'.*", + 'blame', non_existent, iota, + '--force') + + iota_url = sbox.repo_url + '/iota' + non_existent_url = sbox.repo_url + '/non-existent' + + # SVN_ERR_FS_NOT_FILE | SVN_ERR_FS_NOT_FOUND + svntest.actions.run_and_verify_svn(None, None, + ".*W1600(13|17): '.*non-existent' .*not", + 'blame', non_existent_url, iota_url, + '--force') - expected_err = ".*W155010.*\n.*E200009.*" - expected_err_re = re.compile(expected_err, re.DOTALL) - - exit_code, output, error = svntest.main.run_svn(1, 'blame', - non_existent, iota) - - # Verify error - if not expected_err_re.match("".join(error)): - raise svntest.Failure('blame failed: expected error "%s", but received ' - '"%s"' % (expected_err, "".join(error))) - svntest.verify.verify_outputs(None, output, None, expected_output, None) - - def multiple_url_targets(): - "multiple url targets" - - iota_url = sbox.repo_url + '/iota' - non_existent = sbox.repo_url + '/non-existent' - - expected_err = ".*(W160017|W160013|W150000).*\n.*E200009.*" - expected_err_re = re.compile(expected_err, re.DOTALL) - - exit_code, output, error = svntest.main.run_svn(1, 'blame', - non_existent, iota_url) - - # Verify error - if not expected_err_re.match("".join(error)): - raise svntest.Failure('blame failed: expected error "%s", but received ' - '"%s"' % (expected_err, "".join(error))) - svntest.verify.verify_outputs(None, output, None, expected_output, None) - - # Test one by one - multiple_wc_targets() - multiple_url_targets() @Issue(4034) def blame_eol_handling(sbox):
