You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2015/11/30 11:24:23 UTC
svn commit: r1717223 [41/50] - in /subversion/branches/ra-git: ./ build/
build/ac-macros/ build/generator/ build/generator/templates/
contrib/hook-scripts/ notes/ notes/api-errata/1.9/ notes/move-tracking/
subversion/ subversion/bindings/ctypes-python/...
Modified: subversion/branches/ra-git/subversion/svnbench/svnbench.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/svnbench/svnbench.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/svnbench/svnbench.c (original)
+++ subversion/branches/ra-git/subversion/svnbench/svnbench.c Mon Nov 30 10:24:16 2015
@@ -42,6 +42,7 @@
#include "private/svn_opt_private.h"
#include "private/svn_cmdline_private.h"
+#include "private/svn_string_private.h"
#include "svn_private_config.h"
@@ -67,11 +68,7 @@ typedef enum svn_cl__longopt_t {
opt_with_all_revprops,
opt_with_no_revprops,
opt_trust_server_cert,
- opt_trust_server_cert_unknown_ca,
- opt_trust_server_cert_cn_mismatch,
- opt_trust_server_cert_expired,
- opt_trust_server_cert_not_yet_valid,
- opt_trust_server_cert_other_failure,
+ opt_trust_server_cert_failures,
opt_changelist
} svn_cl__longopt_t;
@@ -127,29 +124,23 @@ const apr_getopt_option_t svn_cl__option
{"no-auth-cache", opt_no_auth_cache, 0,
N_("do not cache authentication tokens")},
{"trust-server-cert", opt_trust_server_cert, 0,
- N_("deprecated; same as --trust-unknown-ca")},
- {"trust-unknown-ca", opt_trust_server_cert_unknown_ca, 0,
- N_("with --non-interactive, accept SSL server\n"
+ N_("deprecated; same as\n"
" "
- "certificates from unknown certificate authorities")},
- {"trust-cn-mismatch", opt_trust_server_cert_cn_mismatch, 0,
+ "--trust-server-cert-failures=unknown-ca")},
+ {"trust-server-cert-failures", opt_trust_server_cert_failures, 1,
N_("with --non-interactive, accept SSL server\n"
" "
- "certificates even if the server hostname does not\n"
+ "certificates with failures; ARG is comma-separated\n"
" "
- "match the certificate's common name attribute")},
- {"trust-expired", opt_trust_server_cert_expired, 0,
- N_("with --non-interactive, accept expired SSL server\n"
+ "list of 'unknown-ca' (Unknown Authority),\n"
" "
- "certificates")},
- {"trust-not-yet-valid", opt_trust_server_cert_not_yet_valid, 0,
- N_("with --non-interactive, accept SSL server\n"
+ "'cn-mismatch' (Hostname mismatch), 'expired'\n"
" "
- "certificates from the future")},
- {"trust-other-failure", opt_trust_server_cert_other_failure, 0,
- N_("with --non-interactive, accept SSL server\n"
+ "(Expired certificate), 'not-yet-valid' (Not yet\n"
" "
- "certificates with failures other than the above")},
+ "valid certificate) and 'other' (all other not\n"
+ " "
+ "separately classified certificate errors).")},
{"non-interactive", opt_non_interactive, 0,
N_("do no interactive prompting")},
{"config-dir", opt_config_dir, 1,
@@ -205,9 +196,7 @@ const apr_getopt_option_t svn_cl__option
willy-nilly to every invocation of 'svn') . */
const int svn_cl__global_options[] =
{ opt_auth_username, opt_auth_password, opt_no_auth_cache, opt_non_interactive,
- opt_trust_server_cert, opt_trust_server_cert_unknown_ca,
- opt_trust_server_cert_cn_mismatch, opt_trust_server_cert_expired,
- opt_trust_server_cert_not_yet_valid, opt_trust_server_cert_other_failure,
+ opt_trust_server_cert, opt_trust_server_cert_failures,
opt_config_dir, opt_config_options, 0
};
@@ -219,6 +208,26 @@ const svn_opt_subcommand_desc2_t svn_cl_
{0} },
/* This command is also invoked if we see option "--help", "-h" or "-?". */
+ { "null-blame", svn_cl__null_blame, {0}, N_
+ ("Fetch all versions of a file in a batch.\n"
+ "usage: null-blame [-rM:N] TARGET[@REV]...\n"
+ "\n"
+ " With no revision range (same as -r0:REV), or with '-r M:N' where M < N,\n"
+ " annotate each line that is present in revision N of the file, with\n"
+ " the last revision at or before rN that changed or added the line,\n"
+ " looking back no further than rM.\n"
+ "\n"
+ " With a reverse revision range '-r M:N' where M > N,\n"
+ " annotate each line that is present in revision N of the file, with\n"
+ " the next revision after rN that changed or deleted the line,\n"
+ " looking forward no further than rM.\n"
+ "\n"
+ " If specified, REV determines in which revision the target is first\n"
+ " looked up.\n"
+ "\n"
+ " Write the annotated result to standard output.\n"),
+ {'r', 'g'} },
+
{ "null-export", svn_cl__null_export, {0}, N_
("Create an unversioned copy of a tree.\n"
"usage: null-export [-r REV] URL[@PEGREV]\n"
@@ -281,8 +290,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
" follow copy history by default. Use --stop-on-copy to disable this\n"
" behavior, which can be useful for determining branchpoints.\n"),
{'r', 'q', 'v', 'g', 'c', opt_targets, opt_stop_on_copy,
- 'l', opt_with_all_revprops, opt_with_no_revprops, opt_with_revprop,
- 'x',},
+ 'l', opt_with_all_revprops, opt_with_no_revprops, opt_with_revprop,},
{{opt_with_revprop, N_("retrieve revision property ARG")},
{'c', N_("the change made in revision ARG")}} },
@@ -330,6 +338,23 @@ signal_handler(int signum)
cancelled = TRUE;
}
+/* Baton for ra_progress_func() callback. */
+typedef struct ra_progress_baton_t
+{
+ apr_off_t bytes_transferred;
+} ra_progress_baton_t;
+
+/* Implements svn_ra_progress_notify_func_t. */
+static void
+ra_progress_func(apr_off_t progress,
+ apr_off_t total,
+ void *baton,
+ apr_pool_t *pool)
+{
+ ra_progress_baton_t *b = baton;
+ b->bytes_transferred = progress;
+}
+
/* Our cancellation callback. */
svn_error_t *
svn_cl__check_cancel(void *baton)
@@ -364,6 +389,8 @@ sub_main(int *exit_code, int argc, const
svn_config_t *cfg_config;
svn_boolean_t descend = TRUE;
svn_boolean_t use_notifier = TRUE;
+ apr_time_t start_time, time_taken;
+ ra_progress_baton_t ra_progress_baton = {0};
received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int));
@@ -527,10 +554,10 @@ sub_main(int *exit_code, int argc, const
opt_arg, pool) != 0)
{
SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
- return svn_error_createf
- (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("Syntax error in revision argument '%s'"),
- utf8_opt_arg);
+ return svn_error_createf(
+ SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("Syntax error in revision argument '%s'"),
+ utf8_opt_arg);
}
break;
case 'v':
@@ -605,24 +632,17 @@ sub_main(int *exit_code, int argc, const
opt_state.non_interactive = TRUE;
break;
case opt_trust_server_cert: /* backwards compat to 1.8 */
- case opt_trust_server_cert_unknown_ca:
opt_state.trust_server_cert_unknown_ca = TRUE;
break;
- case opt_trust_server_cert_cn_mismatch:
- opt_state.trust_server_cert_cn_mismatch = TRUE;
- break;
- case opt_trust_server_cert_expired:
- opt_state.trust_server_cert_expired = TRUE;
- break;
- case opt_trust_server_cert_not_yet_valid:
- opt_state.trust_server_cert_not_yet_valid = TRUE;
- break;
- case opt_trust_server_cert_other_failure:
- opt_state.trust_server_cert_other_failure = TRUE;
- break;
- case 'x':
- SVN_ERR(svn_utf_cstring_to_utf8(&opt_state.extensions,
- opt_arg, pool));
+ case opt_trust_server_cert_failures:
+ SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+ SVN_ERR(svn_cmdline__parse_trust_options(
+ &opt_state.trust_server_cert_unknown_ca,
+ &opt_state.trust_server_cert_cn_mismatch,
+ &opt_state.trust_server_cert_expired,
+ &opt_state.trust_server_cert_not_yet_valid,
+ &opt_state.trust_server_cert_other_failure,
+ utf8_opt_arg, pool));
break;
case opt_config_dir:
{
@@ -639,7 +659,7 @@ sub_main(int *exit_code, int argc, const
SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool));
SVN_ERR(svn_cmdline__parse_config_option(opt_state.config_options,
- opt_arg, pool));
+ opt_arg, "svnbench: ", pool));
break;
case opt_with_all_revprops:
/* If --with-all-revprops is specified along with one or more
@@ -755,9 +775,9 @@ sub_main(int *exit_code, int argc, const
if (subcommand->name[0] == '-')
SVN_ERR(svn_cl__help(NULL, NULL, pool));
else
- svn_error_clear
- (svn_cmdline_fprintf
- (stderr, pool, _("Subcommand '%s' doesn't accept option '%s'\n"
+ svn_error_clear(
+ svn_cmdline_fprintf(
+ stderr, pool, _("Subcommand '%s' doesn't accept option '%s'\n"
"Type 'svnbench help %s' for usage.\n"),
subcommand->name, optstr, subcommand->name));
*exit_code = EXIT_FAILURE;
@@ -798,25 +818,13 @@ sub_main(int *exit_code, int argc, const
/* --trust-* options can only be used with --non-interactive */
if (!opt_state.non_interactive)
{
- if (opt_state.trust_server_cert_unknown_ca)
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-unknown-ca requires "
- "--non-interactive"));
- if (opt_state.trust_server_cert_cn_mismatch)
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-cn-mismatch requires "
- "--non-interactive"));
- if (opt_state.trust_server_cert_expired)
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-expired requires "
- "--non-interactive"));
- if (opt_state.trust_server_cert_not_yet_valid)
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-not-yet-valid requires "
- "--non-interactive"));
- if (opt_state.trust_server_cert_other_failure)
+ if (opt_state.trust_server_cert_unknown_ca
+ || opt_state.trust_server_cert_cn_mismatch
+ || opt_state.trust_server_cert_expired
+ || opt_state.trust_server_cert_not_yet_valid
+ || opt_state.trust_server_cert_other_failure)
return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-other-failure requires "
+ _("--trust-server-cert-failures requires "
"--non-interactive"));
}
@@ -842,7 +850,8 @@ sub_main(int *exit_code, int argc, const
/* Only a few commands can accept a revision range; the rest can take at
most one revision number. */
- if (subcommand->cmd_func != svn_cl__null_log)
+ if (subcommand->cmd_func != svn_cl__null_blame
+ && subcommand->cmd_func != svn_cl__null_log)
{
if (opt_state.end_revision.kind != svn_opt_revision_unspecified)
{
@@ -949,8 +958,17 @@ sub_main(int *exit_code, int argc, const
ctx->conflict_func2 = NULL;
ctx->conflict_baton2 = NULL;
+ if (!opt_state.quiet)
+ {
+ ctx->progress_func = ra_progress_func;
+ ctx->progress_baton = &ra_progress_baton;
+ }
+
/* And now we finally run the subcommand. */
+ start_time = apr_time_now();
err = (*subcommand->cmd_func)(os, &command_baton, pool);
+ time_taken = apr_time_now() - start_time;
+
if (err)
{
/* For argument-related problems, suggest using the 'help'
@@ -979,6 +997,23 @@ sub_main(int *exit_code, int argc, const
return err;
}
+ else if ((subcommand->cmd_func != svn_cl__help) && !opt_state.quiet)
+ {
+ /* This formatting lines up nicely with the output of our sub-commands
+ * and gives musec resolution while not overflowing for 30 years. */
+ SVN_ERR(svn_cmdline_printf(pool,
+ _("%15.6f seconds taken\n"),
+ time_taken / 1.0e6));
+
+ /* Report how many bytes transferred over network if RA layer provided
+ this information. */
+ if (ra_progress_baton.bytes_transferred > 0)
+ SVN_ERR(svn_cmdline_printf(pool,
+ _("%15s bytes transferred over network\n"),
+ svn__i64toa_sep(
+ ra_progress_baton.bytes_transferred, ',',
+ pool)));
+ }
return SVN_NO_ERROR;
}
Modified: subversion/branches/ra-git/subversion/svndumpfilter/svndumpfilter.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/svndumpfilter/svndumpfilter.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/svndumpfilter/svndumpfilter.c (original)
+++ subversion/branches/ra-git/subversion/svndumpfilter/svndumpfilter.c Mon Nov 30 10:24:16 2015
@@ -48,42 +48,8 @@
#include "private/svn_cmdline_private.h"
#include "private/svn_sorts_private.h"
-#ifdef _WIN32
-typedef apr_status_t (__stdcall *open_fn_t)(apr_file_t **, apr_pool_t *);
-#else
-typedef apr_status_t (*open_fn_t)(apr_file_t **, apr_pool_t *);
-#endif
-
/*** Code. ***/
-/* Helper to open stdio streams */
-
-/* NOTE: we used to call svn_stream_from_stdio(), which wraps a stream
- around a standard stdio.h FILE pointer. The problem is that these
- pointers operate through C Run Time (CRT) on Win32, which does all
- sorts of translation on them: LF's become CRLF's, and ctrl-Z's
- embedded in Word documents are interpreted as premature EOF's.
-
- So instead, we use apr_file_open_std*, which bypass the CRT and
- directly wrap the OS's file-handles, which don't know or care about
- translation. Thus dump/load works correctly on Win32.
-*/
-static svn_error_t *
-create_stdio_stream(svn_stream_t **stream,
- open_fn_t open_fn,
- apr_pool_t *pool)
-{
- apr_file_t *stdio_file;
- apr_status_t apr_err = open_fn(&stdio_file, pool);
-
- if (apr_err)
- return svn_error_wrap_apr(apr_err, _("Can't open stdio file"));
-
- *stream = svn_stream_from_aprfile2(stdio_file, TRUE, pool);
- return SVN_NO_ERROR;
-}
-
-
/* Writes a property in dumpfile format to given stringbuf. */
static void
write_prop_to_stringbuf(svn_stringbuf_t *strbuf,
@@ -640,7 +606,7 @@ new_node_record(void **node_baton,
cf_orig_rev = SVN_STR_TO_REV(val);
cf_renum_val = apr_hash_get(pb->renumber_history,
&cf_orig_rev,
- sizeof(svn_revnum_t));
+ sizeof(cf_orig_rev));
if (! (cf_renum_val && SVN_IS_VALID_REVNUM(cf_renum_val->rev)))
return svn_error_createf
(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
@@ -730,14 +696,14 @@ adjust_mergeinfo(svn_string_t **final_va
svn_merge_range_t *);
revmap_start = apr_hash_get(pb->renumber_history,
- &range->start, sizeof(svn_revnum_t));
+ &range->start, sizeof(range->start));
if (! (revmap_start && SVN_IS_VALID_REVNUM(revmap_start->rev)))
return svn_error_createf
(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
_("No valid revision range 'start' in filtered stream"));
revmap_end = apr_hash_get(pb->renumber_history,
- &range->end, sizeof(svn_revnum_t));
+ &range->end, sizeof(range->end));
if (! (revmap_end && SVN_IS_VALID_REVNUM(revmap_end->rev)))
return svn_error_createf
(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
@@ -1065,12 +1031,10 @@ parse_baton_initialize(struct parse_bato
struct parse_baton_t *baton = apr_palloc(pool, sizeof(*baton));
/* Read the stream from STDIN. Users can redirect a file. */
- SVN_ERR(create_stdio_stream(&(baton->in_stream),
- apr_file_open_stdin, pool));
+ SVN_ERR(svn_stream_for_stdin2(&baton->in_stream, TRUE, pool));
/* Have the parser dump results to STDOUT. Users can redirect a file. */
- SVN_ERR(create_stdio_stream(&(baton->out_stream),
- apr_file_open_stdout, pool));
+ SVN_ERR(svn_stream_for_stdout(&baton->out_stream, pool));
baton->do_exclude = do_exclude;
Modified: subversion/branches/ra-git/subversion/svnfsfs/load-index-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/svnfsfs/load-index-cmd.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/svnfsfs/load-index-cmd.c (original)
+++ subversion/branches/ra-git/subversion/svnfsfs/load-index-cmd.c Mon Nov 30 10:24:16 2015
@@ -54,13 +54,15 @@ str_to_item_type(unsigned *type,
_("Unknown item type '%s'"), str);
}
-/* Parse the hex string given as const char * at IDX in TOKENS and return
- * its value in *VALUE_P. Check for index overflows and non-hex chars.
+/* Parse the string given as const char * at IDX in TOKENS and return its
+ * value in *VALUE_P. Assume that the string an integer with base RADIX.
+ * Check for index overflows and non-hex chars.
*/
static svn_error_t *
token_to_i64(apr_int64_t *value_p,
apr_array_header_t *tokens,
- int idx)
+ int idx,
+ int radix)
{
const char *hex;
char *end;
@@ -75,7 +77,7 @@ token_to_i64(apr_int64_t *value_p,
/* hex -> int conversion */
hex = APR_ARRAY_IDX(tokens, idx, const char *);
- value = apr_strtoi64(hex, &end, 16);
+ value = apr_strtoi64(hex, &end, radix);
/* Has the whole token be parsed without error? */
if (errno || *end != '\0')
@@ -102,11 +104,13 @@ parse_index_line(svn_fs_fs__p2l_entry_t
apr_int64_t value;
/* Parse the hex columns. */
- SVN_ERR(token_to_i64(&value, tokens, 0));
+ SVN_ERR(token_to_i64(&value, tokens, 0, 16));
result->offset = (apr_off_t)value;
- SVN_ERR(token_to_i64(&value, tokens, 1));
+ SVN_ERR(token_to_i64(&value, tokens, 1, 16));
result->size = (apr_off_t)value;
- SVN_ERR(token_to_i64(&value, tokens, 4));
+
+ /* Parse the rightmost colum that we care of. */
+ SVN_ERR(token_to_i64(&value, tokens, 4, 10));
result->item.number = (apr_uint64_t)value;
/* We now know that there were at least 5 columns.
@@ -182,7 +186,7 @@ subcommand__load_index(apr_getopt_t *os,
svnfsfs__opt_state *opt_state = baton;
svn_stream_t *input;
- SVN_ERR(svn_stream_for_stdin(&input, pool));
+ SVN_ERR(svn_stream_for_stdin2(&input, TRUE, pool));
SVN_ERR(load_index(opt_state->repository_path, input, pool));
return SVN_NO_ERROR;
Modified: subversion/branches/ra-git/subversion/svnfsfs/stats-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/svnfsfs/stats-cmd.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/svnfsfs/stats-cmd.c (original)
+++ subversion/branches/ra-git/subversion/svnfsfs/stats-cmd.c Mon Nov 30 10:24:16 2015
@@ -20,6 +20,8 @@
* ====================================================================
*/
+#include <assert.h>
+
#include "svn_fs.h"
#include "svn_pools.h"
#include "svn_sorts.h"
@@ -47,10 +49,10 @@ print_two_power(int i,
*/
const char *si_prefixes = " kMGTPEZY";
- int number = (1 << (i % 10));
- int thousands = i / 10;
+ int number = (i >= 0) ? (1 << (i % 10)) : 0;
+ int thousands = (i >= 0) ? (i / 10) : 0;
- char si_prefix = ((thousands >= 0) && (thousands < strlen(si_prefixes)))
+ char si_prefix = (thousands < strlen(si_prefixes))
? si_prefixes[thousands]
: '?';
@@ -72,7 +74,8 @@ print_rep_stats(svn_fs_fs__representatio
"%20s bytes expanded size\n"
"%20s bytes expanded shared size\n"
"%20s bytes with rep-sharing off\n"
- "%20s shared references\n"),
+ "%20s shared references\n"
+ "%20.3f average delta chain length\n"),
svn__ui64toa_sep(stats->total.packed_size, ',', pool),
svn__ui64toa_sep(stats->total.count, ',', pool),
svn__ui64toa_sep(stats->shared.packed_size, ',', pool),
@@ -80,7 +83,8 @@ print_rep_stats(svn_fs_fs__representatio
svn__ui64toa_sep(stats->total.expanded_size, ',', pool),
svn__ui64toa_sep(stats->shared.expanded_size, ',', pool),
svn__ui64toa_sep(stats->expanded_size, ',', pool),
- svn__ui64toa_sep(stats->references - stats->total.count, ',', pool));
+ svn__ui64toa_sep(stats->references - stats->total.count, ',', pool),
+ stats->chain_len / MAX(1.0, (double)stats->total.count));
}
/* Print the (used) contents of CHANGES. Use POOL for allocations.
@@ -235,6 +239,10 @@ print_extensions_by_changes(svn_fs_fs__s
{
svn_fs_fs__extension_info_t *info
= APR_ARRAY_IDX(data, i, svn_fs_fs__extension_info_t *);
+
+ /* If there are elements, then their count cannot be 0. */
+ assert(stats->file_histogram.total.count);
+
sum += info->node_histogram.total.count;
printf(_("%11s %20s (%2d%%) representations\n"),
info->extension,
@@ -243,11 +251,28 @@ print_extensions_by_changes(svn_fs_fs__s
stats->file_histogram.total.count));
}
- printf(_("%11s %20s (%2d%%) representations\n"),
- "(others)",
- svn__ui64toa_sep(stats->file_histogram.total.count - sum, ',', pool),
- (int)((stats->file_histogram.total.count - sum) * 100 /
- stats->file_histogram.total.count));
+ if (stats->file_histogram.total.count)
+ {
+ printf(_("%11s %20s (%2d%%) representations\n"),
+ "(others)",
+ svn__ui64toa_sep(stats->file_histogram.total.count - sum, ',',
+ pool),
+ (int)((stats->file_histogram.total.count - sum) * 100 /
+ stats->file_histogram.total.count));
+ }
+}
+
+/* Calculate a percentage, handling edge cases. */
+static int
+get_percentage(apr_uint64_t part,
+ apr_uint64_t total)
+{
+ /* This include total == 0. */
+ if (part >= total)
+ return 100;
+
+ /* Standard case. */
+ return (int)(part * 100.0 / total);
}
/* Print the (up to) 16 extensions in STATS with the largest total size of
@@ -269,15 +294,20 @@ print_extensions_by_nodes(svn_fs_fs__sta
printf(_("%11s %20s (%2d%%) bytes\n"),
info->extension,
svn__ui64toa_sep(info->node_histogram.total.sum, ',', pool),
- (int)(info->node_histogram.total.sum * 100 /
- stats->file_histogram.total.sum));
+ get_percentage(info->node_histogram.total.sum,
+ stats->file_histogram.total.sum));
}
- printf(_("%11s %20s (%2d%%) bytes\n"),
- "(others)",
- svn__ui64toa_sep(stats->file_histogram.total.sum - sum, ',', pool),
- (int)((stats->file_histogram.total.sum - sum) * 100 /
- stats->file_histogram.total.sum));
+ if (stats->file_histogram.total.sum > sum)
+ {
+ /* Total sum can't be zero here. */
+ printf(_("%11s %20s (%2d%%) bytes\n"),
+ "(others)",
+ svn__ui64toa_sep(stats->file_histogram.total.sum - sum, ',',
+ pool),
+ get_percentage(stats->file_histogram.total.sum - sum,
+ stats->file_histogram.total.sum));
+ }
}
/* Print the (up to) 16 extensions in STATS with the largest total size of
@@ -299,16 +329,20 @@ print_extensions_by_reps(svn_fs_fs__stat
printf(_("%11s %20s (%2d%%) bytes\n"),
info->extension,
svn__ui64toa_sep(info->rep_histogram.total.sum, ',', pool),
- (int)(info->rep_histogram.total.sum * 100 /
- stats->rep_size_histogram.total.sum));
+ get_percentage(info->rep_histogram.total.sum,
+ stats->rep_size_histogram.total.sum));
}
- printf(_("%11s %20s (%2d%%) bytes\n"),
- "(others)",
- svn__ui64toa_sep(stats->rep_size_histogram.total.sum - sum, ',',
- pool),
- (int)((stats->rep_size_histogram.total.sum - sum) * 100 /
- stats->rep_size_histogram.total.sum));
+ if (stats->rep_size_histogram.total.sum > sum)
+ {
+ /* Total sum can't be zero here. */
+ printf(_("%11s %20s (%2d%%) bytes\n"),
+ "(others)",
+ svn__ui64toa_sep(stats->rep_size_histogram.total.sum - sum, ',',
+ pool),
+ get_percentage(stats->rep_size_histogram.total.sum - sum,
+ stats->rep_size_histogram.total.sum));
+ }
}
/* Print per-extension histograms for the most frequent extensions in STATS.
@@ -343,7 +377,7 @@ print_stats(svn_fs_fs__stats_t *stats,
apr_pool_t *pool)
{
/* print results */
- printf("\nGlobal statistics:\n");
+ printf("\n\nGlobal statistics:\n");
printf(_("%20s bytes in %12s revisions\n"
"%20s bytes in %12s changes\n"
"%20s bytes in %12s node revision records\n"
@@ -381,6 +415,7 @@ print_stats(svn_fs_fs__stats_t *stats,
"%20s bytes in %12s representations of added file nodes\n"
"%20s bytes in %12s directory property representations\n"
"%20s bytes in %12s file property representations\n"
+ " with %12.3f average delta chain length\n"
"%20s bytes in header & footer overhead\n"),
svn__ui64toa_sep(stats->total_rep_stats.total.packed_size, ',',
pool),
@@ -401,8 +436,10 @@ print_stats(svn_fs_fs__stats_t *stats,
svn__ui64toa_sep(stats->file_prop_rep_stats.total.packed_size, ',',
pool),
svn__ui64toa_sep(stats->file_prop_rep_stats.total.count, ',', pool),
+ stats->total_rep_stats.chain_len
+ / (double)stats->total_rep_stats.total.count,
svn__ui64toa_sep(stats->total_rep_stats.total.overhead_size, ',',
- pool));
+ pool));
printf("\nDirectory representation statistics:\n");
print_rep_stats(&stats->dir_rep_stats, pool);
Modified: subversion/branches/ra-git/subversion/svnlook/svnlook.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/svnlook/svnlook.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/svnlook/svnlook.c (original)
+++ subversion/branches/ra-git/subversion/svnlook/svnlook.c Mon Nov 30 10:24:16 2015
@@ -43,6 +43,7 @@
#include "svn_dirent_uri.h"
#include "svn_path.h"
#include "svn_repos.h"
+#include "svn_cache_config.h"
#include "svn_fs.h"
#include "svn_time.h"
#include "svn_utf.h"
@@ -144,6 +145,13 @@ static const apr_getopt_option_t options
{"properties-only", svnlook__properties_only, 0,
N_("show only properties during the operation")},
+ {"memory-cache-size", 'M', 1,
+ N_("size of the extra in-memory cache in MB used to\n"
+ " "
+ "minimize redundant operations. Default: 16.\n"
+ " "
+ "[used for FSFS repositories only]")},
+
{"no-newline", svnlook__no_newline, 0,
N_("do not output the trailing newline")},
@@ -296,7 +304,7 @@ static const svn_opt_subcommand_desc2_t
N_("usage: svnlook tree REPOS_PATH [PATH_IN_REPOS]\n\n"
"Print the tree, starting at PATH_IN_REPOS (if supplied, at the root\n"
"of the tree otherwise), optionally showing node revision ids.\n"),
- {'r', 't', 'N', svnlook__show_ids, svnlook__full_paths} },
+ {'r', 't', 'N', svnlook__show_ids, svnlook__full_paths, 'M'} },
{"uuid", subcommand_uuid, {0},
N_("usage: svnlook uuid REPOS_PATH\n\n"
@@ -340,6 +348,7 @@ struct svnlook_opt_state
const char *diff_cmd; /* --diff-cmd */
svn_boolean_t show_inherited_props; /* --show-inherited-props */
svn_boolean_t no_newline; /* --no-newline */
+ apr_uint64_t memory_cache_size; /* --memory-cache-size */
};
@@ -426,8 +435,8 @@ get_property(svn_string_t **prop_value,
/* ...or revision property -- it's your call. */
else
- SVN_ERR(svn_fs_revision_prop(&raw_value, c->fs, c->rev_id,
- prop_name, pool));
+ SVN_ERR(svn_fs_revision_prop2(&raw_value, c->fs, c->rev_id,
+ prop_name, TRUE, pool, pool));
*prop_value = raw_value;
@@ -674,7 +683,8 @@ dump_contents(svn_stream_t *stream,
non-textual data -- in this case, the *IS_BINARY flag is set and no
temporary files are created.
- Use POOL for all that allocation goodness. */
+ TMPFILE1 and TMPFILE2 will be removed when RESULT_POOL is destroyed.
+ */
static svn_error_t *
prepare_tmpfiles(const char **tmpfile1,
const char **tmpfile2,
@@ -683,8 +693,8 @@ prepare_tmpfiles(const char **tmpfile1,
const char *path1,
svn_fs_root_t *root2,
const char *path2,
- const char *tmpdir,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_string_t *mimetype;
svn_stream_t *stream;
@@ -701,7 +711,7 @@ prepare_tmpfiles(const char **tmpfile1,
if (root1)
{
SVN_ERR(svn_fs_node_prop(&mimetype, root1, path1,
- SVN_PROP_MIME_TYPE, pool));
+ SVN_PROP_MIME_TYPE, scratch_pool));
if (mimetype && svn_mime_type_is_binary(mimetype->data))
{
*is_binary = TRUE;
@@ -711,7 +721,7 @@ prepare_tmpfiles(const char **tmpfile1,
if (root2)
{
SVN_ERR(svn_fs_node_prop(&mimetype, root2, path2,
- SVN_PROP_MIME_TYPE, pool));
+ SVN_PROP_MIME_TYPE, scratch_pool));
if (mimetype && svn_mime_type_is_binary(mimetype->data))
{
*is_binary = TRUE;
@@ -721,17 +731,15 @@ prepare_tmpfiles(const char **tmpfile1,
/* Now, prepare the two temporary files, each of which will either
be empty, or will have real contents. */
- SVN_ERR(svn_stream_open_unique(&stream, tmpfile1,
- tmpdir,
- svn_io_file_del_none,
- pool, pool));
- SVN_ERR(dump_contents(stream, root1, path1, pool));
-
- SVN_ERR(svn_stream_open_unique(&stream, tmpfile2,
- tmpdir,
- svn_io_file_del_none,
- pool, pool));
- SVN_ERR(dump_contents(stream, root2, path2, pool));
+ SVN_ERR(svn_stream_open_unique(&stream, tmpfile1, NULL,
+ svn_io_file_del_on_pool_cleanup,
+ result_pool, scratch_pool));
+ SVN_ERR(dump_contents(stream, root1, path1, scratch_pool));
+
+ SVN_ERR(svn_stream_open_unique(&stream, tmpfile2, NULL,
+ svn_io_file_del_on_pool_cleanup,
+ result_pool, scratch_pool));
+ SVN_ERR(dump_contents(stream, root2, path2, scratch_pool));
return SVN_NO_ERROR;
}
@@ -756,8 +764,9 @@ generate_label(const char **label,
if (svn_fs_is_revision_root(root))
{
rev = svn_fs_revision_root_revision(root);
- SVN_ERR(svn_fs_revision_prop(&date, fs, rev,
- SVN_PROP_REVISION_DATE, pool));
+ SVN_ERR(svn_fs_revision_prop2(&date, fs, rev,
+ SVN_PROP_REVISION_DATE, TRUE,
+ pool, pool));
}
else
{
@@ -830,7 +839,6 @@ print_diff_tree(svn_stream_t *out_stream
const char *path /* UTF-8! */,
const char *base_path /* UTF-8! */,
const svnlook_ctxt_t *c,
- const char *tmpdir,
apr_pool_t *pool)
{
const char *orig_path = NULL, *new_path = NULL;
@@ -839,7 +847,7 @@ print_diff_tree(svn_stream_t *out_stream
svn_boolean_t is_copy = FALSE;
svn_boolean_t binary = FALSE;
svn_boolean_t diff_header_printed = FALSE;
- apr_pool_t *subpool;
+ apr_pool_t *iterpool;
svn_stringbuf_t *header;
SVN_ERR(check_cancel(NULL));
@@ -900,7 +908,7 @@ print_diff_tree(svn_stream_t *out_stream
do_diff = TRUE;
SVN_ERR(prepare_tmpfiles(&orig_path, &new_path, &binary,
base_root, base_path, root, path,
- tmpdir, pool));
+ pool, pool));
}
else if (c->diff_copy_from && node->action == 'A' && is_copy)
{
@@ -909,7 +917,7 @@ print_diff_tree(svn_stream_t *out_stream
do_diff = TRUE;
SVN_ERR(prepare_tmpfiles(&orig_path, &new_path, &binary,
base_root, base_path, root, path,
- tmpdir, pool));
+ pool, pool));
}
}
else if (! c->no_diff_added && node->action == 'A')
@@ -918,14 +926,14 @@ print_diff_tree(svn_stream_t *out_stream
orig_empty = TRUE;
SVN_ERR(prepare_tmpfiles(&orig_path, &new_path, &binary,
NULL, base_path, root, path,
- tmpdir, pool));
+ pool, pool));
}
else if (! c->no_diff_deleted && node->action == 'D')
{
do_diff = TRUE;
SVN_ERR(prepare_tmpfiles(&orig_path, &new_path, &binary,
base_root, base_path, NULL, path,
- tmpdir, pool));
+ pool, pool));
}
/* The header for the copy case has already been created, and we don't
@@ -1091,12 +1099,6 @@ print_diff_tree(svn_stream_t *out_stream
}
}
- /* Make sure we delete any temporary files. */
- if (orig_path)
- SVN_ERR(svn_io_remove_file2(orig_path, FALSE, pool));
- if (new_path)
- SVN_ERR(svn_io_remove_file2(new_path, FALSE, pool));
-
/*** Now handle property diffs ***/
if ((node->prop_mod) && (node->action != 'D') && (! c->ignore_properties))
{
@@ -1143,26 +1145,21 @@ print_diff_tree(svn_stream_t *out_stream
}
/* Return here if the node has no children. */
- node = node->child;
- if (! node)
+ if (! node->child)
return SVN_NO_ERROR;
/* Recursively handle the node's children. */
- subpool = svn_pool_create(pool);
- SVN_ERR(print_diff_tree(out_stream, encoding, root, base_root, node,
- svn_dirent_join(path, node->name, subpool),
- svn_dirent_join(base_path, node->name, subpool),
- c, tmpdir, subpool));
- while (node->sibling)
+ iterpool = svn_pool_create(pool);
+ for (node = node->child; node; node = node->sibling)
{
- svn_pool_clear(subpool);
- node = node->sibling;
+ svn_pool_clear(iterpool);
+
SVN_ERR(print_diff_tree(out_stream, encoding, root, base_root, node,
- svn_dirent_join(path, node->name, subpool),
- svn_dirent_join(base_path, node->name, subpool),
- c, tmpdir, subpool));
+ svn_dirent_join(path, node->name, iterpool),
+ svn_dirent_join(base_path, node->name, iterpool),
+ c, iterpool));
}
- svn_pool_destroy(subpool);
+ svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}
@@ -1525,12 +1522,10 @@ do_diff(svnlook_ctxt_t *c, apr_pool_t *p
SVN_ERR(generate_delta_tree(&tree, c->repos, root, base_rev_id, pool));
if (tree)
{
- const char *tmpdir;
svn_stream_t *out_stream;
const char *encoding = svn_cmdline_output_encoding(pool);
SVN_ERR(svn_fs_revision_root(&base_root, c->fs, base_rev_id, pool));
- SVN_ERR(svn_io_temp_dir(&tmpdir, pool));
/* This fflush() might seem odd, but it was added to deal
with this bug report:
@@ -1559,7 +1554,7 @@ do_diff(svnlook_ctxt_t *c, apr_pool_t *p
SVN_ERR(svn_stream_for_stdout(&out_stream, pool));
SVN_ERR(print_diff_tree(out_stream, encoding, root, base_root, tree,
- "", "", c, tmpdir, pool));
+ "", "", c, pool));
}
return SVN_NO_ERROR;
}
@@ -1876,7 +1871,8 @@ do_plist(svnlook_ctxt_t *c,
}
else if (c->is_revision)
{
- SVN_ERR(svn_fs_revision_proplist(&props, c->fs, c->rev_id, pool));
+ SVN_ERR(svn_fs_revision_proplist2(&props, c->fs, c->rev_id, TRUE,
+ pool, pool));
revprop = TRUE;
}
else
@@ -2487,6 +2483,7 @@ sub_main(int *exit_code, int argc, const
/* Initialize opt_state. */
memset(&opt_state, 0, sizeof(opt_state));
opt_state.rev = SVN_INVALID_REVNUM;
+ opt_state.memory_cache_size = svn_cache_config_get()->cache_size;
/* Parse options. */
SVN_ERR(svn_cmdline__getopt_init(&os, argc, argv, pool));
@@ -2528,6 +2525,11 @@ sub_main(int *exit_code, int argc, const
opt_state.txn = opt_arg;
break;
+ case 'M':
+ opt_state.memory_cache_size
+ = 0x100000 * apr_strtoi64(opt_arg, NULL, 0);
+ break;
+
case 'N':
opt_state.non_recursive = TRUE;
break;
@@ -2823,6 +2825,17 @@ sub_main(int *exit_code, int argc, const
apr_signal(SIGXFSZ, SIG_IGN);
#endif
+ /* Configure FSFS caches for maximum efficiency with svnadmin.
+ * Also, apply the respective command line parameters, if given. */
+ {
+ svn_cache_config_t settings = *svn_cache_config_get();
+
+ settings.cache_size = opt_state.memory_cache_size;
+ settings.single_threaded = TRUE;
+
+ svn_cache_config_set(&settings);
+ }
+
/* Run the subcommand. */
err = (*subcommand->cmd_func)(os, &opt_state, pool);
if (err)
Modified: subversion/branches/ra-git/subversion/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/svnmucc/svnmucc.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/svnmucc/svnmucc.c (original)
+++ subversion/branches/ra-git/subversion/svnmucc/svnmucc.c Mon Nov 30 10:24:16 2015
@@ -193,7 +193,7 @@ execute(const apr_array_header_t *action
SVN_ERR(svn_stream_open_readonly(&src, action->path[1],
pool, iterpool));
else
- SVN_ERR(svn_stream_for_stdin(&src, pool));
+ SVN_ERR(svn_stream_for_stdin2(&src, TRUE, pool));
if (kind == svn_node_file)
@@ -295,18 +295,16 @@ help(FILE *stream, apr_pool_t *pool)
" prompt only if standard input is a terminal)\n"
" --force-interactive : do interactive prompting even if standard\n"
" input is not a terminal\n"
- " --trust-server-cert : deprecated; same as --trust-unknown-ca\n"
- " --trust-unknown-ca : with --non-interactive, accept SSL server\n"
- " certificates from unknown certificate authorities\n"
- " --trust-cn-mismatch : with --non-interactive, accept SSL server\n"
- " certificates even if the server hostname does not\n"
- " match the certificate's common name attribute\n"
- " --trust-expired : with --non-interactive, accept expired SSL server\n"
- " certificates\n"
- " --trust-not-yet-valid : with --non-interactive, accept SSL server\n"
- " certificates from the future\n"
- " --trust-other-failure : with --non-interactive, accept SSL server\n"
- " certificates with failures other than the above\n"
+ " --trust-server-cert : deprecated;\n"
+ " same as --trust-server-cert-failures=unknown-ca\n"
+ " --trust-server-cert-failures ARG\n"
+ " with --non-interactive, accept SSL server\n"
+ " certificates with failures; ARG is comma-separated\n"
+ " list of 'unknown-ca' (Unknown Authority),\n"
+ " 'cn-mismatch' (Hostname mismatch), 'expired'\n"
+ " (Expired certificate),'not-yet-valid' (Not yet\n"
+ " valid certificate) and 'other' (all other not\n"
+ " separately classified certificate errors).\n"
" -X [--extra-args] ARG : append arguments from file ARG (one per line;\n"
" use \"-\" to read from standard input)\n"
" --config-dir ARG : use ARG to override the config directory\n"
@@ -472,11 +470,7 @@ sub_main(int *exit_code, int argc, const
non_interactive_opt,
force_interactive_opt,
trust_server_cert_opt,
- trust_server_cert_unknown_ca_opt,
- trust_server_cert_cn_mismatch_opt,
- trust_server_cert_expired_opt,
- trust_server_cert_not_yet_valid_opt,
- trust_server_cert_other_failure_opt,
+ trust_server_cert_failures_opt,
};
static const apr_getopt_option_t options[] = {
{"message", 'm', 1, ""},
@@ -492,11 +486,7 @@ sub_main(int *exit_code, int argc, const
{"non-interactive", non_interactive_opt, 0, ""},
{"force-interactive", force_interactive_opt, 0, ""},
{"trust-server-cert", trust_server_cert_opt, 0, ""},
- {"trust-unknown-ca", trust_server_cert_unknown_ca_opt, 0, ""},
- {"trust-cn-mismatch", trust_server_cert_cn_mismatch_opt, 0, ""},
- {"trust-expired", trust_server_cert_expired_opt, 0, ""},
- {"trust-not-yet-valid", trust_server_cert_not_yet_valid_opt, 0, ""},
- {"trust-other-failure", trust_server_cert_other_failure_opt, 0, ""},
+ {"trust-server-cert-failures", trust_server_cert_failures_opt, 1, ""},
{"config-dir", config_dir_opt, 1, ""},
{"config-option", config_inline_opt, 1, ""},
{"no-auth-cache", no_auth_cache_opt, 0, ""},
@@ -604,20 +594,17 @@ sub_main(int *exit_code, int argc, const
force_interactive = TRUE;
break;
case trust_server_cert_opt: /* backward compat */
- case trust_server_cert_unknown_ca_opt:
trust_unknown_ca = TRUE;
break;
- case trust_server_cert_cn_mismatch_opt:
- trust_cn_mismatch = TRUE;
- break;
- case trust_server_cert_expired_opt:
- trust_expired = TRUE;
- break;
- case trust_server_cert_not_yet_valid_opt:
- trust_not_yet_valid = TRUE;
- break;
- case trust_server_cert_other_failure_opt:
- trust_other_failure = TRUE;
+ case trust_server_cert_failures_opt:
+ SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, arg, pool));
+ SVN_ERR(svn_cmdline__parse_trust_options(
+ &trust_unknown_ca,
+ &trust_cn_mismatch,
+ &trust_expired,
+ &trust_not_yet_valid,
+ &trust_other_failure,
+ opt_arg, pool));
break;
case config_dir_opt:
SVN_ERR(svn_utf_cstring_to_utf8(&config_dir, arg, pool));
@@ -625,6 +612,7 @@ sub_main(int *exit_code, int argc, const
case config_inline_opt:
SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, arg, pool));
SVN_ERR(svn_cmdline__parse_config_option(config_options, opt_arg,
+ "svnmucc: ",
pool));
break;
case no_auth_cache_opt:
@@ -664,25 +652,10 @@ sub_main(int *exit_code, int argc, const
if (!non_interactive)
{
- if (trust_unknown_ca)
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-unknown-ca requires "
- "--non-interactive"));
- if (trust_cn_mismatch)
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-cn-mismatch requires "
- "--non-interactive"));
- if (trust_expired)
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-expired requires "
- "--non-interactive"));
- if (trust_not_yet_valid)
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-not-yet-valid requires "
- "--non-interactive"));
- if (trust_other_failure)
+ if (trust_unknown_ca || trust_cn_mismatch || trust_expired
+ || trust_not_yet_valid || trust_other_failure)
return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-other-failure requires "
+ _("--trust-server-cert-failures requires "
"--non-interactive"));
}
Modified: subversion/branches/ra-git/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/svnrdump/dump_editor.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/svnrdump/dump_editor.c (original)
+++ subversion/branches/ra-git/subversion/svnrdump/dump_editor.c Mon Nov 30 10:24:16 2015
@@ -879,7 +879,7 @@ close_file(void *file_baton,
{
struct file_baton *fb = file_baton;
struct dump_edit_baton *eb = fb->eb;
- apr_finfo_t *info = apr_pcalloc(pool, sizeof(apr_finfo_t));
+ svn_filesize_t text_content_length = 0;
svn_stringbuf_t *propstring = NULL;
svn_repos__dumpfile_headers_t *headers;
@@ -903,15 +903,12 @@ close_file(void *file_baton,
/* Dump the text headers */
if (fb->dump_text)
{
- apr_status_t err;
-
/* Text-delta: true */
svn_repos__dumpfile_header_push(
headers, SVN_REPOS_DUMPFILE_TEXT_DELTA, "true");
- err = apr_file_info_get(info, APR_FINFO_SIZE, eb->delta_file);
- if (err)
- SVN_ERR(svn_error_wrap_apr(err, NULL));
+ SVN_ERR(svn_io_file_size_get(&text_content_length, eb->delta_file,
+ pool));
if (fb->base_checksum)
/* Text-delta-base-md5: */
@@ -925,7 +922,7 @@ close_file(void *file_baton,
/* Dump the headers and props now */
SVN_ERR(svn_repos__dump_node_record(eb->stream, headers, propstring,
- fb->dump_text, info->size,
+ fb->dump_text, text_content_length,
FALSE /*content_length_always*/,
pool));
Modified: subversion/branches/ra-git/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/svnrdump/load_editor.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/svnrdump/load_editor.c (original)
+++ subversion/branches/ra-git/subversion/svnrdump/load_editor.c Mon Nov 30 10:24:16 2015
@@ -167,8 +167,7 @@ set_revision_mapping(apr_hash_t *rev_map
sizeof(svn_revnum_t) * 2);
mapped_revs[0] = from_rev;
mapped_revs[1] = to_rev;
- apr_hash_set(rev_map, mapped_revs,
- sizeof(svn_revnum_t), mapped_revs + 1);
+ apr_hash_set(rev_map, mapped_revs, sizeof(*mapped_revs), mapped_revs + 1);
}
/* Return the revision to which FROM_REV maps in REV_MAP, or
@@ -392,7 +391,7 @@ new_revision_record(void **revision_bato
{
struct revision_baton *rb;
struct parse_baton *pb;
- apr_hash_index_t *hi;
+ const char *rev_str;
svn_revnum_t head_rev;
rb = apr_pcalloc(pool, sizeof(*rb));
@@ -401,14 +400,9 @@ new_revision_record(void **revision_bato
rb->pb = pb;
rb->db = NULL;
- for (hi = apr_hash_first(pool, headers); hi; hi = apr_hash_next(hi))
- {
- const char *hname = apr_hash_this_key(hi);
- const char *hval = apr_hash_this_val(hi);
-
- if (strcmp(hname, SVN_REPOS_DUMPFILE_REVISION_NUMBER) == 0)
- rb->rev = atoi(hval);
- }
+ rev_str = svn_hash_gets(headers, SVN_REPOS_DUMPFILE_REVISION_NUMBER);
+ if (rev_str)
+ rb->rev = SVN_STR_TO_REV(rev_str);
SVN_ERR(svn_ra_get_latest_revnum(pb->session, &head_rev, pool));
@@ -499,6 +493,7 @@ new_node_record(void **node_baton,
const struct svn_delta_editor_t *commit_editor = rb->pb->commit_editor;
void *commit_edit_baton = rb->pb->commit_edit_baton;
struct node_baton *nb;
+ svn_revnum_t head_rev_before_commit = rb->rev - rb->rev_offset - 1;
apr_hash_index_t *hi;
void *child_baton;
const char *nb_dirname;
@@ -537,7 +532,7 @@ new_node_record(void **node_baton,
rb->pb->commit_edit_baton = commit_edit_baton;
SVN_ERR(commit_editor->open_root(commit_edit_baton,
- rb->rev - rb->rev_offset - 1,
+ head_rev_before_commit,
rb->pool, &child_baton));
/* child_baton corresponds to the root directory baton here */
@@ -570,7 +565,7 @@ new_node_record(void **node_baton,
if (strcmp(hname, SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_MD5) == 0)
nb->base_checksum = apr_pstrdup(rb->pool, hval);
if (strcmp(hname, SVN_REPOS_DUMPFILE_NODE_COPYFROM_REV) == 0)
- nb->copyfrom_rev = atoi(hval);
+ nb->copyfrom_rev = SVN_STR_TO_REV(hval);
if (strcmp(hname, SVN_REPOS_DUMPFILE_NODE_COPYFROM_PATH) == 0)
nb->copyfrom_path = apr_pstrdup(rb->pool, hval);
}
@@ -617,7 +612,7 @@ new_node_record(void **node_baton,
rb->pool);
SVN_ERR(commit_editor->open_directory(relpath_compose,
rb->db->baton,
- rb->rev - rb->rev_offset - 1,
+ head_rev_before_commit,
rb->pool, &child_baton));
push_directory(rb, child_baton, relpath_compose, TRUE /*is_added*/,
NULL, SVN_INVALID_REVNUM);
@@ -659,7 +654,8 @@ new_node_record(void **node_baton,
{
case svn_node_action_delete:
case svn_node_action_replace:
- SVN_ERR(commit_editor->delete_entry(nb->path, rb->rev - rb->rev_offset,
+ SVN_ERR(commit_editor->delete_entry(nb->path,
+ head_rev_before_commit,
rb->db->baton, rb->pool));
if (nb->action == svn_node_action_delete)
break;
@@ -697,7 +693,7 @@ new_node_record(void **node_baton,
break;
default:
SVN_ERR(commit_editor->open_directory(nb->path, rb->db->baton,
- rb->rev - rb->rev_offset - 1,
+ head_rev_before_commit,
rb->pool, &child_baton));
push_directory(rb, child_baton, nb->path, FALSE /*is_added*/,
NULL, SVN_INVALID_REVNUM);
@@ -987,6 +983,7 @@ close_revision(void *baton)
}
else
{
+ svn_revnum_t head_rev_before_commit = rb->rev - rb->rev_offset - 1;
void *child_baton;
/* Legitimate revision with no node information */
@@ -996,7 +993,7 @@ close_revision(void *baton)
NULL, FALSE, rb->pool));
SVN_ERR(commit_editor->open_root(commit_edit_baton,
- rb->rev - rb->rev_offset - 1,
+ head_rev_before_commit,
rb->pool, &child_baton));
SVN_ERR(commit_editor->close_directory(child_baton, rb->pool));
Modified: subversion/branches/ra-git/subversion/svnrdump/svnrdump.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/svnrdump/svnrdump.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/svnrdump/svnrdump.c (original)
+++ subversion/branches/ra-git/subversion/svnrdump/svnrdump.c Mon Nov 30 10:24:16 2015
@@ -85,11 +85,7 @@ enum svn_svnrdump__longopt_t
opt_force_interactive,
opt_incremental,
opt_trust_server_cert,
- opt_trust_server_cert_unknown_ca,
- opt_trust_server_cert_cn_mismatch,
- opt_trust_server_cert_expired,
- opt_trust_server_cert_not_yet_valid,
- opt_trust_server_cert_other_failure,
+ opt_trust_server_cert_failures,
opt_version
};
@@ -99,11 +95,7 @@ enum svn_svnrdump__longopt_t
opt_auth_password, \
opt_auth_nocache, \
opt_trust_server_cert, \
- opt_trust_server_cert_unknown_ca, \
- opt_trust_server_cert_cn_mismatch, \
- opt_trust_server_cert_expired, \
- opt_trust_server_cert_not_yet_valid, \
- opt_trust_server_cert_other_failure, \
+ opt_trust_server_cert_failures, \
opt_non_interactive, \
opt_force_interactive
@@ -164,30 +156,24 @@ static const apr_getopt_option_t svnrdum
"For example:\n"
" "
" servers:global:http-library=serf")},
- {"trust-server-cert", opt_trust_server_cert, 0,
- N_("deprecated; same as --trust-unknown-ca")},
- {"trust-unknown-ca", opt_trust_server_cert_unknown_ca, 0,
- N_("with --non-interactive, accept SSL server\n"
- " "
- "certificates from unknown certificate authorities")},
- {"trust-cn-mismatch", opt_trust_server_cert_cn_mismatch, 0,
- N_("with --non-interactive, accept SSL server\n"
- " "
- "certificates even if the server hostname does not\n"
- " "
- "match the certificate's common name attribute")},
- {"trust-expired", opt_trust_server_cert_expired, 0,
- N_("with --non-interactive, accept expired SSL server\n"
- " "
- "certificates")},
- {"trust-not-yet-valid", opt_trust_server_cert_not_yet_valid, 0,
- N_("with --non-interactive, accept SSL server\n"
- " "
- "certificates from the future")},
- {"trust-other-failure", opt_trust_server_cert_other_failure, 0,
- N_("with --non-interactive, accept SSL server\n"
- " "
- "certificates with failures other than the above")},
+ {"trust-server-cert", opt_trust_server_cert, 0,
+ N_("deprecated; same as\n"
+ " "
+ "--trust-server-cert-failures=unknown-ca")},
+ {"trust-server-cert-failures", opt_trust_server_cert_failures, 1,
+ N_("with --non-interactive, accept SSL server\n"
+ " "
+ "certificates with failures; ARG is comma-separated\n"
+ " "
+ "list of 'unknown-ca' (Unknown Authority),\n"
+ " "
+ "'cn-mismatch' (Hostname mismatch), 'expired'\n"
+ " "
+ "(Expired certificate), 'not-yet-valid' (Not yet\n"
+ " "
+ "valid certificate) and 'other' (all other not\n"
+ " "
+ "separately classified certificate errors).")},
{0, 0, 0, 0}
};
@@ -560,7 +546,6 @@ replay_revisions(svn_ra_session_t *sessi
#endif
}
- SVN_ERR(svn_stream_close(stdout_stream));
return SVN_NO_ERROR;
}
@@ -578,18 +563,14 @@ load_revisions(svn_ra_session_t *session
apr_hash_t *skip_revprops,
apr_pool_t *pool)
{
- apr_file_t *stdin_file;
svn_stream_t *stdin_stream;
- apr_file_open_stdin(&stdin_file, pool);
- stdin_stream = svn_stream_from_aprfile2(stdin_file, FALSE, pool);
+ SVN_ERR(svn_stream_for_stdin2(&stdin_stream, TRUE, pool));
SVN_ERR(svn_rdump__load_dumpstream(stdin_stream, session, aux_session,
quiet, skip_revprops,
check_cancel, NULL, pool));
- SVN_ERR(svn_stream_close(stdin_stream));
-
return SVN_NO_ERROR;
}
@@ -927,20 +908,17 @@ sub_main(int *exit_code, int argc, const
svn_hash_sets(opt_baton->skip_revprops, opt_arg, opt_arg);
break;
case opt_trust_server_cert: /* backward compat */
- case opt_trust_server_cert_unknown_ca:
trust_unknown_ca = TRUE;
break;
- case opt_trust_server_cert_cn_mismatch:
- trust_cn_mismatch = TRUE;
- break;
- case opt_trust_server_cert_expired:
- trust_expired = TRUE;
- break;
- case opt_trust_server_cert_not_yet_valid:
- trust_not_yet_valid = TRUE;
- break;
- case opt_trust_server_cert_other_failure:
- trust_other_failure = TRUE;
+ case opt_trust_server_cert_failures:
+ SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool));
+ SVN_ERR(svn_cmdline__parse_trust_options(
+ &trust_unknown_ca,
+ &trust_cn_mismatch,
+ &trust_expired,
+ &trust_not_yet_valid,
+ &trust_other_failure,
+ opt_arg, pool));
break;
case opt_config_option:
if (!config_options)
@@ -950,7 +928,9 @@ sub_main(int *exit_code, int argc, const
SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool));
SVN_ERR(svn_cmdline__parse_config_option(config_options,
- opt_arg, pool));
+ opt_arg,
+ "svnrdump: ",
+ pool));
}
}
@@ -1059,25 +1039,10 @@ sub_main(int *exit_code, int argc, const
/* --trust-* can only be used with --non-interactive */
if (!non_interactive)
{
- if (trust_unknown_ca)
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-unknown-ca requires "
- "--non-interactive"));
- if (trust_cn_mismatch)
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-cn-mismatch requires "
- "--non-interactive"));
- if (trust_expired)
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-expired requires "
- "--non-interactive"));
- if (trust_not_yet_valid)
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-not-yet-valid requires "
- "--non-interactive"));
- if (trust_other_failure)
+ if (trust_unknown_ca || trust_cn_mismatch || trust_expired
+ || trust_not_yet_valid || trust_other_failure)
return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-other-failure requires "
+ _("--trust-server-cert-failures requires "
"--non-interactive"));
}
Modified: subversion/branches/ra-git/subversion/svnserve/cyrus_auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/svnserve/cyrus_auth.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/svnserve/cyrus_auth.c (original)
+++ subversion/branches/ra-git/subversion/svnserve/cyrus_auth.c Mon Nov 30 10:24:16 2015
@@ -199,7 +199,7 @@ static svn_error_t *try_auth(svn_ra_svn_
while (result == SASL_CONTINUE)
{
- svn_ra_svn_item_t *item;
+ svn_ra_svn__item_t *item;
arg = svn_string_ncreate(out, outlen, pool);
/* Encode what we send to the client. */
@@ -213,7 +213,7 @@ static svn_error_t *try_auth(svn_ra_svn_
if (item->kind != SVN_RA_SVN_STRING)
return SVN_NO_ERROR;
- in = item->u.string;
+ in = &item->u.string;
if (use_base64)
in = svn_base64_decode_string(in, pool);