You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2015/06/14 22:58:16 UTC
svn commit: r1685464 [27/43] - in /subversion/branches/fsx-1.10: ./ build/
build/ac-macros/ build/generator/ build/generator/templates/
contrib/client-side/svncopy/ doc/ notes/ subversion/bindings/javahl/
subversion/bindings/javahl/native/ subversion/b...
Modified: subversion/branches/fsx-1.10/subversion/svn/info-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/info-cmd.c?rev=1685464&r1=1685463&r2=1685464&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/svn/info-cmd.c (original)
+++ subversion/branches/fsx-1.10/subversion/svn/info-cmd.c Sun Jun 14 20:58:10 2015
@@ -76,6 +76,168 @@ schedule_str(svn_wc_schedule_t schedule)
}
}
+/* Return a relative URL from information in INFO using POOL for
+ temporary allocation. */
+static const char*
+relative_url(const svn_client_info2_t *info, apr_pool_t *pool)
+{
+ return apr_pstrcat(pool, "^/",
+ svn_path_uri_encode(
+ svn_uri_skip_ancestor(info->repos_root_URL,
+ info->URL, pool),
+ pool), SVN_VA_NULL);
+}
+
+
+/* The kinds of items for print_info_item(). */
+typedef enum
+{
+ /* Entry kind */
+ info_item_kind,
+
+ /* Repository location. */
+ info_item_url,
+ info_item_relative_url,
+ info_item_repos_root_url,
+ info_item_repos_uuid,
+
+ /* Working copy revision or repository HEAD revision */
+ info_item_revision,
+
+ /* Commit details. */
+ info_item_last_changed_rev,
+ info_item_last_changed_date,
+ info_item_last_changed_author,
+
+ /* Working copy information */
+ info_item_wc_root
+} info_item_t;
+
+/* Mapping between option keywords and info_item_t. */
+typedef struct info_item_map_t
+{
+ const svn_string_t keyword;
+ const info_item_t print_what;
+} info_item_map_t;
+
+#define MAKE_STRING(x) { x, sizeof(x) - 1 }
+static const info_item_map_t info_item_map[] =
+ {
+ { MAKE_STRING("kind"), info_item_kind },
+ { MAKE_STRING("url"), info_item_url },
+ { MAKE_STRING("relative-url"), info_item_relative_url },
+ { MAKE_STRING("repos-root-url"), info_item_repos_root_url },
+ { MAKE_STRING("repos-uuid"), info_item_repos_uuid },
+ { MAKE_STRING("revision"), info_item_revision },
+ { MAKE_STRING("last-changed-revision"),
+ info_item_last_changed_rev },
+ { MAKE_STRING("last-changed-date"), info_item_last_changed_date },
+ { MAKE_STRING("last-changed-author"), info_item_last_changed_author },
+ { MAKE_STRING("wc-root"), info_item_wc_root }
+ };
+#undef MAKE_STRING
+
+static const apr_size_t info_item_map_len =
+ (sizeof(info_item_map) / sizeof(info_item_map[0]));
+
+
+/* The baton type used by the info receiver functions. */
+typedef struct print_info_baton_t
+{
+ /* The path prefix that output paths should be normalized to. */
+ const char *path_prefix;
+
+ /*
+ * The following fields are used by print_info_item().
+ */
+
+ /* Which item to print. */
+ info_item_t print_what;
+
+ /* Do we expect to show info for multiple targets? */
+ svn_boolean_t multiple_targets;
+
+ /* TRUE iff the current is a local path. */
+ svn_boolean_t target_is_path;
+
+ /* Did we already print a line of output? */
+ svn_boolean_t start_new_line;
+} print_info_baton_t;
+
+
+/* Find the appropriate info_item_t for KEYWORD and initialize
+ * RECEIVER_BATON for print_info_item(). Use SCRATCH_POOL for
+ * temporary allocation.
+ */
+static svn_error_t *
+find_print_what(const char *keyword,
+ print_info_baton_t *receiver_baton,
+ apr_pool_t *scratch_pool)
+{
+ svn_cl__simcheck_t **keywords = apr_palloc(
+ scratch_pool, info_item_map_len * sizeof(svn_cl__simcheck_t*));
+ svn_cl__simcheck_t *kwbuf = apr_palloc(
+ scratch_pool, info_item_map_len * sizeof(svn_cl__simcheck_t));
+ apr_size_t i;
+
+ for (i = 0; i < info_item_map_len; ++i)
+ {
+ keywords[i] = &kwbuf[i];
+ kwbuf[i].token.data = info_item_map[i].keyword.data;
+ kwbuf[i].token.len = info_item_map[i].keyword.len;
+ kwbuf[i].data = &info_item_map[i];
+ }
+
+ switch (svn_cl__similarity_check(keyword, keywords,
+ info_item_map_len, scratch_pool))
+ {
+ const info_item_map_t *kw0;
+ const info_item_map_t *kw1;
+ const info_item_map_t *kw2;
+
+ case 0: /* Exact match. */
+ kw0 = keywords[0]->data;
+ receiver_baton->print_what = kw0->print_what;
+ return SVN_NO_ERROR;
+
+ case 1:
+ /* The best alternative isn't good enough */
+ return svn_error_createf(
+ SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("'%s' is not a valid value for --show-item"),
+ keyword);
+
+ case 2:
+ /* There is only one good candidate */
+ kw0 = keywords[0]->data;
+ return svn_error_createf(
+ SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("'%s' is not a valid value for --show-item;"
+ " did you mean '%s'?"),
+ keyword, kw0->keyword.data);
+
+ case 3:
+ /* Suggest a list of the most likely candidates */
+ kw0 = keywords[0]->data;
+ kw1 = keywords[1]->data;
+ return svn_error_createf(
+ SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("'%s' is not a valid value for --show-item;"
+ " did you mean '%s' or '%s'?"),
+ keyword, kw0->keyword.data, kw1->keyword.data);
+
+ default:
+ /* Never suggest more than three candidates */
+ kw0 = keywords[0]->data;
+ kw1 = keywords[1]->data;
+ kw2 = keywords[2]->data;
+ return svn_error_createf(
+ SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("'%s' is not a valid value for --show-item;"
+ " did you mean '%s', '%s' or '%s'?"),
+ keyword, kw0->keyword.data, kw1->keyword.data, kw2->keyword.data);
+ }
+}
/* A callback of type svn_client_info_receiver2_t.
Prints svn info in xml mode to standard out */
@@ -87,7 +249,7 @@ print_info_xml(void *baton,
{
svn_stringbuf_t *sb = svn_stringbuf_create_empty(pool);
const char *rev_str;
- const char *path_prefix = baton;
+ print_info_baton_t *const receiver_baton = baton;
if (SVN_IS_VALID_REVNUM(info->rev))
rev_str = apr_psprintf(pool, "%ld", info->rev);
@@ -97,7 +259,7 @@ print_info_xml(void *baton,
/* "<entry ...>" */
svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "entry",
"path", svn_cl__local_style_skip_ancestor(
- path_prefix, target, pool),
+ receiver_baton->path_prefix, target, pool),
"kind", svn_cl__node_kind_str_xml(info->kind),
"revision", rev_str,
SVN_VA_NULL);
@@ -109,13 +271,7 @@ print_info_xml(void *baton,
{
/* "<relative-url> xx </relative-url>" */
svn_cl__xml_tagged_cdata(&sb, pool, "relative-url",
- apr_pstrcat(pool, "^/",
- svn_path_uri_encode(
- svn_uri_skip_ancestor(
- info->repos_root_URL,
- info->URL, pool),
- pool),
- SVN_VA_NULL));
+ relative_url(info, pool));
}
if (info->repos_root_URL || info->repos_UUID)
@@ -263,11 +419,11 @@ print_info(void *baton,
const svn_client_info2_t *info,
apr_pool_t *pool)
{
- const char *path_prefix = baton;
+ print_info_baton_t *const receiver_baton = baton;
SVN_ERR(svn_cmdline_printf(pool, _("Path: %s\n"),
svn_cl__local_style_skip_ancestor(
- path_prefix, target, pool)));
+ receiver_baton->path_prefix, target, pool)));
/* ### remove this someday: it's only here for cmdline output
compatibility with svn 1.1 and older. */
@@ -285,11 +441,8 @@ print_info(void *baton,
SVN_ERR(svn_cmdline_printf(pool, _("URL: %s\n"), info->URL));
if (info->URL && info->repos_root_URL)
- SVN_ERR(svn_cmdline_printf(pool, _("Relative URL: ^/%s\n"),
- svn_path_uri_encode(
- svn_uri_skip_ancestor(info->repos_root_URL,
- info->URL, pool),
- pool)));
+ SVN_ERR(svn_cmdline_printf(pool, _("Relative URL: %s\n"),
+ relative_url(info, pool)));
if (info->repos_root_URL)
SVN_ERR(svn_cmdline_printf(pool, _("Repository Root: %s\n"),
@@ -389,30 +542,18 @@ print_info(void *baton,
SVN_ERR(svn_cmdline_printf(pool, _("Copied From Rev: %ld\n"),
info->wc_info->copyfrom_rev));
if (info->wc_info->moved_from_abspath)
- {
- const char *relpath;
-
- relpath = svn_dirent_skip_ancestor(info->wc_info->wcroot_abspath,
- info->wc_info->moved_from_abspath);
- if (relpath && relpath[0] != '\0')
- SVN_ERR(svn_cmdline_printf(pool, _("Moved From: %s\n"), relpath));
- else
- SVN_ERR(svn_cmdline_printf(pool, _("Moved From: %s\n"),
- info->wc_info->moved_from_abspath));
- }
+ SVN_ERR(svn_cmdline_printf(pool, _("Moved From: %s\n"),
+ svn_cl__local_style_skip_ancestor(
+ receiver_baton->path_prefix,
+ info->wc_info->moved_from_abspath,
+ pool)));
if (info->wc_info->moved_to_abspath)
- {
- const char *relpath;
-
- relpath = svn_dirent_skip_ancestor(info->wc_info->wcroot_abspath,
- info->wc_info->moved_to_abspath);
- if (relpath && relpath[0] != '\0')
- SVN_ERR(svn_cmdline_printf(pool, _("Moved To: %s\n"), relpath));
- else
- SVN_ERR(svn_cmdline_printf(pool, _("Moved To: %s\n"),
- info->wc_info->moved_to_abspath));
- }
+ SVN_ERR(svn_cmdline_printf(pool, _("Moved To: %s\n"),
+ svn_cl__local_style_skip_ancestor(
+ receiver_baton->path_prefix,
+ info->wc_info->moved_to_abspath,
+ pool)));
}
if (info->last_changed_author)
@@ -441,6 +582,7 @@ print_info(void *baton,
if (info->wc_info->conflicts)
{
svn_boolean_t printed_prop_conflict_file = FALSE;
+ svn_boolean_t printed_tc = FALSE;
int i;
for (i = 0; i < info->wc_info->conflicts->nelts; i++)
@@ -449,29 +591,39 @@ print_info(void *baton,
APR_ARRAY_IDX(info->wc_info->conflicts, i,
const svn_wc_conflict_description2_t *);
const char *desc;
+ const char *base_abspath;
+ const char *my_abspath;
+ const char *their_abspath;
+
+ base_abspath = svn_client_conflict_get_base_abspath(conflict);
+ my_abspath = svn_client_conflict_get_my_abspath(conflict);
+ their_abspath = svn_client_conflict_get_their_abspath(conflict);
- switch (conflict->kind)
+ switch (svn_client_conflict_get_kind(conflict))
{
case svn_wc_conflict_kind_text:
- if (conflict->base_abspath)
+ if (base_abspath)
SVN_ERR(svn_cmdline_printf(pool,
_("Conflict Previous Base File: %s\n"),
svn_cl__local_style_skip_ancestor(
- path_prefix, conflict->base_abspath,
+ receiver_baton->path_prefix,
+ base_abspath,
pool)));
- if (conflict->my_abspath)
+ if (my_abspath)
SVN_ERR(svn_cmdline_printf(pool,
_("Conflict Previous Working File: %s\n"),
svn_cl__local_style_skip_ancestor(
- path_prefix, conflict->my_abspath,
+ receiver_baton->path_prefix,
+ my_abspath,
pool)));
- if (conflict->their_abspath)
+ if (their_abspath)
SVN_ERR(svn_cmdline_printf(pool,
_("Conflict Current Base File: %s\n"),
svn_cl__local_style_skip_ancestor(
- path_prefix, conflict->their_abspath,
+ receiver_baton->path_prefix,
+ their_abspath,
pool)));
break;
@@ -479,12 +631,16 @@ print_info(void *baton,
if (! printed_prop_conflict_file)
SVN_ERR(svn_cmdline_printf(pool,
_("Conflict Properties File: %s\n"),
- svn_dirent_local_style(conflict->their_abspath,
- pool)));
+ svn_cl__local_style_skip_ancestor(
+ receiver_baton->path_prefix,
+ svn_client_conflict_get_prop_reject_abspath(
+ conflict),
+ pool)));
printed_prop_conflict_file = TRUE;
break;
case svn_wc_conflict_kind_tree:
+ printed_tc = TRUE;
SVN_ERR(
svn_cl__get_human_readable_tree_conflict_description(
&desc, conflict, pool));
@@ -506,13 +662,28 @@ print_info(void *baton,
APR_ARRAY_IDX(info->wc_info->conflicts, 0,
const svn_wc_conflict_description2_t *);
+ if (!printed_tc)
+ {
+ const char *desc;
+
+ SVN_ERR(svn_cl__get_human_readable_action_description(&desc,
+ svn_wc_conflict_action_edit,
+ svn_client_conflict_get_operation(conflict),
+ svn_client_conflict_get_node_kind(conflict), pool));
+
+ SVN_ERR(svn_cmdline_printf(pool, "%s: %s\n",
+ _("Conflict Details"), desc));
+ }
+
src_left_version =
- svn_cl__node_description(conflict->src_left_version,
- info->repos_root_URL, pool);
+ svn_cl__node_description(
+ svn_client_conflict_get_src_left_version(conflict),
+ info->repos_root_URL, pool);
src_right_version =
- svn_cl__node_description(conflict->src_right_version,
- info->repos_root_URL, pool);
+ svn_cl__node_description(
+ svn_client_conflict_get_src_right_version(conflict),
+ info->repos_root_URL, pool);
if (src_left_version)
SVN_ERR(svn_cmdline_printf(pool, " %s: %s\n",
@@ -572,6 +743,123 @@ print_info(void *baton,
}
+/* Helper for print_info_item(): Print the value TEXT for TARGET_PATH,
+ either of which may be NULL. Use POOL for temporary allocation. */
+static svn_error_t *
+print_info_item_string(const char *text, const char *target_path,
+ apr_pool_t *pool)
+{
+ if (text)
+ {
+ if (target_path)
+ SVN_ERR(svn_cmdline_printf(pool, "%-10s %s", text, target_path));
+ else
+ SVN_ERR(svn_cmdline_fputs(text, stdout, pool));
+ }
+ else if (target_path)
+ SVN_ERR(svn_cmdline_printf(pool, "%-10s %s", "", target_path));
+
+ return SVN_NO_ERROR;
+}
+
+/* Helper for print_info_item(): Print the revision number REV, which
+ may be SVN_INVALID_REVNUM, for TARGET_PATH, which may be NULL. Use
+ POOL for temporary allocation. */
+static svn_error_t *
+print_info_item_revision(svn_revnum_t rev, const char *target_path,
+ apr_pool_t *pool)
+{
+ if (SVN_IS_VALID_REVNUM(rev))
+ {
+ if (target_path)
+ SVN_ERR(svn_cmdline_printf(pool, "%-10ld %s", rev, target_path));
+ else
+ SVN_ERR(svn_cmdline_printf(pool, "%-10ld", rev));
+ }
+ else if (target_path)
+ SVN_ERR(svn_cmdline_printf(pool, "%-10s %s", "", target_path));
+
+ return SVN_NO_ERROR;
+}
+
+/* A callback of type svn_client_info_receiver2_t. */
+static svn_error_t *
+print_info_item(void *baton,
+ const char *target,
+ const svn_client_info2_t *info,
+ apr_pool_t *pool)
+{
+ print_info_baton_t *const receiver_baton = baton;
+ const char *const target_path =
+ (!receiver_baton->multiple_targets ? NULL
+ : (!receiver_baton->target_is_path ? info->URL
+ : svn_cl__local_style_skip_ancestor(
+ receiver_baton->path_prefix, target, pool)));
+
+ if (receiver_baton->start_new_line)
+ SVN_ERR(svn_cmdline_fputs("\n", stdout, pool));
+
+ switch (receiver_baton->print_what)
+ {
+ case info_item_kind:
+ SVN_ERR(print_info_item_string(svn_node_kind_to_word(info->kind),
+ target_path, pool));
+ break;
+
+ case info_item_url:
+ SVN_ERR(print_info_item_string(info->URL, target_path, pool));
+ break;
+
+ case info_item_relative_url:
+ SVN_ERR(print_info_item_string(relative_url(info, pool),
+ target_path, pool));
+ break;
+
+ case info_item_repos_root_url:
+ SVN_ERR(print_info_item_string(info->repos_root_URL, target_path, pool));
+ break;
+
+ case info_item_repos_uuid:
+ SVN_ERR(print_info_item_string(info->repos_UUID, target_path, pool));
+ break;
+
+ case info_item_revision:
+ SVN_ERR(print_info_item_revision(info->rev, target_path, pool));
+ break;
+
+ case info_item_last_changed_rev:
+ SVN_ERR(print_info_item_revision(info->last_changed_rev,
+ target_path, pool));
+ break;
+
+ case info_item_last_changed_date:
+ SVN_ERR(print_info_item_string(
+ (!info->last_changed_date ? NULL
+ : svn_time_to_cstring(info->last_changed_date, pool)),
+ target_path, pool));
+ break;
+
+ case info_item_last_changed_author:
+ SVN_ERR(print_info_item_string(info->last_changed_author,
+ target_path, pool));
+ break;
+
+ case info_item_wc_root:
+ SVN_ERR(print_info_item_string(
+ (info->wc_info && info->wc_info->wcroot_abspath
+ ? info->wc_info->wcroot_abspath : NULL),
+ target_path, pool));
+ break;
+
+ default:
+ SVN_ERR_MALFUNCTION();
+ }
+
+ receiver_baton->start_new_line = TRUE;
+ return SVN_NO_ERROR;
+}
+
+
/* This implements the `svn_opt_subcommand_t' interface. */
svn_error_t *
svn_cl__info(apr_getopt_t *os,
@@ -587,7 +875,7 @@ svn_cl__info(apr_getopt_t *os,
svn_boolean_t seen_nonexistent_target = FALSE;
svn_opt_revision_t peg_revision;
svn_client_info_receiver2_t receiver;
- const char *path_prefix;
+ print_info_baton_t receiver_baton = { 0 };
SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
opt_state->targets,
@@ -600,26 +888,59 @@ svn_cl__info(apr_getopt_t *os,
{
receiver = print_info_xml;
+ if (opt_state->show_item)
+ return svn_error_create(
+ SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("--show-item is not valid in --xml mode"));
+ if (opt_state->no_newline)
+ return svn_error_create(
+ SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("--no-newline is not valid in --xml mode"));
+
/* If output is not incremental, output the XML header and wrap
everything in a top-level element. This makes the output in
its entirety a well-formed XML document. */
if (! opt_state->incremental)
SVN_ERR(svn_cl__xml_print_header("info", pool));
}
+ else if (opt_state->show_item)
+ {
+ receiver = print_info_item;
+
+ if (opt_state->incremental)
+ return svn_error_create(
+ SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("--incremental is only valid in --xml mode"));
+
+ receiver_baton.multiple_targets = (opt_state->depth > svn_depth_empty
+ || targets->nelts > 1);
+ if (receiver_baton.multiple_targets && opt_state->no_newline)
+ return svn_error_create(
+ SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("--no-newline is only available for single-target,"
+ " non-recursive info operations"));
+
+ SVN_ERR(find_print_what(opt_state->show_item, &receiver_baton, pool));
+ receiver_baton.start_new_line = FALSE;
+ }
else
{
receiver = print_info;
if (opt_state->incremental)
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("'incremental' option only valid in XML "
- "mode"));
+ return svn_error_create(
+ SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("--incremental is only valid in --xml mode"));
+ if (opt_state->no_newline)
+ return svn_error_create(
+ SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("--no-newline' is only valid with --show-item"));
}
if (opt_state->depth == svn_depth_unknown)
opt_state->depth = svn_depth_empty;
- SVN_ERR(svn_dirent_get_absolute(&path_prefix, "", pool));
+ SVN_ERR(svn_dirent_get_absolute(&receiver_baton.path_prefix, "", pool));
for (i = 0; i < targets->nelts; i++)
{
@@ -637,10 +958,12 @@ svn_cl__info(apr_getopt_t *os,
{
if (peg_revision.kind == svn_opt_revision_unspecified)
peg_revision.kind = svn_opt_revision_head;
+ receiver_baton.target_is_path = FALSE;
}
else
{
SVN_ERR(svn_dirent_get_absolute(&truepath, truepath, subpool));
+ receiver_baton.target_is_path = TRUE;
}
err = svn_client_info4(truepath,
@@ -650,7 +973,7 @@ svn_cl__info(apr_getopt_t *os,
TRUE /* fetch_actual_only */,
opt_state->include_externals,
opt_state->changelists,
- receiver, (void *) path_prefix,
+ receiver, &receiver_baton,
ctx, subpool);
if (err)
@@ -677,6 +1000,9 @@ svn_cl__info(apr_getopt_t *os,
if (opt_state->xml && (! opt_state->incremental))
SVN_ERR(svn_cl__xml_print_footer("info", pool));
+ else if (opt_state->show_item && !opt_state->no_newline
+ && receiver_baton.start_new_line)
+ SVN_ERR(svn_cmdline_fputs("\n", stdout, pool));
if (seen_nonexistent_target)
return svn_error_create(
Modified: subversion/branches/fsx-1.10/subversion/svn/list-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/list-cmd.c?rev=1685464&r1=1685463&r2=1685464&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/svn/list-cmd.c (original)
+++ subversion/branches/fsx-1.10/subversion/svn/list-cmd.c Sun Jun 14 20:58:10 2015
@@ -49,6 +49,12 @@ struct print_baton {
svn_boolean_t in_external;
};
+/* Field flags required for this function */
+static const apr_uint32_t print_dirent_fields = SVN_DIRENT_KIND;
+static const apr_uint32_t print_dirent_fields_verbose = (
+ SVN_DIRENT_KIND | SVN_DIRENT_SIZE | SVN_DIRENT_TIME |
+ SVN_DIRENT_CREATED_REV | SVN_DIRENT_LAST_AUTHOR);
+
/* This implements the svn_client_list_func2_t API, printing a single
directory entry in text format. */
static svn_error_t *
@@ -161,7 +167,10 @@ print_dirent(void *baton,
}
}
-
+/* Field flags required for this function */
+static const apr_uint32_t print_dirent_xml_fields = (
+ SVN_DIRENT_KIND | SVN_DIRENT_SIZE | SVN_DIRENT_TIME |
+ SVN_DIRENT_CREATED_REV | SVN_DIRENT_LAST_AUTHOR);
/* This implements the svn_client_list_func2_t API, printing a single dirent
in XML format. */
static svn_error_t *
@@ -314,10 +323,12 @@ svn_cl__list(apr_getopt_t *os,
"mode"));
}
- if (opt_state->verbose || opt_state->xml)
- dirent_fields = SVN_DIRENT_ALL;
+ if (opt_state->xml)
+ dirent_fields = print_dirent_xml_fields;
+ else if (opt_state->verbose)
+ dirent_fields = print_dirent_fields_verbose;
else
- dirent_fields = SVN_DIRENT_KIND; /* the only thing we actually need... */
+ dirent_fields = print_dirent_fields;
pb.ctx = ctx;
pb.verbose = opt_state->verbose;
Modified: subversion/branches/fsx-1.10/subversion/svn/mergeinfo-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/mergeinfo-cmd.c?rev=1685464&r1=1685463&r2=1685464&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/svn/mergeinfo-cmd.c (original)
+++ subversion/branches/fsx-1.10/subversion/svn/mergeinfo-cmd.c Sun Jun 14 20:58:10 2015
@@ -240,7 +240,7 @@ mergeinfo_summary(
target_is_wc = (! svn_path_is_url(target_path_or_url))
&& (target_revision->kind == svn_opt_revision_unspecified
- || target_revision->kind == svn_opt_revision_working
+ || target_revision->kind == svn_opt_revision_working
|| target_revision->kind == svn_opt_revision_base);
SVN_ERR(svn_client_get_merging_summary(
&is_reintegration,
@@ -304,10 +304,10 @@ mergeinfo_log(svn_boolean_t finding_merg
baton->show_diff = FALSE;
baton->depth = depth;
baton->diff_extensions = NULL;
- baton->merge_stack = NULL;
+ baton->merge_stack = NULL;
baton->search_patterns = NULL;
baton->pool = pool;
- log_receiver_baton = baton;
+ log_receiver_baton = baton;
}
else
{
Modified: subversion/branches/fsx-1.10/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/notify.c?rev=1685464&r1=1685463&r2=1685464&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/svn/notify.c (original)
+++ subversion/branches/fsx-1.10/subversion/svn/notify.c Sun Jun 14 20:58:10 2015
@@ -129,7 +129,7 @@ svn_cl__conflict_stats_resolved(svn_cl__
static const char *
remaining_str(apr_pool_t *pool, int n_remaining)
{
- return apr_psprintf(pool, Q_("%d remaining",
+ return apr_psprintf(pool, Q_("%d remaining",
"%d remaining",
n_remaining),
n_remaining);
Modified: subversion/branches/fsx-1.10/subversion/svn/propget-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/propget-cmd.c?rev=1685464&r1=1685463&r2=1685464&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/svn/propget-cmd.c (original)
+++ subversion/branches/fsx-1.10/subversion/svn/propget-cmd.c Sun Jun 14 20:58:10 2015
@@ -322,11 +322,11 @@ svn_cl__propget(apr_getopt_t *os,
svn_stream_t *out;
svn_boolean_t warned = FALSE;
- if (opt_state->verbose && (opt_state->revprop || opt_state->strict
+ if (opt_state->verbose && (opt_state->revprop || opt_state->no_newline
|| opt_state->xml))
return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
_("--verbose cannot be used with --revprop or "
- "--strict or --xml"));
+ "--no-newline or --xml"));
/* PNAME is first argument (and PNAME_UTF8 will be a UTF-8 version
thereof) */
@@ -411,7 +411,7 @@ svn_cl__propget(apr_getopt_t *os,
SVN_ERR(stream_write(out, printable_val->data,
printable_val->len));
- if (! opt_state->strict)
+ if (! opt_state->no_newline)
SVN_ERR(stream_write(out, APR_EOL_STR, strlen(APR_EOL_STR)));
}
}
@@ -427,16 +427,16 @@ svn_cl__propget(apr_getopt_t *os,
if (opt_state->depth == svn_depth_unknown)
opt_state->depth = svn_depth_empty;
- /* Strict mode only makes sense for a single target. So make
+ /* No-newline mode only makes sense for a single target. So make
sure we have only a single target, and that we're not being
asked to recurse on that target. */
- if (opt_state->strict
+ if (opt_state->no_newline
&& ((targets->nelts > 1) || (opt_state->depth != svn_depth_empty)
|| (opt_state->show_inherited_props)))
return svn_error_create
(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("Strict output of property values only available for single-"
- "target, non-recursive propget operations"));
+ _("--no-newline is only available for single-target,"
+ " non-recursive propget operations"));
for (i = 0; i < targets->nelts; i++)
{
@@ -472,15 +472,15 @@ svn_cl__propget(apr_getopt_t *os,
/* Any time there is more than one thing to print, or where
the path associated with a printed thing is not obvious,
we'll print filenames. That is, unless we've been told
- not to do so with the --strict option. */
+ not to do so with the --no-newline option. */
print_filenames = ((opt_state->depth > svn_depth_empty
|| targets->nelts > 1
|| apr_hash_count(props) > 1
|| opt_state->verbose
|| opt_state->show_inherited_props)
- && (! opt_state->strict));
- omit_newline = opt_state->strict;
- like_proplist = opt_state->verbose && !opt_state->strict;
+ && (! opt_state->no_newline));
+ omit_newline = opt_state->no_newline;
+ like_proplist = opt_state->verbose && !opt_state->no_newline;
/* If there are no properties, and exactly one node was queried,
then warn. */
@@ -490,7 +490,7 @@ svn_cl__propget(apr_getopt_t *os,
{
svn_error_t *err;
err = svn_error_createf(SVN_ERR_PROPERTY_NOT_FOUND, NULL,
- _("Property '%s' not found on '%s'"),
+ _("Property '%s' not found on '%s'"),
pname_utf8, target);
svn_handle_warning2(stderr, err, "svn: ");
svn_error_clear(err);
Modified: subversion/branches/fsx-1.10/subversion/svn/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/props.c?rev=1685464&r1=1685463&r2=1685464&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/svn/props.c (original)
+++ subversion/branches/fsx-1.10/subversion/svn/props.c Sun Jun 14 20:58:10 2015
@@ -112,59 +112,6 @@ svn_cl__check_boolean_prop_val(const cha
}
}
-
-/* Context for sorting property names */
-struct simprop_context_t
-{
- svn_string_t name; /* The name of the property we're comparing with */
- svn_membuf_t buffer; /* Buffer for similarity testing */
-};
-
-struct simprop_t
-{
- const char *propname; /* The original svn: property name */
- svn_string_t name; /* The property name without the svn: prefix */
- unsigned int score; /* The similarity score */
- apr_size_t diff; /* Number of chars different from context.name */
- struct simprop_context_t *context; /* Sorting context for qsort() */
-};
-
-/* Similarity test between two property names */
-static APR_INLINE unsigned int
-simprop_key_diff(const svn_string_t *key, const svn_string_t *ctx,
- svn_membuf_t *buffer, apr_size_t *diff)
-{
- apr_size_t lcs;
- const unsigned int score = svn_string__similarity(key, ctx, buffer, &lcs);
- if (key->len > ctx->len)
- *diff = key->len - lcs;
- else
- *diff = ctx->len - lcs;
- return score;
-}
-
-/* Key comparator for qsort for simprop_t */
-static int
-simprop_compare(const void *pkeya, const void *pkeyb)
-{
- struct simprop_t *const keya = *(struct simprop_t *const *)pkeya;
- struct simprop_t *const keyb = *(struct simprop_t *const *)pkeyb;
- struct simprop_context_t *const context = keya->context;
-
- if (keya->score == -1)
- keya->score = simprop_key_diff(&keya->name, &context->name,
- &context->buffer, &keya->diff);
- if (keyb->score == -1)
- keyb->score = simprop_key_diff(&keyb->name, &context->name,
- &context->buffer, &keyb->diff);
-
- return (keya->score < keyb->score ? 1
- : (keya->score > keyb->score ? -1
- : (keya->diff > keyb->diff ? 1
- : (keya->diff < keyb->diff ? -1 : 0))));
-}
-
-
static const char*
force_prop_option_message(svn_cl__prop_use_t prop_use, const char *prop_name,
apr_pool_t *scratch_pool)
@@ -174,18 +121,18 @@ force_prop_option_message(svn_cl__prop_u
case svn_cl__prop_use_set:
return apr_psprintf(
scratch_pool,
- _("(To set the '%s' property, re-run with '--force'.)"),
+ _("Use '--force' to set the '%s' property."),
prop_name);
case svn_cl__prop_use_edit:
return apr_psprintf(
scratch_pool,
- _("(To edit the '%s' property, re-run with '--force'.)"),
+ _("Use '--force' to edit the '%s' property."),
prop_name);
case svn_cl__prop_use_use:
default:
return apr_psprintf(
scratch_pool,
- _("(To use the '%s' property, re-run with '--force'.)"),
+ _("Use '--force' to use the '%s' property'."),
prop_name);
}
}
@@ -199,21 +146,18 @@ wrong_prop_error_message(svn_cl__prop_us
case svn_cl__prop_use_set:
return apr_psprintf(
scratch_pool,
- _("'%s' is not a valid %s property name;"
- " re-run with '--force' to set it"),
+ _("'%s' is not a valid %s property name; use '--force' to set it"),
prop_name, SVN_PROP_PREFIX);
case svn_cl__prop_use_edit:
return apr_psprintf(
scratch_pool,
- _("'%s' is not a valid %s property name;"
- " re-run with '--force' to edit it"),
+ _("'%s' is not a valid %s property name; use '--force' to edit it"),
prop_name, SVN_PROP_PREFIX);
case svn_cl__prop_use_use:
default:
return apr_psprintf(
scratch_pool,
- _("'%s' is not a valid %s property name;"
- " re-run with '--force' to use it"),
+ _("'%s' is not a valid %s property name; use '--force' to use it"),
prop_name, SVN_PROP_PREFIX);
}
}
@@ -239,33 +183,34 @@ svn_cl__check_svn_prop_name(const char *
const char *const *const proplist = (revprop ? revprops : nodeprops);
const apr_size_t numprops = (revprop ? revprops_len : nodeprops_len);
- struct simprop_t **propkeys;
- struct simprop_t *propbuf;
+ svn_cl__simcheck_t **propkeys;
+ svn_cl__simcheck_t *propbuf;
apr_size_t i;
- struct simprop_context_t context;
+ svn_string_t propstring;
svn_string_t prefix;
+ svn_membuf_t buffer;
- context.name.data = propname;
- context.name.len = strlen(propname);
+ propstring.data = propname;
+ propstring.len = strlen(propname);
prefix.data = SVN_PROP_PREFIX;
prefix.len = strlen(SVN_PROP_PREFIX);
- svn_membuf__create(&context.buffer, 0, scratch_pool);
+ svn_membuf__create(&buffer, 0, scratch_pool);
/* First, check if the name is even close to being in the svn: namespace.
It must contain a colon in the right place, and we only allow
one-char typos or a single transposition. */
- if (context.name.len < prefix.len
- || context.name.data[prefix.len - 1] != prefix.data[prefix.len - 1])
+ if (propstring.len < prefix.len
+ || propstring.data[prefix.len - 1] != prefix.data[prefix.len - 1])
return SVN_NO_ERROR; /* Wrong prefix, ignore */
else
{
apr_size_t lcs;
- const apr_size_t name_len = context.name.len;
- context.name.len = prefix.len; /* Only check up to the prefix length */
- svn_string__similarity(&context.name, &prefix, &context.buffer, &lcs);
- context.name.len = name_len; /* Restore the original propname length */
+ const apr_size_t name_len = propstring.len;
+ propstring.len = prefix.len; /* Only check up to the prefix length */
+ svn_string__similarity(&propstring, &prefix, &buffer, &lcs);
+ propstring.len = name_len; /* Restore the original propname length */
if (lcs < prefix.len - 1)
return SVN_NO_ERROR; /* Wrong prefix, ignore */
@@ -276,11 +221,11 @@ svn_cl__check_svn_prop_name(const char *
for (i = 0; i < numprops; ++i)
{
if (0 == strcmp(proplist[i] + prefix.len, propname + prefix.len))
- return svn_error_createf(
+ return svn_error_quick_wrap(svn_error_createf(
SVN_ERR_CLIENT_PROPERTY_NAME, NULL,
_("'%s' is not a valid %s property name;"
- " did you mean '%s'?\n%s"),
- propname, SVN_PROP_PREFIX, proplist[i],
+ " did you mean '%s'?"),
+ propname, SVN_PROP_PREFIX, proplist[i]),
force_prop_option_message(prop_use, propname, scratch_pool));
}
return SVN_NO_ERROR;
@@ -292,65 +237,59 @@ svn_cl__check_svn_prop_name(const char *
we already know that it's the same and looking at it would only
skew the results. */
propkeys = apr_palloc(scratch_pool,
- numprops * sizeof(struct simprop_t*));
+ numprops * sizeof(svn_cl__simcheck_t*));
propbuf = apr_palloc(scratch_pool,
- numprops * sizeof(struct simprop_t));
- context.name.data += prefix.len;
- context.name.len -= prefix.len;
+ numprops * sizeof(svn_cl__simcheck_t));
+ propstring.data += prefix.len;
+ propstring.len -= prefix.len;
for (i = 0; i < numprops; ++i)
{
propkeys[i] = &propbuf[i];
- propbuf[i].propname = proplist[i];
- propbuf[i].name.data = proplist[i] + prefix.len;
- propbuf[i].name.len = strlen(propbuf[i].name.data);
- propbuf[i].score = (unsigned int)-1;
- propbuf[i].context = &context;
+ propbuf[i].token.data = proplist[i] + prefix.len;
+ propbuf[i].token.len = strlen(propbuf[i].token.data);
+ propbuf[i].data = proplist[i];
}
- qsort(propkeys, numprops, sizeof(*propkeys), simprop_compare);
-
- if (0 == propkeys[0]->diff)
- return SVN_NO_ERROR; /* We found an exact match. */
-
- /* See if we can suggest a sane alternative spelling */
- for (i = 0; i < numprops; ++i)
- if (propkeys[i]->score < 666) /* 2/3 similarity required */
- break;
-
- switch (i)
+ switch (svn_cl__similarity_check(
+ propstring.data, propkeys, numprops, scratch_pool))
{
case 0:
+ return SVN_NO_ERROR; /* We found an exact match. */
+
+ case 1:
/* The best alternative isn't good enough */
return svn_error_create(
SVN_ERR_CLIENT_PROPERTY_NAME, NULL,
wrong_prop_error_message(prop_use, propname, scratch_pool));
- case 1:
+ case 2:
/* There is only one good candidate */
- return svn_error_createf(
+ return svn_error_quick_wrap(svn_error_createf(
SVN_ERR_CLIENT_PROPERTY_NAME, NULL,
- _("'%s' is not a valid %s property name; did you mean '%s'?\n%s"),
- propname, SVN_PROP_PREFIX, propkeys[0]->propname,
+ _("'%s' is not a valid %s property name; did you mean '%s'?"),
+ propname, SVN_PROP_PREFIX,
+ (const char *)propkeys[0]->data),
force_prop_option_message(prop_use, propname, scratch_pool));
- case 2:
+ case 3:
/* Suggest a list of the most likely candidates */
- return svn_error_createf(
+ return svn_error_quick_wrap(svn_error_createf(
SVN_ERR_CLIENT_PROPERTY_NAME, NULL,
- _("'%s' is not a valid %s property name\n"
- "Did you mean '%s' or '%s'?\n%s"),
+ _("'%s' is not a valid %s property name; "
+ "did you mean '%s' or '%s'?"),
propname, SVN_PROP_PREFIX,
- propkeys[0]->propname, propkeys[1]->propname,
+ (const char *)propkeys[0]->data, (const char *)propkeys[1]->data),
force_prop_option_message(prop_use, propname, scratch_pool));
default:
/* Never suggest more than three candidates */
- return svn_error_createf(
+ return svn_error_quick_wrap(svn_error_createf(
SVN_ERR_CLIENT_PROPERTY_NAME, NULL,
- _("'%s' is not a valid %s property name\n"
- "Did you mean '%s', '%s' or '%s'?\n%s"),
+ _("'%s' is not a valid %s property name; "
+ "did you mean '%s', '%s' or '%s'?"),
propname, SVN_PROP_PREFIX,
- propkeys[0]->propname, propkeys[1]->propname, propkeys[2]->propname,
+ (const char *)propkeys[0]->data,
+ (const char *)propkeys[1]->data, (const char *)propkeys[2]->data),
force_prop_option_message(prop_use, propname, scratch_pool));
}
}
Modified: subversion/branches/fsx-1.10/subversion/svn/status-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/status-cmd.c?rev=1685464&r1=1685463&r2=1685464&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/svn/status-cmd.c (original)
+++ subversion/branches/fsx-1.10/subversion/svn/status-cmd.c Sun Jun 14 20:58:10 2015
@@ -288,8 +288,15 @@ svn_cl__status(apr_getopt_t *os,
SVN_ERR(svn_cl__check_targets_are_local_paths(targets));
- /* We want our -u statuses to be against HEAD. */
- rev.kind = svn_opt_revision_head;
+ /* We want our -u statuses to be against HEAD by default. */
+ if (opt_state->start_revision.kind == svn_opt_revision_unspecified)
+ rev.kind = svn_opt_revision_head;
+ else if (! opt_state->update)
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("--revision (-r) option valid only with "
+ "--show-updates (-u) option"));
+ else
+ rev = opt_state->start_revision;
sb.had_print_error = FALSE;
Modified: subversion/branches/fsx-1.10/subversion/svn/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/status.c?rev=1685464&r1=1685463&r2=1685464&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/svn/status.c (original)
+++ subversion/branches/fsx-1.10/subversion/svn/status.c Sun Jun 14 20:58:10 2015
@@ -138,37 +138,38 @@ generate_status_desc(enum svn_wc_status_
/* Make a relative path containing '..' elements as needed.
TARGET_ABSPATH shall be the absolute version of TARGET_PATH.
- TARGET_ABSPATH, TARGET_PATH and PATH shall be canonical.
+ TARGET_ABSPATH, TARGET_PATH and LOCAL_ABSPATH shall be canonical
If above conditions are met, a relative path that leads to PATH
from TARGET_PATH is returned, but there is no error checking involved.
The returned path is allocated from RESULT_POOL, all other
- allocations are made in SCRATCH_POOL. */
+ allocations are made in SCRATCH_POOL.
+
+ Note that it is not possible to just join the resulting path to
+ reconstruct the real path as the "../" paths are relative from
+ a different base than the normal relative paths!
+ */
static const char *
make_relpath(const char *target_abspath,
const char *target_path,
- const char *path,
+ const char *local_abspath,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
const char *la;
const char *parent_dir_els = "";
- const char *abspath, *relative;
- svn_error_t *err = svn_dirent_get_absolute(&abspath, path, scratch_pool);
+ const char *t_relpath;
+ const char *p_relpath;
- if (err)
- {
- /* We probably got passed some invalid path. */
- svn_error_clear(err);
- return apr_pstrdup(result_pool, path);
- }
+#ifdef SVN_DEBUG
+ SVN_ERR_ASSERT_NO_RETURN(svn_dirent_is_absolute(local_abspath));
+#endif
- relative = svn_dirent_skip_ancestor(target_abspath, abspath);
- if (relative)
- {
- return svn_dirent_join(target_path, relative, result_pool);
- }
+ t_relpath = svn_dirent_skip_ancestor(target_abspath, local_abspath);
+
+ if (t_relpath)
+ return svn_dirent_join(target_path, t_relpath, result_pool);
/* An example:
* relative_to_path = /a/b/c
@@ -180,17 +181,16 @@ make_relpath(const char *target_abspath,
* path = C:/wc
* result = C:/wc
*/
-
/* Skip the common ancestor of both paths, here '/a'. */
- la = svn_dirent_get_longest_ancestor(target_abspath, abspath,
+ la = svn_dirent_get_longest_ancestor(target_abspath, local_abspath,
scratch_pool);
if (*la == '\0')
{
/* Nothing in common: E.g. C:/ vs F:/ on Windows */
- return apr_pstrdup(result_pool, path);
+ return apr_pstrdup(result_pool, local_abspath);
}
- relative = svn_dirent_skip_ancestor(la, target_abspath);
- path = svn_dirent_skip_ancestor(la, path);
+ t_relpath = svn_dirent_skip_ancestor(la, target_abspath);
+ p_relpath = svn_dirent_skip_ancestor(la, local_abspath);
/* In above example, we'd now have:
* relative_to_path = b/c
@@ -198,14 +198,14 @@ make_relpath(const char *target_abspath,
/* Count the elements of relative_to_path and prepend as many '..' elements
* to path. */
- while (*relative)
+ while (*t_relpath)
{
- svn_dirent_split(&relative, NULL, relative,
- scratch_pool);
+ t_relpath = svn_dirent_dirname(t_relpath, scratch_pool);
parent_dir_els = svn_dirent_join(parent_dir_els, "..", scratch_pool);
}
- return svn_dirent_join(parent_dir_els, path, result_pool);
+ /* This returns a ../ style path relative from the status target */
+ return svn_dirent_join(parent_dir_els, p_relpath, result_pool);
}
@@ -232,8 +232,6 @@ print_status(const char *target_abspath,
const char *moved_from_line = "";
const char *moved_to_line = "";
- path = make_relpath(target_abspath, target_path, path, pool, pool);
-
/* For historic reasons svn ignores the property status for added nodes, even
if these nodes were copied and have local property changes.
@@ -487,8 +485,6 @@ svn_cl__print_status_xml(const char *tar
SVN_ERR(svn_wc_conflicted_p3(NULL, NULL, &tree_conflicted,
ctx->wc_ctx, local_abspath, pool));
- path = make_relpath(target_abspath, target_path, path, pool, pool);
-
svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "entry",
"path", svn_dirent_local_style(path, pool),
SVN_VA_NULL);
Modified: subversion/branches/fsx-1.10/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/svn.c?rev=1685464&r1=1685463&r2=1685464&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/svn/svn.c (original)
+++ subversion/branches/fsx-1.10/subversion/svn/svn.c Sun Jun 14 20:58:10 2015
@@ -110,7 +110,7 @@ typedef enum svn_cl__longopt_t {
opt_remove,
opt_revprop,
opt_stop_on_copy,
- opt_strict,
+ opt_strict, /* ### DEPRECATED */
opt_targets,
opt_depth,
opt_set_depth,
@@ -125,11 +125,7 @@ typedef enum svn_cl__longopt_t {
opt_show_revs,
opt_reintegrate,
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_strip,
opt_ignore_keywords,
opt_reverse_diff,
@@ -144,7 +140,9 @@ typedef enum svn_cl__longopt_t {
opt_remove_unversioned,
opt_remove_ignored,
opt_no_newline,
- opt_show_passwords
+ opt_show_passwords,
+ opt_pin_externals,
+ opt_show_item,
} svn_cl__longopt_t;
@@ -231,7 +229,7 @@ const apr_getopt_option_t svn_cl__option
" "
"'empty', 'files', 'immediates', or 'infinity')")},
{"xml", opt_xml, 0, N_("output in XML")},
- {"strict", opt_strict, 0, N_("use strict semantics")},
+ {"strict", opt_strict, 0, N_("DEPRECATED")},
{"stop-on-copy", opt_stop_on_copy, 0,
N_("do not cross copies while traversing history")},
{"no-ignore", opt_no_ignore, 0,
@@ -241,29 +239,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"
+ " "
+ "valid certificate) and 'other' (all other not\n"
" "
- "certificates with failures other than the above")},
+ "separately classified certificate errors).")},
{"non-interactive", opt_non_interactive, 0,
N_("do no interactive prompting (default is to prompt\n"
" "
@@ -406,7 +398,7 @@ const apr_getopt_option_t svn_cl__option
" "
"svn:externals properties")},
{"show-inherited-props", opt_show_inherited_props, 0,
- N_("retrieve target's inherited properties")},
+ N_("retrieve properties set on parents of the target")},
{"search", opt_search, 1,
N_("use ARG as search pattern (glob syntax)")},
{"search-and", opt_search_and, 1,
@@ -418,6 +410,12 @@ const apr_getopt_option_t svn_cl__option
{"remove-ignored", opt_remove_ignored, 0, N_("remove ignored items")},
{"no-newline", opt_no_newline, 0, N_("do not output the trailing newline")},
{"show-passwords", opt_show_passwords, 0, N_("show cached passwords")},
+ {"pin-externals", opt_pin_externals, 0,
+ N_("pin externals with no explicit revision to their\n"
+ " "
+ "current revision (recommended when tagging)")},
+ {"show-item", opt_show_item, 1,
+ N_("print only the item identified by ARG")},
/* Long-opt Aliases
*
@@ -451,9 +449,7 @@ const apr_getopt_option_t svn_cl__option
const int svn_cl__global_options[] =
{ opt_auth_username, opt_auth_password, opt_no_auth_cache, opt_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_config_dir, opt_config_options, 0
};
@@ -498,16 +494,31 @@ const svn_opt_subcommand_desc2_t svn_cl_
" expand them.\n"),
{ opt_remove, opt_show_passwords },
{ {opt_remove, N_("remove matching authentication credentials")} }
-
+
},
{ "blame", svn_cl__blame, {"praise", "annotate", "ann"}, N_
- ("Output the content of specified files or\n"
- "URLs with revision and author information in-line.\n"
- "usage: blame TARGET[@REV]...\n"
+ ("Show when each line of a file was last (or\n"
+ "next) changed.\n"
+ "usage: blame [-rM:N] TARGET[@REV]...\n"
+ "\n"
+ " Annotate each line of a file with the revision number and author of the\n"
+ " last change (or optionally the next change) to that line.\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"),
+ " looked up.\n"
+ "\n"
+ " Write the annotated result to standard output.\n"),
{'r', 'v', 'g', opt_incremental, opt_xml, 'x', opt_force} },
{ "cat", svn_cl__cat, {0}, N_
@@ -608,7 +619,8 @@ const svn_opt_subcommand_desc2_t svn_cl_
" contact the repository. As such, they may not, by default, be able\n"
" to propagate merge tracking information from the source of the copy\n"
" to the destination.\n"),
- {'r', 'q', opt_ignore_externals, opt_parents, SVN_CL__LOG_MSG_OPTIONS} },
+ {'r', 'q', opt_ignore_externals, opt_parents, SVN_CL__LOG_MSG_OPTIONS,
+ opt_pin_externals} },
{ "delete", svn_cl__delete, {"del", "remove", "rm"}, N_
("Remove files and directories from version control.\n"
@@ -715,9 +727,24 @@ const svn_opt_subcommand_desc2_t svn_cl_
"\n"
" Print information about each TARGET (default: '.').\n"
" TARGET may be either a working-copy path or URL. If specified, REV\n"
- " determines in which revision the target is first looked up.\n"),
+ " determines in which revision the target is first looked up.\n"
+ "\n"
+ " With --show-item, print only the value of one item of information\n"
+ " about TARGET. One of the following items can be selected:\n"
+ " kind the kind of TARGET\n"
+ " url the URL of TARGET in the repository\n"
+ " relative-url the repository-relative URL\n"
+ " repos-root-url the repository root URL\n"
+ " repos-uuid the repository UUID\n"
+ " revision the revision of TARGET (defaults to BASE\n"
+ " for working copy paths and HEAD for URLs)\n"
+ " last-changed-revision the most recent revision in which TARGET\n"
+ " was changed\n"
+ " last-changed-date the date of the last-changed revision\n"
+ " last-changed-author the author of the last-changed revision\n"
+ " wc-root the root of TARGET's working copy"),
{'r', 'R', opt_depth, opt_targets, opt_incremental, opt_xml,
- opt_changelist, opt_include_externals}
+ opt_changelist, opt_include_externals, opt_show_item, opt_no_newline}
},
{ "list", svn_cl__list, {"ls"}, N_
@@ -1334,14 +1361,14 @@ const svn_opt_subcommand_desc2_t svn_cl_
"\n"
" 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"
+ " --show-inherited-props, you can use the --no-newline option to disable this\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,
+ {'v', 'R', opt_depth, 'r', opt_revprop, opt_strict, opt_no_newline, opt_xml,
opt_changelist, opt_show_inherited_props },
{{'v', N_("print path, name and value on separate lines")},
- {opt_strict, N_("don't print an extra newline")}} },
+ {opt_strict, N_("(deprecated; use --no-newline)")}} },
{ "proplist", svn_cl__proplist, {"plist", "pl"}, N_
("List all properties on files, dirs, or revisions.\n"
@@ -1418,6 +1445,13 @@ const svn_opt_subcommand_desc2_t svn_cl_
" directory:\n"
" svn:ignore - A list of file glob patterns to ignore, one per line.\n"
" svn:global-ignores - Like svn:ignore, but inheritable.\n"
+ " svn:auto-props - Automatically set properties on files when they are\n"
+ " added or imported. Contains key-value pairs, one per line, in the format:\n"
+ " PATTERN = PROPNAME=VALUE[;PROPNAME=VALUE ...]\n"
+ " Example (where a literal ';' is escaped by adding another ';'):\n"
+ " *.html = svn:eol-style=native;svn:mime-type=text/html;; charset=UTF8\n"
+ " Applies recursively to all files added or imported under the directory\n"
+ " it is set on. See also [auto-props] in the client configuration file.\n"
" svn:externals - A list of module specifiers, one per line, in the\n"
" following format similar to the syntax of 'svn checkout':\n"
" [-r REV] URL[@PEG] LOCALPATH\n"
@@ -1599,8 +1633,8 @@ const svn_opt_subcommand_desc2_t svn_cl_
" ! C wc/qaz.c\n"
" > local missing, incoming edit upon update\n"
" D wc/qax.c\n"),
- { 'u', 'v', 'N', opt_depth, 'q', opt_no_ignore, opt_incremental, opt_xml,
- opt_ignore_externals, opt_changelist},
+ { 'u', 'v', 'N', opt_depth, 'r', 'q', opt_no_ignore, opt_incremental,
+ opt_xml, opt_ignore_externals, opt_changelist},
{{'q', N_("don't print unversioned items")}} },
{ "switch", svn_cl__switch, {"sw"}, N_
@@ -1717,14 +1751,6 @@ const svn_opt_subcommand_desc2_t svn_cl_
" Local modifications are preserved.\n"),
{ 'q' } },
- { "youngest", svn_cl__youngest, {0}, N_
- ("Print the youngest revision number of a target's repository.\n"
- "usage: youngest [TARGET]\n"
- "\n"
- " Print the revision number of the youngest revision in the repository\n"
- " with which TARGET is associated.\n"),
- { opt_no_newline } },
-
{ NULL, NULL, {0}, NULL, {0} }
};
@@ -2141,9 +2167,6 @@ sub_main(int *exit_code, int argc, const
case opt_stop_on_copy:
opt_state.stop_on_copy = TRUE;
break;
- case opt_strict:
- opt_state.strict = TRUE;
- break;
case opt_no_ignore:
opt_state.no_ignore = TRUE;
break;
@@ -2157,20 +2180,17 @@ sub_main(int *exit_code, int argc, const
force_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;
+ 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_no_diff_added:
opt_state.diff.no_diff_added = TRUE;
@@ -2237,7 +2257,7 @@ sub_main(int *exit_code, int argc, const
SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
SVN_ERR(svn_cmdline__parse_config_option(opt_state.config_options,
- utf8_opt_arg, pool));
+ utf8_opt_arg, "svn: ", pool));
break;
case opt_autoprops:
opt_state.autoprops = TRUE;
@@ -2385,11 +2405,19 @@ sub_main(int *exit_code, int argc, const
opt_state.remove_ignored = TRUE;
break;
case opt_no_newline:
+ case opt_strict: /* ### DEPRECATED */
opt_state.no_newline = TRUE;
break;
case opt_show_passwords:
opt_state.show_passwords = TRUE;
break;
+ case opt_pin_externals:
+ opt_state.pin_externals = TRUE;
+ break;
+ case opt_show_item:
+ SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+ opt_state.show_item = utf8_opt_arg;
+ break;
default:
/* Hmmm. Perhaps this would be a good place to squirrel away
opts that commands like svn diff might need. Hmmm indeed. */
@@ -2599,25 +2627,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"));
}
@@ -3022,10 +3038,9 @@ sub_main(int *exit_code, int argc, const
if (err->apr_err == SVN_ERR_CL_INSUFFICIENT_ARGS
|| err->apr_err == SVN_ERR_CL_ARG_PARSING_ERROR)
{
- err = svn_error_quick_wrap(
- err, apr_psprintf(pool,
- _("Try 'svn help %s' for more information"),
- subcommand->name));
+ err = svn_error_quick_wrapf(
+ err, _("Try 'svn help %s' for more information"),
+ subcommand->name);
}
if (err->apr_err == SVN_ERR_WC_UPGRADE_REQUIRED)
{
Modified: subversion/branches/fsx-1.10/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svn/util.c?rev=1685464&r1=1685463&r2=1685464&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/svn/util.c (original)
+++ subversion/branches/fsx-1.10/subversion/svn/util.c Sun Jun 14 20:58:10 2015
@@ -75,6 +75,13 @@ svn_cl__print_commit_info(const svn_comm
void *baton,
apr_pool_t *pool)
{
+ /* Be very careful with returning errors from this callback as those
+ will be returned as errors from editor->close_edit(...), which may
+ cause callers to assume that the commit itself failed.
+
+ See log message of r1659867 and the svn_ra_get_commit_editor3
+ documentation for details on error scenarios. */
+
if (SVN_IS_VALID_REVNUM(commit_info->revision))
SVN_ERR(svn_cmdline_printf(pool, _("Committed revision %ld%s.\n"),
commit_info->revision,
@@ -197,7 +204,7 @@ svn_cl__make_log_msg_baton(void **baton,
apr_hash_t *config,
apr_pool_t *pool)
{
- struct log_msg_baton *lmb = apr_palloc(pool, sizeof(*lmb));
+ struct log_msg_baton *lmb = apr_pcalloc(pool, sizeof(*lmb));
if (opt_state->filedata)
{
@@ -230,8 +237,10 @@ svn_cl__make_log_msg_baton(void **baton,
SVN_CONFIG_OPTION_LOG_ENCODING,
NULL);
}
+ else
+ lmb->message_encoding = NULL;
- lmb->base_dir = base_dir ? base_dir : "";
+ lmb->base_dir = base_dir;
lmb->tmpfile_left = NULL;
lmb->config = config;
lmb->keep_locks = opt_state->no_unlock;
@@ -383,14 +392,11 @@ svn_cl__get_log_message(const char **log
if (! path)
path = item->url;
- else if (! *path)
- path = ".";
-
- if (! svn_path_is_url(path) && lmb->base_dir)
+ else if (lmb->base_dir)
path = svn_dirent_is_child(lmb->base_dir, path, pool);
/* If still no path, then just use current directory. */
- if (! path)
+ if (! path || !*path)
path = ".";
if ((item->state_flags & SVN_CLIENT_COMMIT_ITEM_DELETE)
@@ -429,7 +435,8 @@ svn_cl__get_log_message(const char **log
if (! lmb->non_interactive)
{
err = svn_cmdline__edit_string_externally(&msg_string, &lmb->tmpfile_left,
- lmb->editor_cmd, lmb->base_dir,
+ lmb->editor_cmd,
+ lmb->base_dir ? lmb->base_dir : "",
msg_string, "svn-commit",
lmb->config, TRUE,
lmb->message_encoding,
Modified: subversion/branches/fsx-1.10/subversion/svnadmin/svnadmin.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svnadmin/svnadmin.c?rev=1685464&r1=1685463&r2=1685464&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/svnadmin/svnadmin.c (original)
+++ subversion/branches/fsx-1.10/subversion/svnadmin/svnadmin.c Sun Jun 14 20:58:10 2015
@@ -868,6 +868,14 @@ struct repos_notify_handler_baton {
/* Stream to write progress and other non-error output to. */
svn_stream_t *feedback_stream;
+ /* Suppress notifications that are neither errors nor warnings. */
+ svn_boolean_t silent_running;
+
+ /* Whether errors contained in notifications should be printed along
+ with the notification. If FALSE, any errors will only be
+ summarized. */
+ svn_boolean_t silent_errors;
+
/* List of errors encountered during 'svnadmin verify --keep-going'. */
apr_array_header_t *error_summary;
@@ -886,6 +894,14 @@ repos_notify_handler(void *baton,
struct repos_notify_handler_baton *b = baton;
svn_stream_t *feedback_stream = b->feedback_stream;
+ /* Don't print anything if the feedback stream isn't provided.
+ Only print errors and warnings in silent mode. */
+ if (!feedback_stream
+ || (b->silent_running
+ && notify->action != svn_repos_notify_warning
+ && notify->action != svn_repos_notify_failure))
+ return;
+
switch (notify->action)
{
case svn_repos_notify_warning:
@@ -901,12 +917,14 @@ repos_notify_handler(void *baton,
notify->revision));
if (notify->err)
{
- svn_handle_error2(notify->err, stderr, FALSE /* non-fatal */,
- "svnadmin: ");
+ if (!b->silent_errors)
+ svn_handle_error2(notify->err, stderr, FALSE /* non-fatal */,
+ "svnadmin: ");
+
if (b->error_summary && notify->revision != SVN_INVALID_REVNUM)
{
struct verification_error *verr;
-
+
verr = apr_palloc(b->result_pool, sizeof(*verr));
verr->rev = notify->revision;
verr->err = svn_error_dup(notify->err);
@@ -1787,6 +1805,8 @@ subcommand_verify(apr_getopt_t *os, void
svn_fs_t *fs;
svn_revnum_t youngest, lower, upper;
struct repos_notify_handler_baton notify_baton = { 0 };
+ struct repos_notify_handler_baton *notify_baton_p = ¬ify_baton;
+ svn_repos_notify_func_t notify_func = repos_notify_handler;
svn_error_t *verify_err;
/* Expect no more arguments. */
@@ -1831,26 +1851,42 @@ subcommand_verify(apr_getopt_t *os, void
upper = lower;
}
- if (! opt_state->quiet)
- notify_baton.feedback_stream = recode_stream_create(stdout, pool);
+ /* Set up the notification handler. */
+ if (!opt_state->quiet || opt_state->keep_going)
+ {
+ if (opt_state->quiet)
+ {
+ notify_baton.silent_running = TRUE;
+ notify_baton.feedback_stream = recode_stream_create(stderr, pool);
+ }
+ else
+ notify_baton.feedback_stream = recode_stream_create(stdout, pool);
- if (opt_state->keep_going)
- notify_baton.error_summary =
- apr_array_make(pool, 0, sizeof(struct verification_error *));
+ if (opt_state->keep_going)
+ notify_baton.error_summary =
+ apr_array_make(pool, 0, sizeof(struct verification_error *));
+ else
+ notify_baton.silent_errors = TRUE;
- notify_baton.result_pool = pool;
+ notify_baton.result_pool = pool;
+ }
+ else
+ {
+ notify_func = NULL;
+ notify_baton_p = NULL;
+ }
verify_err = svn_repos_verify_fs3(repos, lower, upper,
opt_state->keep_going,
opt_state->check_normalization,
opt_state->metadata_only,
- !opt_state->quiet
- ? repos_notify_handler : NULL,
- ¬ify_baton, check_cancel,
- NULL, pool);
+ notify_func, notify_baton_p,
+ check_cancel, NULL, pool);
/* Show the --keep-going error summary. */
- if (opt_state->keep_going && notify_baton.error_summary->nelts > 0)
+ if (!opt_state->quiet
+ && opt_state->keep_going
+ && notify_baton.error_summary->nelts > 0)
{
int rev_maxlength;
svn_revnum_t end_revnum;
@@ -1880,7 +1916,7 @@ subcommand_verify(apr_getopt_t *os, void
struct verification_error *verr;
svn_error_t *err;
const char *rev_str;
-
+
svn_pool_clear(iterpool);
verr = APR_ARRAY_IDX(notify_baton.error_summary, i,
@@ -1892,7 +1928,7 @@ subcommand_verify(apr_getopt_t *os, void
{
char buf[512];
const char *message;
-
+
message = svn_err_best_message(err, buf, sizeof(buf));
svn_error_clear(svn_stream_printf(notify_baton.feedback_stream,
iterpool,
@@ -2510,6 +2546,7 @@ sub_main(int *exit_code, int argc, const
SVN_ERR(svn_stringbuf_from_file2(&(opt_state.filedata),
utf8_opt_arg, pool));
dash_F_arg = TRUE;
+ break;
case svnadmin__version:
opt_state.version = TRUE;
break;
Modified: subversion/branches/fsx-1.10/subversion/svnbench/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svnbench/cl.h?rev=1685464&r1=1685463&r2=1685464&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/svnbench/cl.h (original)
+++ subversion/branches/fsx-1.10/subversion/svnbench/cl.h Sun Jun 14 20:58:10 2015
@@ -80,7 +80,6 @@ typedef struct svn_cl__opt_state_t
svn_boolean_t help; /* print usage message */
const char *auth_username; /* auth username */ /* UTF-8! */
const char *auth_password; /* auth password */ /* UTF-8! */
- const char *extensions; /* subprocess extension args */ /* UTF-8! */
apr_array_header_t *targets; /* target list from file */ /* UTF-8! */
svn_boolean_t no_auth_cache; /* do not cache authentication information */
svn_boolean_t stop_on_copy; /* don't cross copies during processing */
@@ -109,6 +108,7 @@ typedef struct svn_cl__cmd_baton_t
/* Declare all the command procedures */
svn_opt_subcommand_t
svn_cl__help,
+ svn_cl__null_blame,
svn_cl__null_export,
svn_cl__null_list,
svn_cl__null_log,
Modified: subversion/branches/fsx-1.10/subversion/svnbench/svnbench.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svnbench/svnbench.c?rev=1685464&r1=1685463&r2=1685464&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/svnbench/svnbench.c (original)
+++ subversion/branches/fsx-1.10/subversion/svnbench/svnbench.c Sun Jun 14 20:58:10 2015
@@ -67,11 +67,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 +123,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 +195,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 +207,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 +289,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")}} },
@@ -527,10 +534,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 +612,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 +639,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 +755,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 +798,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)
+ 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-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)
- return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
- _("--trust-other-failure requires "
+ _("--trust-server-cert-failures requires "
"--non-interactive"));
}
@@ -842,7 +830,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)
{
@@ -958,10 +947,9 @@ sub_main(int *exit_code, int argc, const
if (err->apr_err == SVN_ERR_CL_INSUFFICIENT_ARGS
|| err->apr_err == SVN_ERR_CL_ARG_PARSING_ERROR)
{
- err = svn_error_quick_wrap(
- err, apr_psprintf(pool,
- _("Try 'svnbench help %s' for more information"),
- subcommand->name));
+ err = svn_error_quick_wrapf(
+ err, _("Try 'svnbench help %s' for more information"),
+ subcommand->name);
}
if (err->apr_err == SVN_ERR_WC_UPGRADE_REQUIRED)
{