You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pr...@apache.org on 2013/06/05 11:22:51 UTC
svn commit: r1489765 [17/22] - in /subversion/branches/verify-keep-going: ./
build/ build/ac-macros/ build/generator/ build/generator/templates/
contrib/hook-scripts/ contrib/server-side/fsfsfixer/
contrib/server-side/fsfsfixer/fixer/ notes/ subversion...
Modified: subversion/branches/verify-keep-going/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svn/notify.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svn/notify.c (original)
+++ subversion/branches/verify-keep-going/subversion/svn/notify.c Wed Jun 5 09:22:43 2013
@@ -56,54 +56,109 @@ struct notify_baton
svn_boolean_t had_print_error; /* Used to not keep printing error messages
when we've already had one print error. */
- /* Conflict stats for update and merge. */
+ svn_cl__conflict_stats_t *conflict_stats;
+
+ /* The cwd, for use in decomposing absolute paths. */
+ const char *path_prefix;
+};
+
+/* Conflict stats for operations such as update and merge. */
+struct svn_cl__conflict_stats_t
+{
apr_pool_t *stats_pool;
apr_hash_t *text_conflicts, *prop_conflicts, *tree_conflicts;
int text_conflicts_resolved, prop_conflicts_resolved, tree_conflicts_resolved;
int skipped_paths;
-
- /* The cwd, for use in decomposing absolute paths. */
- const char *path_prefix;
};
+svn_cl__conflict_stats_t *
+svn_cl__conflict_stats_create(apr_pool_t *pool)
+{
+ svn_cl__conflict_stats_t *conflict_stats
+ = apr_palloc(pool, sizeof(*conflict_stats));
+
+ conflict_stats->stats_pool = pool;
+ conflict_stats->text_conflicts = apr_hash_make(pool);
+ conflict_stats->prop_conflicts = apr_hash_make(pool);
+ conflict_stats->tree_conflicts = apr_hash_make(pool);
+ conflict_stats->text_conflicts_resolved = 0;
+ conflict_stats->prop_conflicts_resolved = 0;
+ conflict_stats->tree_conflicts_resolved = 0;
+ conflict_stats->skipped_paths = 0;
+ return conflict_stats;
+}
/* Add the PATH (as a key, with a meaningless value) into the HASH in NB. */
static void
store_path(struct notify_baton *nb, apr_hash_t *hash, const char *path)
{
- svn_hash_sets(hash, apr_pstrdup(nb->stats_pool, path), "");
+ svn_hash_sets(hash, apr_pstrdup(nb->conflict_stats->stats_pool, path), "");
}
-svn_error_t *
-svn_cl__notifier_reset_conflict_stats(void *baton)
+void
+svn_cl__conflict_stats_resolved(svn_cl__conflict_stats_t *conflict_stats,
+ const char *path_local,
+ svn_wc_conflict_kind_t conflict_kind)
{
- struct notify_baton *nb = baton;
+ switch (conflict_kind)
+ {
+ case svn_wc_conflict_kind_text:
+ if (svn_hash_gets(conflict_stats->text_conflicts, path_local))
+ {
+ svn_hash_sets(conflict_stats->text_conflicts, path_local, NULL);
+ conflict_stats->text_conflicts_resolved++;
+ }
+ break;
+ case svn_wc_conflict_kind_property:
+ if (svn_hash_gets(conflict_stats->prop_conflicts, path_local))
+ {
+ svn_hash_sets(conflict_stats->prop_conflicts, path_local, NULL);
+ conflict_stats->prop_conflicts_resolved++;
+ }
+ break;
+ case svn_wc_conflict_kind_tree:
+ if (svn_hash_gets(conflict_stats->tree_conflicts, path_local))
+ {
+ svn_hash_sets(conflict_stats->tree_conflicts, path_local, NULL);
+ conflict_stats->tree_conflicts_resolved++;
+ }
+ break;
+ }
+}
- apr_hash_clear(nb->text_conflicts);
- apr_hash_clear(nb->prop_conflicts);
- apr_hash_clear(nb->tree_conflicts);
- nb->text_conflicts_resolved = 0;
- nb->prop_conflicts_resolved = 0;
- nb->tree_conflicts_resolved = 0;
- nb->skipped_paths = 0;
- return SVN_NO_ERROR;
+static const char *
+remaining_str(apr_pool_t *pool, int n_remaining)
+{
+ return apr_psprintf(pool, Q_("%d remaining",
+ "%d remaining",
+ n_remaining),
+ n_remaining);
+}
+
+static const char *
+resolved_str(apr_pool_t *pool, int n_resolved)
+{
+ return apr_psprintf(pool, Q_("and %d already resolved",
+ "and %d already resolved",
+ n_resolved),
+ n_resolved);
}
svn_error_t *
-svn_cl__notifier_print_conflict_stats(void *baton, apr_pool_t *scratch_pool)
+svn_cl__print_conflict_stats(svn_cl__conflict_stats_t *conflict_stats,
+ apr_pool_t *scratch_pool)
{
- struct notify_baton *nb = baton;
- int n_text = apr_hash_count(nb->text_conflicts);
- int n_prop = apr_hash_count(nb->prop_conflicts);
- int n_tree = apr_hash_count(nb->tree_conflicts);
- int n_text_r = nb->text_conflicts_resolved;
- int n_prop_r = nb->prop_conflicts_resolved;
- int n_tree_r = nb->tree_conflicts_resolved;
+ int n_text = apr_hash_count(conflict_stats->text_conflicts);
+ int n_prop = apr_hash_count(conflict_stats->prop_conflicts);
+ int n_tree = apr_hash_count(conflict_stats->tree_conflicts);
+ int n_text_r = conflict_stats->text_conflicts_resolved;
+ int n_prop_r = conflict_stats->prop_conflicts_resolved;
+ int n_tree_r = conflict_stats->tree_conflicts_resolved;
if (n_text > 0 || n_text_r > 0
|| n_prop > 0 || n_prop_r > 0
|| n_tree > 0 || n_tree_r > 0
- || nb->skipped_paths > 0)
+ || conflict_stats->skipped_paths > 0)
SVN_ERR(svn_cmdline_printf(scratch_pool,
_("Summary of conflicts:\n")));
@@ -126,25 +181,37 @@ svn_cl__notifier_print_conflict_stats(vo
{
if (n_text > 0 || n_text_r > 0)
SVN_ERR(svn_cmdline_printf(scratch_pool,
- _(" Text conflicts: %d remaining (and %d already resolved)\n"),
- n_text, n_text_r));
+ _(" Text conflicts: %s (%s)\n"),
+ remaining_str(scratch_pool, n_text),
+ resolved_str(scratch_pool, n_text_r)));
if (n_prop > 0 || n_prop_r > 0)
SVN_ERR(svn_cmdline_printf(scratch_pool,
- _(" Property conflicts: %d remaining (and %d already resolved)\n"),
- n_prop, n_prop_r));
+ _(" Property conflicts: %s (%s)\n"),
+ remaining_str(scratch_pool, n_prop),
+ resolved_str(scratch_pool, n_prop_r)));
if (n_tree > 0 || n_tree_r > 0)
SVN_ERR(svn_cmdline_printf(scratch_pool,
- _(" Tree conflicts: %d remaining (and %d already resolved)\n"),
- n_tree, n_tree_r));
+ _(" Tree conflicts: %s (%s)\n"),
+ remaining_str(scratch_pool, n_tree),
+ resolved_str(scratch_pool, n_tree_r)));
}
- if (nb->skipped_paths > 0)
+ if (conflict_stats->skipped_paths > 0)
SVN_ERR(svn_cmdline_printf(scratch_pool,
_(" Skipped paths: %d\n"),
- nb->skipped_paths));
+ conflict_stats->skipped_paths));
return SVN_NO_ERROR;
}
+svn_error_t *
+svn_cl__notifier_print_conflict_stats(void *baton, apr_pool_t *scratch_pool)
+{
+ struct notify_baton *nb = baton;
+
+ SVN_ERR(svn_cl__print_conflict_stats(nb->conflict_stats, scratch_pool));
+ return SVN_NO_ERROR;
+}
+
/* This implements `svn_wc_notify_func2_t'.
* NOTE: This function can't fail, so we just ignore any print errors. */
static void
@@ -170,7 +237,7 @@ notify(void *baton, const svn_wc_notify_
switch (n->action)
{
case svn_wc_notify_skip:
- nb->skipped_paths++;
+ nb->conflict_stats->skipped_paths++;
if (n->content_state == svn_wc_notify_state_missing)
{
if ((err = svn_cmdline_printf
@@ -193,28 +260,28 @@ notify(void *baton, const svn_wc_notify_
}
break;
case svn_wc_notify_update_skip_obstruction:
- nb->skipped_paths++;
+ nb->conflict_stats->skipped_paths++;
if ((err = svn_cmdline_printf(
pool, _("Skipped '%s' -- An obstructing working copy was found\n"),
path_local)))
goto print_error;
break;
case svn_wc_notify_update_skip_working_only:
- nb->skipped_paths++;
+ nb->conflict_stats->skipped_paths++;
if ((err = svn_cmdline_printf(
pool, _("Skipped '%s' -- Has no versioned parent\n"),
path_local)))
goto print_error;
break;
case svn_wc_notify_update_skip_access_denied:
- nb->skipped_paths++;
+ nb->conflict_stats->skipped_paths++;
if ((err = svn_cmdline_printf(
pool, _("Skipped '%s' -- Access denied\n"),
path_local)))
goto print_error;
break;
case svn_wc_notify_skip_conflicted:
- nb->skipped_paths++;
+ nb->conflict_stats->skipped_paths++;
if ((err = svn_cmdline_printf(
pool, _("Skipped '%s' -- Node remains in conflict\n"),
path_local)))
@@ -263,7 +330,7 @@ notify(void *baton, const svn_wc_notify_
nb->received_some_change = TRUE;
if (n->content_state == svn_wc_notify_state_conflicted)
{
- store_path(nb, nb->text_conflicts, path_local);
+ store_path(nb, nb->conflict_stats->text_conflicts, path_local);
if ((err = svn_cmdline_printf(pool, "C %s\n", path_local)))
goto print_error;
}
@@ -278,7 +345,7 @@ notify(void *baton, const svn_wc_notify_
nb->received_some_change = TRUE;
if (n->content_state == svn_wc_notify_state_conflicted)
{
- store_path(nb, nb->text_conflicts, path_local);
+ store_path(nb, nb->conflict_stats->text_conflicts, path_local);
statchar_buf[0] = 'C';
}
else
@@ -286,7 +353,7 @@ notify(void *baton, const svn_wc_notify_
if (n->prop_state == svn_wc_notify_state_conflicted)
{
- store_path(nb, nb->prop_conflicts, path_local);
+ store_path(nb, nb->conflict_stats->prop_conflicts, path_local);
statchar_buf[1] = 'C';
}
else if (n->prop_state == svn_wc_notify_state_merged)
@@ -316,23 +383,6 @@ notify(void *baton, const svn_wc_notify_
break;
case svn_wc_notify_resolved:
- /* All conflicts on this path are resolved, so remove path from
- each of the text-, prop- and tree-conflict lists. */
- if (svn_hash_gets(nb->text_conflicts, path_local))
- {
- svn_hash_sets(nb->text_conflicts, path_local, NULL);
- nb->text_conflicts_resolved++;
- }
- if (svn_hash_gets(nb->prop_conflicts, path_local))
- {
- svn_hash_sets(nb->prop_conflicts, path_local, NULL);
- nb->prop_conflicts_resolved++;
- }
- if (svn_hash_gets(nb->tree_conflicts, path_local))
- {
- svn_hash_sets(nb->tree_conflicts, path_local, NULL);
- nb->tree_conflicts_resolved++;
- }
if ((err = svn_cmdline_printf(pool,
_("Resolved conflicted state of '%s'\n"),
path_local)))
@@ -369,7 +419,7 @@ notify(void *baton, const svn_wc_notify_
nb->received_some_change = TRUE;
if (n->content_state == svn_wc_notify_state_conflicted)
{
- store_path(nb, nb->text_conflicts, path_local);
+ store_path(nb, nb->conflict_stats->text_conflicts, path_local);
statchar_buf[0] = 'C';
}
else if (n->kind == svn_node_file)
@@ -382,7 +432,7 @@ notify(void *baton, const svn_wc_notify_
if (n->prop_state == svn_wc_notify_state_conflicted)
{
- store_path(nb, nb->prop_conflicts, path_local);
+ store_path(nb, nb->conflict_stats->prop_conflicts, path_local);
statchar_buf[1] = 'C';
}
else if (n->prop_state == svn_wc_notify_state_changed)
@@ -581,7 +631,7 @@ notify(void *baton, const svn_wc_notify_
{
if (n->content_state == svn_wc_notify_state_conflicted)
{
- store_path(nb, nb->text_conflicts, path_local);
+ store_path(nb, nb->conflict_stats->text_conflicts, path_local);
statchar_buf[0] = 'C';
}
else if (n->kind == svn_node_file)
@@ -594,7 +644,7 @@ notify(void *baton, const svn_wc_notify_
if (n->prop_state == svn_wc_notify_state_conflicted)
{
- store_path(nb, nb->prop_conflicts, path_local);
+ store_path(nb, nb->conflict_stats->prop_conflicts, path_local);
statchar_buf[1] = 'C';
}
else if (n->prop_state == svn_wc_notify_state_merged)
@@ -971,7 +1021,7 @@ notify(void *baton, const svn_wc_notify_
break;
case svn_wc_notify_tree_conflict:
- store_path(nb, nb->tree_conflicts, path_local);
+ store_path(nb, nb->conflict_stats->tree_conflicts, path_local);
if ((err = svn_cmdline_printf(pool, " C %s\n", path_local)))
goto print_error;
break;
@@ -996,50 +1046,50 @@ notify(void *baton, const svn_wc_notify_
case svn_wc_notify_property_modified:
case svn_wc_notify_property_added:
- err = svn_cmdline_printf(pool,
- _("property '%s' set on '%s'\n"),
- n->prop_name, path_local);
- if (err)
- goto print_error;
+ err = svn_cmdline_printf(pool,
+ _("property '%s' set on '%s'\n"),
+ n->prop_name, path_local);
+ if (err)
+ goto print_error;
break;
case svn_wc_notify_property_deleted:
- err = svn_cmdline_printf(pool,
- _("property '%s' deleted from '%s'.\n"),
- n->prop_name, path_local);
- if (err)
- goto print_error;
+ err = svn_cmdline_printf(pool,
+ _("property '%s' deleted from '%s'.\n"),
+ n->prop_name, path_local);
+ if (err)
+ goto print_error;
break;
case svn_wc_notify_property_deleted_nonexistent:
- err = svn_cmdline_printf(pool,
- _("Attempting to delete nonexistent "
- "property '%s' on '%s'\n"), n->prop_name,
- path_local);
- if (err)
- goto print_error;
+ err = svn_cmdline_printf(pool,
+ _("Attempting to delete nonexistent "
+ "property '%s' on '%s'\n"), n->prop_name,
+ path_local);
+ if (err)
+ goto print_error;
break;
case svn_wc_notify_revprop_set:
- err = svn_cmdline_printf(pool,
- _("property '%s' set on repository revision %ld\n"),
- n->prop_name, n->revision);
+ err = svn_cmdline_printf(pool,
+ _("property '%s' set on repository revision %ld\n"),
+ n->prop_name, n->revision);
if (err)
goto print_error;
break;
case svn_wc_notify_revprop_deleted:
- err = svn_cmdline_printf(pool,
+ err = svn_cmdline_printf(pool,
_("property '%s' deleted from repository revision %ld\n"),
n->prop_name, n->revision);
- if (err)
- goto print_error;
+ if (err)
+ goto print_error;
break;
case svn_wc_notify_upgraded_path:
- err = svn_cmdline_printf(pool, _("Upgraded '%s'\n"), path_local);
- if (err)
- goto print_error;
+ err = svn_cmdline_printf(pool, _("Upgraded '%s'\n"), path_local);
+ if (err)
+ goto print_error;
break;
case svn_wc_notify_url_redirect:
@@ -1050,8 +1100,9 @@ notify(void *baton, const svn_wc_notify_
break;
case svn_wc_notify_path_nonexistent:
- err = svn_cmdline_printf(pool, _("'%s' is not under version control"),
- path_local);
+ err = svn_cmdline_printf(pool, "%s\n",
+ apr_psprintf(pool, _("'%s' is not under version control"),
+ path_local));
if (err)
goto print_error;
break;
@@ -1067,17 +1118,20 @@ notify(void *baton, const svn_wc_notify_
case svn_wc_notify_foreign_copy_begin:
if (n->merge_range == NULL)
- err = svn_cmdline_printf(pool,
- _("--- Copying from foreign repository URL '%s':\n"),
- n->url);
- if (err)
- goto print_error;
+ {
+ err = svn_cmdline_printf(
+ pool,
+ _("--- Copying from foreign repository URL '%s':\n"),
+ n->url);
+ if (err)
+ goto print_error;
+ }
break;
case svn_wc_notify_move_broken:
- err = svn_cmdline_printf(pool,
- _("Breaking move with source path '%s'\n"),
- path_local);
+ err = svn_cmdline_printf(pool,
+ _("Breaking move with source path '%s'\n"),
+ path_local);
if (err)
goto print_error;
break;
@@ -1115,6 +1169,7 @@ notify(void *baton, const svn_wc_notify_
svn_error_t *
svn_cl__get_notifier(svn_wc_notify_func2_t *notify_func_p,
void **notify_baton_p,
+ svn_cl__conflict_stats_t *conflict_stats,
apr_pool_t *pool)
{
struct notify_baton *nb = apr_pcalloc(pool, sizeof(*nb));
@@ -1126,14 +1181,7 @@ svn_cl__get_notifier(svn_wc_notify_func2
nb->is_wc_to_repos_copy = FALSE;
nb->in_external = FALSE;
nb->had_print_error = FALSE;
- nb->stats_pool = pool;
- nb->text_conflicts = apr_hash_make(pool);
- nb->prop_conflicts = apr_hash_make(pool);
- nb->tree_conflicts = apr_hash_make(pool);
- nb->text_conflicts_resolved = 0;
- nb->prop_conflicts_resolved = 0;
- nb->tree_conflicts_resolved = 0;
- nb->skipped_paths = 0;
+ nb->conflict_stats = conflict_stats;
SVN_ERR(svn_dirent_get_absolute(&nb->path_prefix, "", pool));
*notify_func_p = notify;
Modified: subversion/branches/verify-keep-going/subversion/svn/propedit-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svn/propedit-cmd.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svn/propedit-cmd.c (original)
+++ subversion/branches/verify-keep-going/subversion/svn/propedit-cmd.c Wed Jun 5 09:22:43 2013
@@ -87,7 +87,8 @@ svn_cl__propedit(apr_getopt_t *os,
_("'%s' is not a valid Subversion property name"),
pname_utf8);
if (!opt_state->force)
- SVN_ERR(svn_cl__check_svn_prop_name(pname_utf8, opt_state->revprop, pool));
+ SVN_ERR(svn_cl__check_svn_prop_name(pname_utf8, opt_state->revprop,
+ svn_cl__prop_use_edit, pool));
if (opt_state->encoding && !svn_prop_needs_translation(pname_utf8))
return svn_error_create
Modified: subversion/branches/verify-keep-going/subversion/svn/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svn/props.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svn/props.c (original)
+++ subversion/branches/verify-keep-going/subversion/svn/props.c Wed Jun 5 09:22:43 2013
@@ -164,8 +164,64 @@ simprop_compare(const void *pkeya, const
: (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)
+{
+ switch (prop_use)
+ {
+ case svn_cl__prop_use_set:
+ return apr_psprintf(
+ scratch_pool,
+ _("(To set the '%s' property, re-run with '--force'.)"),
+ prop_name);
+ case svn_cl__prop_use_edit:
+ return apr_psprintf(
+ scratch_pool,
+ _("(To edit the '%s' property, re-run with '--force'.)"),
+ prop_name);
+ case svn_cl__prop_use_use:
+ default:
+ return apr_psprintf(
+ scratch_pool,
+ _("(To use the '%s' property, re-run with '--force'.)"),
+ prop_name);
+ }
+}
+
+static const char*
+wrong_prop_error_message(svn_cl__prop_use_t prop_use, const char *prop_name,
+ apr_pool_t *scratch_pool)
+{
+ switch (prop_use)
+ {
+ 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"),
+ 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"),
+ 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"),
+ prop_name, SVN_PROP_PREFIX);
+ }
+}
+
svn_error_t *
-svn_cl__check_svn_prop_name(const char *propname, svn_boolean_t revprop,
+svn_cl__check_svn_prop_name(const char *propname,
+ svn_boolean_t revprop,
+ svn_cl__prop_use_t prop_use,
apr_pool_t *scratch_pool)
{
static const char *const nodeprops[] =
@@ -222,9 +278,10 @@ svn_cl__check_svn_prop_name(const char *
if (0 == strcmp(proplist[i] + prefix.len, propname + prefix.len))
return svn_error_createf(
SVN_ERR_CLIENT_PROPERTY_NAME, NULL,
- _("'%s' is not a valid %s property name; did you mean '%s'?"
- "\n(To set the '%s' property, re-run with '--force'.)"),
- propname, SVN_PROP_PREFIX, proplist[i], propname);
+ _("'%s' is not a valid %s property name;"
+ " did you mean '%s'?\n%s"),
+ propname, SVN_PROP_PREFIX, proplist[i],
+ force_prop_option_message(prop_use, propname, scratch_pool));
}
return SVN_NO_ERROR;
}
@@ -264,39 +321,36 @@ svn_cl__check_svn_prop_name(const char *
{
case 0:
/* The best alternative isn't good enough */
- return svn_error_createf(
+ return svn_error_create(
SVN_ERR_CLIENT_PROPERTY_NAME, NULL,
- _("'%s' is not a valid %s property name;"
- " re-run with '--force' to set it"),
- propname, SVN_PROP_PREFIX);
+ wrong_prop_error_message(prop_use, propname, scratch_pool));
case 1:
/* There is only one good candidate */
return svn_error_createf(
SVN_ERR_CLIENT_PROPERTY_NAME, NULL,
- _("'%s' is not a valid %s property name; did you mean '%s'?\n"
- "(To set the '%s' property, re-run with '--force'.)"),
- propname, SVN_PROP_PREFIX, propkeys[0]->propname, propname);
+ _("'%s' is not a valid %s property name; did you mean '%s'?\n%s"),
+ propname, SVN_PROP_PREFIX, propkeys[0]->propname,
+ force_prop_option_message(prop_use, propname, scratch_pool));
case 2:
/* Suggest a list of the most likely candidates */
return 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"
- "(To set the '%s' property, re-run with '--force'.)"),
+ "Did you mean '%s' or '%s'?\n%s"),
propname, SVN_PROP_PREFIX,
- propkeys[0]->propname, propkeys[1]->propname, propname);
+ propkeys[0]->propname, propkeys[1]->propname,
+ force_prop_option_message(prop_use, propname, scratch_pool));
default:
/* Never suggest more than three candidates */
return 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"
- "(To set the '%s' property, re-run with '--force'.)"),
+ "Did you mean '%s', '%s' or '%s'?\n%s"),
propname, SVN_PROP_PREFIX,
propkeys[0]->propname, propkeys[1]->propname, propkeys[2]->propname,
- propname);
+ force_prop_option_message(prop_use, propname, scratch_pool));
}
}
Modified: subversion/branches/verify-keep-going/subversion/svn/propset-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svn/propset-cmd.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svn/propset-cmd.c (original)
+++ subversion/branches/verify-keep-going/subversion/svn/propset-cmd.c Wed Jun 5 09:22:43 2013
@@ -69,7 +69,7 @@ svn_cl__propset(apr_getopt_t *os,
pname_utf8);
if (!opt_state->force)
SVN_ERR(svn_cl__check_svn_prop_name(pname_utf8, opt_state->revprop,
- scratch_pool));
+ svn_cl__prop_use_set, scratch_pool));
/* Get the PROPVAL from either an external file, or from the command
line. */
Modified: subversion/branches/verify-keep-going/subversion/svn/resolve-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svn/resolve-cmd.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svn/resolve-cmd.c (original)
+++ subversion/branches/verify-keep-going/subversion/svn/resolve-cmd.c Wed Jun 5 09:22:43 2013
@@ -52,9 +52,6 @@ svn_cl__resolve(apr_getopt_t *os,
int i;
apr_pool_t *iterpool;
svn_boolean_t had_error = FALSE;
- svn_wc_conflict_resolver_func2_t conflict_func2;
- void *conflict_baton2;
- svn_cl__interactive_conflict_baton_t *b;
switch (opt_state->accept_which)
{
@@ -106,21 +103,6 @@ svn_cl__resolve(apr_getopt_t *os,
SVN_ERR(svn_cl__check_targets_are_local_paths(targets));
- /* Store old state */
- conflict_func2 = ctx->conflict_func2;
- conflict_baton2 = ctx->conflict_baton2;
-
- /* This subcommand always uses the interactive resolver function. */
- ctx->conflict_func2 = svn_cl__conflict_func_interactive;
- SVN_ERR(svn_cl__get_conflict_func_interactive_baton(&b,
- opt_state->accept_which,
- ctx->config,
- opt_state->editor_cmd,
- ctx->cancel_func,
- ctx->cancel_baton,
- scratch_pool));
- ctx->conflict_baton2 = b;
-
iterpool = svn_pool_create(scratch_pool);
for (i = 0; i < targets->nelts; i++)
{
@@ -140,10 +122,6 @@ svn_cl__resolve(apr_getopt_t *os,
}
svn_pool_destroy(iterpool);
- /* Restore state */
- ctx->conflict_func2 = conflict_func2;
- ctx->conflict_baton2 = conflict_baton2;
-
if (had_error)
return svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS, NULL,
_("Failure occurred resolving one or more "
Modified: subversion/branches/verify-keep-going/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svn/svn.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svn/svn.c (original)
+++ subversion/branches/verify-keep-going/subversion/svn/svn.c Wed Jun 5 09:22:43 2013
@@ -647,7 +647,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
" If locked, the letter 'O'. (Use 'svn info URL' to see details)\n"
" Size (in bytes)\n"
" Date and time of the last commit\n"),
- {'r', 'v', 'R', opt_depth, opt_incremental, opt_xml,
+ {'r', 'v', 'R', opt_depth, opt_incremental, opt_xml,
opt_include_externals },
{{opt_include_externals, N_("include externals definitions")}} },
@@ -1146,7 +1146,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
" The --allow-mixed-revisions option is provided for backward compatibility.\n"
"\n"
" The --revision option has no use and is deprecated.\n"),
- {'r', 'q', opt_force, opt_parents, opt_allow_mixed_revisions,
+ {'r', 'q', opt_force, opt_parents, opt_allow_mixed_revisions,
SVN_CL__LOG_MSG_OPTIONS} },
{ "patch", svn_cl__patch, {0}, N_
@@ -1274,13 +1274,32 @@ const svn_opt_subcommand_desc2_t svn_cl_
" Property names starting with 'svn:' are reserved. Subversion recognizes\n"
" the following special versioned properties on a file:\n"
" svn:keywords - Keywords to be expanded. Valid keywords are:\n"
- " URL, HeadURL - The URL for the head version of the object.\n"
+ " URL, HeadURL - The URL for the head version of the file.\n"
" Author, LastChangedBy - The last person to modify the file.\n"
- " Date, LastChangedDate - The date/time the object was last modified.\n"
- " Rev, Revision, - The last revision the object changed.\n"
+ " Date, LastChangedDate - The date/time the file was last modified.\n"
+ " Rev, Revision, - The last revision the file changed.\n"
" LastChangedRevision\n"
" Id - A compressed summary of the previous four.\n"
" Header - Similar to Id but includes the full URL.\n"
+ "\n"
+ " Custom keywords can be defined with a format string separated from\n"
+ " the keyword name with '='. Valid format substitutions are:\n"
+ " %a - The author of the revision given by %r.\n"
+ " %b - The basename of the URL of the file.\n"
+ " %d - Short format of the date of the revision given by %r.\n"
+ " %D - Long format of the date of the revision given by %r.\n"
+ " %P - The file's path, relative to the repository root.\n"
+ " %r - The number of the revision which last changed the file.\n"
+ " %R - The URL to the root of the repository.\n"
+ " %u - The URL of the file.\n"
+ " %_ - A space (keyword definitions cannot contain a literal space).\n"
+ " %% - A literal '%'.\n"
+ " %H - Equivalent to %P%_%r%_%d%_%a.\n"
+ " %I - Equivalent to %b%_%r%_%d%_%a.\n"
+ " Example custom keyword definition: MyKeyword=%r%_%a%_%P\n"
+ " Once a custom keyword has been defined for a file, it can be used\n"
+ " within the file like any other keyword: $MyKeyword$\n"
+ "\n"
" svn:executable - If present, make the file executable. Use\n"
" 'svn propdel svn:executable PATH...' to clear.\n"
" svn:eol-style - One of 'native', 'LF', 'CR', 'CRLF'.\n"
@@ -1703,14 +1722,17 @@ sub_main(int argc, const char *argv[], a
apr_array_header_t *received_opts;
int i;
const svn_opt_subcommand_desc2_t *subcommand = NULL;
- const char *dash_m_arg = NULL, *dash_F_arg = NULL;
+ const char *dash_F_arg = NULL;
svn_cl__cmd_baton_t command_baton;
svn_auth_baton_t *ab;
svn_config_t *cfg_config;
svn_boolean_t descend = TRUE;
svn_boolean_t interactive_conflicts = FALSE;
svn_boolean_t force_interactive = FALSE;
+ svn_cl__conflict_stats_t *conflict_stats
+ = svn_cl__conflict_stats_create(pool);
svn_boolean_t use_notifier = TRUE;
+ svn_boolean_t reading_file_from_stdin = FALSE;
apr_hash_t *changelists;
apr_hash_t *cfg_hash;
@@ -1746,7 +1768,7 @@ sub_main(int argc, const char *argv[], a
/* No args? Show usage. */
if (argc <= 1)
{
- svn_cl__help(NULL, NULL, pool);
+ SVN_INT_ERR(svn_cl__help(NULL, NULL, pool));
return EXIT_FAILURE;
}
@@ -1766,7 +1788,7 @@ sub_main(int argc, const char *argv[], a
break;
else if (apr_err)
{
- svn_cl__help(NULL, NULL, pool);
+ SVN_INT_ERR(svn_cl__help(NULL, NULL, pool));
return EXIT_FAILURE;
}
@@ -1776,7 +1798,8 @@ sub_main(int argc, const char *argv[], a
switch (opt_id) {
case 'l':
{
- err = svn_cstring_atoi(&opt_state.limit, opt_arg);
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+ err = svn_cstring_atoi(&opt_state.limit, utf8_opt_arg);
if (err)
{
err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, err,
@@ -1792,16 +1815,17 @@ sub_main(int argc, const char *argv[], a
}
break;
case 'm':
- /* Note that there's no way here to detect if the log message
- contains a zero byte -- if it does, then opt_arg will just
- be shorter than the user intended. Oh well. */
+ /* We store the raw message here. We will convert it to UTF-8
+ * later, according to the value of the '--encoding' option. */
opt_state.message = apr_pstrdup(pool, opt_arg);
- dash_m_arg = opt_arg;
break;
case 'c':
{
- apr_array_header_t *change_revs =
- svn_cstring_split(opt_arg, ", \n\r\t\v", TRUE, pool);
+ apr_array_header_t *change_revs;
+
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+ change_revs = svn_cstring_split(utf8_opt_arg, ", \n\r\t\v", TRUE,
+ pool);
if (opt_state.old_target)
{
@@ -1896,10 +1920,10 @@ sub_main(int argc, const char *argv[], a
break;
case 'r':
opt_state.used_revision_arg = TRUE;
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
if (svn_opt_parse_revision_to_range(opt_state.revision_ranges,
- opt_arg, pool) != 0)
+ utf8_opt_arg, pool) != 0)
{
- SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
err = svn_error_createf
(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("Syntax error in revision argument '%s'"),
@@ -1924,19 +1948,19 @@ sub_main(int argc, const char *argv[], a
opt_state.incremental = TRUE;
break;
case 'F':
+ /* We read the raw file content here. We will convert it to UTF-8
+ * later (if it's a log/lock message or an svn:* prop value),
+ * according to the value of the '--encoding' option. */
SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
SVN_INT_ERR(svn_stringbuf_from_file2(&(opt_state.filedata),
utf8_opt_arg, pool));
- dash_F_arg = opt_arg;
+ reading_file_from_stdin = (strcmp(utf8_opt_arg, "-") == 0);
+ dash_F_arg = utf8_opt_arg;
break;
case opt_targets:
{
svn_stringbuf_t *buffer, *buffer_utf8;
- /* We need to convert to UTF-8 now, even before we divide
- the targets into an array, because otherwise we wouldn't
- know what delimiter to use for svn_cstring_split(). */
-
SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
SVN_INT_ERR(svn_stringbuf_from_file2(&buffer, utf8_opt_arg, pool));
SVN_INT_ERR(svn_utf_stringbuf_to_utf8(&buffer_utf8, buffer, pool));
@@ -2086,17 +2110,16 @@ sub_main(int argc, const char *argv[], a
_("Can't specify -c with --old"));
return EXIT_ERROR(err);
}
- opt_state.old_target = apr_pstrdup(pool, opt_arg);
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+ opt_state.old_target = apr_pstrdup(pool, utf8_opt_arg);
break;
case opt_new_cmd:
- opt_state.new_target = apr_pstrdup(pool, opt_arg);
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+ opt_state.new_target = apr_pstrdup(pool, utf8_opt_arg);
break;
case opt_config_dir:
- {
- const char *path_utf8;
- SVN_INT_ERR(svn_utf_cstring_to_utf8(&path_utf8, opt_arg, pool));
- opt_state.config_dir = svn_dirent_internal_style(path_utf8, pool);
- }
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+ opt_state.config_dir = svn_dirent_internal_style(utf8_opt_arg, pool);
break;
case opt_config_options:
if (!opt_state.config_options)
@@ -2104,9 +2127,9 @@ sub_main(int argc, const char *argv[], a
apr_array_make(pool, 1,
sizeof(svn_cmdline__config_argument_t*));
- SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool));
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
SVN_INT_ERR(svn_cmdline__parse_config_option(opt_state.config_options,
- opt_arg, pool));
+ utf8_opt_arg, pool));
break;
case opt_autoprops:
opt_state.autoprops = TRUE;
@@ -2115,12 +2138,12 @@ sub_main(int argc, const char *argv[], a
opt_state.no_autoprops = TRUE;
break;
case opt_native_eol:
- if ( !strcmp("LF", opt_arg) || !strcmp("CR", opt_arg) ||
- !strcmp("CRLF", opt_arg))
- opt_state.native_eol = apr_pstrdup(pool, opt_arg);
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+ if ( !strcmp("LF", utf8_opt_arg) || !strcmp("CR", utf8_opt_arg) ||
+ !strcmp("CRLF", utf8_opt_arg))
+ opt_state.native_eol = utf8_opt_arg;
else
{
- SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
err = svn_error_createf
(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("Syntax error in native-eol argument '%s'"),
@@ -2138,14 +2161,14 @@ sub_main(int argc, const char *argv[], a
opt_state.remove = TRUE;
break;
case opt_changelist:
- opt_state.changelist = apr_pstrdup(pool, opt_arg);
- if (opt_state.changelist[0] == '\0')
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+ if (utf8_opt_arg[0] == '\0')
{
err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("Changelist names must not be empty"));
return EXIT_ERROR(err);
}
- svn_hash_sets(changelists, opt_state.changelist, (void *)1);
+ svn_hash_sets(changelists, utf8_opt_arg, (void *)1);
break;
case opt_keep_changelists:
opt_state.keep_changelists = TRUE;
@@ -2172,31 +2195,35 @@ sub_main(int argc, const char *argv[], a
opt_state.use_merge_history = TRUE;
break;
case opt_accept:
- opt_state.accept_which = svn_cl__accept_from_word(opt_arg);
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+ opt_state.accept_which = svn_cl__accept_from_word(utf8_opt_arg);
if (opt_state.accept_which == svn_cl__accept_invalid)
return EXIT_ERROR
(svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("'%s' is not a valid --accept value"),
- opt_arg));
+ utf8_opt_arg));
break;
case opt_show_revs:
- opt_state.show_revs = svn_cl__show_revs_from_word(opt_arg);
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+ opt_state.show_revs = svn_cl__show_revs_from_word(utf8_opt_arg);
if (opt_state.show_revs == svn_cl__show_revs_invalid)
return EXIT_ERROR
(svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("'%s' is not a valid --show-revs value"),
- opt_arg));
+ utf8_opt_arg));
break;
case opt_reintegrate:
opt_state.reintegrate = TRUE;
break;
case opt_strip:
{
- err = svn_cstring_atoi(&opt_state.strip, opt_arg);
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+ err = svn_cstring_atoi(&opt_state.strip, utf8_opt_arg);
if (err)
{
err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, err,
- _("Invalid strip count '%s'"), opt_arg);
+ _("Invalid strip count '%s'"),
+ utf8_opt_arg);
return EXIT_ERROR(err);
}
if (opt_state.strip < 0)
@@ -2241,10 +2268,12 @@ sub_main(int argc, const char *argv[], a
opt_state.diff.properties_only = TRUE;
break;
case opt_search:
- add_search_pattern_group(&opt_state, opt_arg, pool);
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+ add_search_pattern_group(&opt_state, utf8_opt_arg, pool);
break;
case opt_search_and:
- add_search_pattern_to_latest_group(&opt_state, opt_arg, pool);
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+ add_search_pattern_to_latest_group(&opt_state, utf8_opt_arg, pool);
default:
/* Hmmm. Perhaps this would be a good place to squirrel away
opts that commands like svn diff might need. Hmmm indeed. */
@@ -2312,7 +2341,7 @@ sub_main(int argc, const char *argv[], a
svn_error_clear
(svn_cmdline_fprintf(stderr, pool,
_("Subcommand argument required\n")));
- svn_cl__help(NULL, NULL, pool);
+ svn_error_clear(svn_cl__help(NULL, NULL, pool));
return EXIT_FAILURE;
}
}
@@ -2330,7 +2359,7 @@ sub_main(int argc, const char *argv[], a
(svn_cmdline_fprintf(stderr, pool,
_("Unknown subcommand: '%s'\n"),
first_arg_utf8));
- svn_cl__help(NULL, NULL, pool);
+ svn_error_clear(svn_cl__help(NULL, NULL, pool));
/* Be kind to people who try 'svn undo'. */
if (strcmp(first_arg_utf8, "undo") == 0)
@@ -2368,7 +2397,7 @@ sub_main(int argc, const char *argv[], a
subcommand, pool);
svn_opt_format_option(&optstr, badopt, FALSE, pool);
if (subcommand->name[0] == '-')
- svn_cl__help(NULL, NULL, pool);
+ svn_error_clear(svn_cl__help(NULL, NULL, pool));
else
svn_error_clear
(svn_cmdline_fprintf
@@ -2423,6 +2452,24 @@ sub_main(int argc, const char *argv[], a
return EXIT_ERROR(err);
}
+#ifdef SVN_CL__OPTION_WITH_REVPROP_CAN_SET_PROPERTIES_IN_SVN_NAMESPACE
+ /* XXX This is incomplete, since we do not yet check for --force, nor
+ do all the commands that accept --with-revprop also accept --force. */
+
+ /* Check the spelling of the revision properties given by --with-revprop. */
+ if (opt_state.revprop_table)
+ {
+ apr_hash_index_t *hi;
+ for (hi = apr_hash_first(pool, opt_state.revprop_table);
+ hi; hi = apr_hash_next(hi))
+ {
+ SVN_INT_ERR(svn_cl__check_svn_prop_name(svn__apr_hash_index_key(hi),
+ TRUE, svn_cl__prop_use_use,
+ pool));
+ }
+ }
+#endif /* SVN_CL__OPTION_WITH_REVPROP_CAN_SET_PROPERTIES_IN_SVN_NAMESPACE */
+
/* Disallow simultaneous use of both -m and -F, when they are
both used to pass a commit message or lock comment. ('propset'
takes the property value, not a commit message, from -F.)
@@ -2640,10 +2687,10 @@ sub_main(int argc, const char *argv[], a
/* If the -m argument is a file at all, that's probably not what
the user intended. */
- if (dash_m_arg)
+ if (opt_state.message)
{
apr_finfo_t finfo;
- if (apr_stat(&finfo, dash_m_arg,
+ if (apr_stat(&finfo, opt_state.message /* not converted to UTF-8 */,
APR_FINFO_MIN, pool) == APR_SUCCESS)
{
if (subcommand->cmd_func != svn_cl__lock)
@@ -2737,7 +2784,7 @@ sub_main(int argc, const char *argv[], a
if (use_notifier)
{
SVN_INT_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
- pool));
+ conflict_stats, pool));
}
/* Set up our cancellation support. */
@@ -2833,7 +2880,7 @@ sub_main(int argc, const char *argv[], a
SVN_INT_ERR(svn_cl__get_conflict_func_interactive_baton(
&b,
opt_state.accept_which,
- ctx->config, opt_state.editor_cmd,
+ ctx->config, opt_state.editor_cmd, conflict_stats,
ctx->cancel_func, ctx->cancel_baton, pool));
ctx->conflict_baton2 = b;
}
@@ -2864,6 +2911,12 @@ sub_main(int argc, const char *argv[], a
_("Authentication failed and interactive"
" prompting is disabled; see the"
" --force-interactive option"));
+ if (reading_file_from_stdin)
+ err = svn_error_quick_wrap(err,
+ _("Reading file from standard input "
+ "because of -F option; this can "
+ "interfere with interactive "
+ "prompting"));
}
/* Tell the user about 'svn cleanup' if any error on the stack
Modified: subversion/branches/verify-keep-going/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svn/util.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svn/util.c (original)
+++ subversion/branches/verify-keep-going/subversion/svn/util.c Wed Jun 5 09:22:43 2013
@@ -343,22 +343,17 @@ svn_cl__get_log_message(const char **log
*tmp_file = NULL;
if (lmb->message)
{
- svn_stringbuf_t *log_msg_buf = svn_stringbuf_create(lmb->message, pool);
- svn_string_t *log_msg_str = apr_pcalloc(pool, sizeof(*log_msg_str));
+ svn_string_t *log_msg_str = svn_string_create(lmb->message, pool);
- /* Trim incoming messages of the EOF marker text and the junk
- that follows it. */
- truncate_buffer_at_prefix(&(log_msg_buf->len), log_msg_buf->data,
- EDITOR_EOF_PREFIX);
-
- /* Make a string from a stringbuf, sharing the data allocation. */
- log_msg_str->data = log_msg_buf->data;
- log_msg_str->len = log_msg_buf->len;
SVN_ERR_W(svn_subst_translate_string2(&log_msg_str, FALSE, FALSE,
log_msg_str, lmb->message_encoding,
FALSE, pool, pool),
_("Error normalizing log message to internal format"));
+ /* Strip off the EOF marker text and the junk that follows it. */
+ truncate_buffer_at_prefix(&(log_msg_str->len), (char *)log_msg_str->data,
+ EDITOR_EOF_PREFIX);
+
*log_msg = log_msg_str->data;
return SVN_NO_ERROR;
}
@@ -466,7 +461,7 @@ svn_cl__get_log_message(const char **log
if (msg_string)
message = svn_stringbuf_create_from_string(msg_string, pool);
- /* Strip the prefix from the buffer. */
+ /* Strip off the EOF marker text and the junk that follows it. */
if (message)
truncate_buffer_at_prefix(&message->len, message->data,
EDITOR_EOF_PREFIX);
@@ -1098,7 +1093,7 @@ svn_cl__propset_print_binary_mime_type_w
"operations will stop working on this file\n"),
canon_propval->data,
svn_dirent_local_style(local_abspath, iterpool)));
-
+
}
}
svn_pool_destroy(iterpool);
Modified: subversion/branches/verify-keep-going/subversion/svnadmin/svnadmin.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svnadmin/svnadmin.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svnadmin/svnadmin.c (original)
+++ subversion/branches/verify-keep-going/subversion/svnadmin/svnadmin.c Wed Jun 5 09:22:43 2013
@@ -39,6 +39,7 @@
#include "svn_cache_config.h"
#include "svn_version.h"
#include "svn_props.h"
+#include "svn_sorts.h"
#include "svn_time.h"
#include "svn_user.h"
#include "svn_xml.h"
@@ -47,6 +48,8 @@
#include "private/svn_subr_private.h"
#include "private/svn_cmdline_private.h"
+#include "../libsvn_fs_fs/fs.h" /* for SVN_FS_FS__MIN_PACKED_FORMAT */
+
#include "svn_private_config.h"
@@ -155,6 +158,7 @@ static svn_opt_subcommand_t
subcommand_freeze,
subcommand_help,
subcommand_hotcopy,
+ subcommand_info,
subcommand_load,
subcommand_list_dblogs,
subcommand_list_unused_dblogs,
@@ -233,7 +237,7 @@ static const apr_getopt_option_t options
N_("bypass property validation logic")},
{"quiet", 'q', 0,
- N_("no progress (only errors) to stderr")},
+ N_("no progress (only errors to stderr)")},
{"ignore-uuid", svnadmin__ignore_uuid, 0,
N_("ignore any repos UUID found in the stream")},
@@ -362,11 +366,16 @@ static const svn_opt_subcommand_desc2_t
{"hotcopy", subcommand_hotcopy, {0}, N_
("usage: svnadmin hotcopy REPOS_PATH NEW_REPOS_PATH\n\n"
- "Makes a hot copy of a repository.\n"
+ "Make a hot copy of a repository.\n"
"If --incremental is passed, data which already exists at the destination\n"
"is not copied again. Incremental mode is implemented for FSFS repositories.\n"),
{svnadmin__clean_logs, svnadmin__incremental} },
+ {"info", subcommand_info, {0}, N_
+ ("usage: svnadmin info REPOS_PATH\n\n"
+ "Print information about the repository at REPOS_PATH.\n"),
+ {0} },
+
{"list-dblogs", subcommand_list_dblogs, {0}, N_
("usage: svnadmin list-dblogs REPOS_PATH\n\n"
"List all Berkeley DB log files.\n\n"
@@ -465,7 +474,7 @@ static const svn_opt_subcommand_desc2_t
{"unlock", subcommand_unlock, {0}, N_
("usage: svnadmin unlock REPOS_PATH LOCKED_PATH USERNAME TOKEN\n\n"
- "Unlocked LOCKED_PATH (as USERNAME) after verifying that the token\n"
+ "Unlock LOCKED_PATH (as USERNAME) after verifying that the token\n"
"associated with the lock matches TOKEN. Use --bypass-hooks to avoid\n"
"triggering the pre-unlock and post-unlock hook scripts.\n"),
{svnadmin__bypass_hooks} },
@@ -485,7 +494,7 @@ static const svn_opt_subcommand_desc2_t
{"verify", subcommand_verify, {0}, N_
("usage: svnadmin verify REPOS_PATH\n\n"
- "Verifies the data stored in the repository.\n"),
+ "Verify the data stored in the repository.\n"),
{'t', 'r', 'q', svnadmin__keep_going, 'M'} },
{ NULL, NULL, {0}, NULL, {0} }
@@ -616,6 +625,17 @@ parse_args(apr_array_header_t **args,
}
+/* This implements 'svn_error_malfunction_handler_t. */
+static svn_error_t *
+crashtest_malfunction_handler(svn_boolean_t can_return,
+ const char *file,
+ int line,
+ const char *expr)
+{
+ abort();
+ return SVN_NO_ERROR; /* Not reached. */
+}
+
/* This implements `svn_opt_subcommand_t'. */
static svn_error_t *
subcommand_crashtest(apr_getopt_t *os, void *baton, apr_pool_t *pool)
@@ -623,7 +643,14 @@ subcommand_crashtest(apr_getopt_t *os, v
struct svnadmin_opt_state *opt_state = baton;
svn_repos_t *repos;
+ (void)svn_error_set_malfunction_handler(crashtest_malfunction_handler);
SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
+ SVN_ERR(svn_cmdline_printf(pool,
+ _("Successfully opened repository '%s'.\n"
+ "Will now crash to simulate a crashing "
+ "server process.\n"),
+ svn_dirent_local_style(opt_state->repository_path,
+ pool)));
SVN_ERR_MALFUNCTION();
/* merely silence a compiler warning (this will never be executed) */
@@ -749,6 +776,39 @@ subcommand_deltify(apr_getopt_t *os, voi
return SVN_NO_ERROR;
}
+static void
+cmdline_stream_printf(svn_stream_t *stream,
+ apr_pool_t *pool,
+ const char *fmt,
+ ...)
+ __attribute__((format(printf, 3, 4)));
+
+static void
+cmdline_stream_printf(svn_stream_t *stream,
+ apr_pool_t *pool,
+ const char *fmt,
+ ...)
+{
+ const char *message;
+ va_list ap;
+ svn_error_t *err;
+ const char *out;
+
+ va_start(ap, fmt);
+ message = apr_pvsprintf(pool, fmt, ap);
+ va_end(ap);
+
+ err = svn_cmdline_cstring_from_utf8(&out, message, pool);
+
+ if (err)
+ {
+ svn_error_clear(err);
+ out = svn_cmdline_cstring_from_utf8_fuzzy(message, pool);
+ }
+
+ svn_error_clear(svn_stream_puts(stream, out));
+}
+
/* Implementation of svn_repos_notify_func_t to wrap the output to a
response stream for svn_repos_dump_fs2() and svn_repos_verify_fs() */
@@ -758,46 +818,45 @@ repos_notify_handler(void *baton,
apr_pool_t *scratch_pool)
{
svn_stream_t *feedback_stream = baton;
- apr_size_t len;
switch (notify->action)
{
case svn_repos_notify_warning:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- "WARNING 0x%04x: %s\n", notify->warning,
- notify->warning_str));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ "WARNING 0x%04x: %s\n", notify->warning,
+ notify->warning_str);
return;
case svn_repos_notify_failure:
if (notify->revision != SVN_INVALID_REVNUM)
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("* Error verifying revision %ld.\n"),
- notify->revision));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("* Error verifying revision %ld.\n"),
+ notify->revision);
if (notify->err)
svn_handle_error2(notify->err, stderr, FALSE /* non-fatal */,
"svnadmin: ");
return;
case svn_repos_notify_dump_rev_end:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("* Dumped revision %ld.\n"),
- notify->revision));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("* Dumped revision %ld.\n"),
+ notify->revision);
return;
case svn_repos_notify_verify_rev_end:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("* Verified revision %ld.\n"),
- notify->revision));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("* Verified revision %ld.\n"),
+ notify->revision);
return;
case svn_repos_notify_verify_rev_structure:
if (notify->revision == SVN_INVALID_REVNUM)
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("* Verifying repository metadata ...\n")));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("* Verifying repository metadata ...\n"));
else
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("* Verifying metadata at revision %ld ...\n"),
- notify->revision));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("* Verifying metadata at revision %ld ...\n"),
+ notify->revision);
return;
case svn_repos_notify_pack_shard_start:
@@ -805,14 +864,14 @@ repos_notify_handler(void *baton,
const char *shardstr = apr_psprintf(scratch_pool,
"%" APR_INT64_T_FMT,
notify->shard);
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("Packing revisions in shard %s..."),
- shardstr));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("Packing revisions in shard %s..."),
+ shardstr);
}
return;
case svn_repos_notify_pack_shard_end:
- svn_error_clear(svn_stream_puts(feedback_stream, _("done.\n")));
+ cmdline_stream_printf(feedback_stream, scratch_pool, _("done.\n"));
return;
case svn_repos_notify_pack_shard_start_revprop:
@@ -820,30 +879,30 @@ repos_notify_handler(void *baton,
const char *shardstr = apr_psprintf(scratch_pool,
"%" APR_INT64_T_FMT,
notify->shard);
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("Packing revprops in shard %s..."),
- shardstr));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("Packing revprops in shard %s..."),
+ shardstr);
}
return;
case svn_repos_notify_pack_shard_end_revprop:
- svn_error_clear(svn_stream_puts(feedback_stream, _("done.\n")));
+ cmdline_stream_printf(feedback_stream, scratch_pool, _("done.\n"));
return;
case svn_repos_notify_load_txn_committed:
if (notify->old_revision == SVN_INVALID_REVNUM)
{
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("\n------- Committed revision %ld >>>\n\n"),
- notify->new_revision));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("\n------- Committed revision %ld >>>\n\n"),
+ notify->new_revision);
}
else
{
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("\n------- Committed new rev %ld"
- " (loaded from original rev %ld"
- ") >>>\n\n"), notify->new_revision,
- notify->old_revision));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("\n------- Committed new rev %ld"
+ " (loaded from original rev %ld"
+ ") >>>\n\n"), notify->new_revision,
+ notify->old_revision);
}
return;
@@ -852,27 +911,27 @@ repos_notify_handler(void *baton,
switch (notify->node_action)
{
case svn_node_action_change:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+ cmdline_stream_printf(feedback_stream, scratch_pool,
_(" * editing path : %s ..."),
- notify->path));
+ notify->path);
break;
case svn_node_action_delete:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+ cmdline_stream_printf(feedback_stream, scratch_pool,
_(" * deleting path : %s ..."),
- notify->path));
+ notify->path);
break;
case svn_node_action_add:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+ cmdline_stream_printf(feedback_stream, scratch_pool,
_(" * adding path : %s ..."),
- notify->path));
+ notify->path);
break;
case svn_node_action_replace:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+ cmdline_stream_printf(feedback_stream, scratch_pool,
_(" * replacing path : %s ..."),
- notify->path));
+ notify->path);
break;
}
@@ -880,32 +939,30 @@ repos_notify_handler(void *baton,
return;
case svn_repos_notify_load_node_done:
- len = 7;
- svn_error_clear(svn_stream_write(feedback_stream, _(" done.\n"), &len));
+ cmdline_stream_printf(feedback_stream, scratch_pool, _(" done.\n"));
return;
case svn_repos_notify_load_copied_node:
- len = 9;
- svn_error_clear(svn_stream_write(feedback_stream, "COPIED...", &len));
+ cmdline_stream_printf(feedback_stream, scratch_pool, "COPIED...");
return;
case svn_repos_notify_load_txn_start:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("<<< Started new transaction, based on "
- "original revision %ld\n"),
- notify->old_revision));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("<<< Started new transaction, based on "
+ "original revision %ld\n"),
+ notify->old_revision);
return;
case svn_repos_notify_load_skipped_rev:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("<<< Skipped original revision %ld\n"),
- notify->old_revision));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("<<< Skipped original revision %ld\n"),
+ notify->old_revision);
return;
case svn_repos_notify_load_normalized_mergeinfo:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _(" removing '\\r' from %s ..."),
- SVN_PROP_MERGEINFO));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _(" removing '\\r' from %s ..."),
+ SVN_PROP_MERGEINFO);
return;
case svn_repos_notify_mutex_acquired:
@@ -914,17 +971,17 @@ repos_notify_handler(void *baton,
return;
case svn_repos_notify_recover_start:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("Repository lock acquired.\n"
- "Please wait; recovering the"
- " repository may take some time...\n")));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("Repository lock acquired.\n"
+ "Please wait; recovering the"
+ " repository may take some time...\n"));
return;
case svn_repos_notify_upgrade_start:
- svn_error_clear(svn_stream_puts(feedback_stream,
- _("Repository lock acquired.\n"
- "Please wait; upgrading the"
- " repository may take some time...\n")));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("Repository lock acquired.\n"
+ "Please wait; upgrading the"
+ " repository may take some time...\n"));
return;
default:
@@ -1552,7 +1609,7 @@ subcommand_pack(apr_getopt_t *os, void *
/* Progress feedback goes to STDOUT, unless they asked to suppress it. */
if (! opt_state->quiet)
- progress_stream = recode_stream_create(stderr, pool);
+ progress_stream = recode_stream_create(stdout, pool);
return svn_error_trace(
svn_repos_fs_pack2(repos, !opt_state->quiet ? repos_notify_handler : NULL,
@@ -1613,7 +1670,7 @@ subcommand_verify(apr_getopt_t *os, void
}
if (! opt_state->quiet)
- progress_stream = recode_stream_create(stderr, pool);
+ progress_stream = recode_stream_create(stdout, pool);
return svn_error_trace(svn_repos_verify_fs3(repos, lower, upper,
opt_state->keep_going,
@@ -1641,6 +1698,120 @@ subcommand_hotcopy(apr_getopt_t *os, voi
check_cancel, NULL, pool);
}
+svn_error_t *
+subcommand_info(apr_getopt_t *os, void *baton, apr_pool_t *pool)
+{
+ struct svnadmin_opt_state *opt_state = baton;
+ svn_repos_t *repos;
+ svn_fs_t *fs;
+ int fs_format;
+
+ /* Expect no more arguments. */
+ SVN_ERR(parse_args(NULL, os, 0, 0, pool));
+
+ SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
+ fs = svn_repos_fs(repos);
+ SVN_ERR(svn_cmdline_printf(pool, _("Path: %s\n"),
+ svn_dirent_local_style(svn_repos_path(repos, pool),
+ pool)));
+
+ {
+ int repos_format, minor;
+ svn_version_t *repos_version, *fs_version;
+ SVN_ERR(svn_repos_info_format(&repos_format, &repos_version,
+ repos, pool, pool));
+ SVN_ERR(svn_cmdline_printf(pool, _("Repository Format: %d\n"),
+ repos_format));
+
+ SVN_ERR(svn_fs_info_format(&fs_format, &fs_version,
+ fs, pool, pool));
+ /* fs_format will be printed later. */
+
+ SVN_ERR_ASSERT(repos_version->major == SVN_VER_MAJOR);
+ SVN_ERR_ASSERT(fs_version->major == SVN_VER_MAJOR);
+ SVN_ERR_ASSERT(repos_version->patch == 0);
+ SVN_ERR_ASSERT(fs_version->patch == 0);
+
+ minor = (repos_version->minor > fs_version->minor)
+ ? repos_version->minor : fs_version->minor;
+ SVN_ERR(svn_cmdline_printf(pool, _("Compatible With Version: %d.%d.0\n"),
+ SVN_VER_MAJOR, minor));
+ }
+
+ {
+ apr_hash_t *capabilities_set;
+ apr_array_header_t *capabilities;
+ int i;
+
+ SVN_ERR(svn_repos_capabilities(&capabilities_set, repos, pool, pool));
+ capabilities = svn_sort__hash(capabilities_set,
+ svn_sort_compare_items_lexically,
+ pool);
+
+ for (i = 0; i < capabilities->nelts; i++)
+ {
+ svn_sort__item_t *item = &APR_ARRAY_IDX(capabilities, i,
+ svn_sort__item_t);
+ const char *capability = item->key;
+ SVN_ERR(svn_cmdline_printf(pool, _("Repository Capability: %s\n"),
+ capability));
+ }
+ }
+
+ {
+ const svn_fs_info_placeholder_t *info;
+
+ SVN_ERR(svn_fs_info(&info, fs, pool, pool));
+ SVN_ERR(svn_cmdline_printf(pool, _("Filesystem Type: %s\n"),
+ info->fs_type));
+ SVN_ERR(svn_cmdline_printf(pool, _("Filesystem Format: %d\n"),
+ fs_format));
+ if (!strcmp(info->fs_type, SVN_FS_TYPE_FSFS))
+ {
+ const svn_fs_fsfs_info_t *fsfs_info = (const void *)info;
+ svn_revnum_t youngest;
+ SVN_ERR(svn_fs_youngest_rev(&youngest, fs, pool));
+
+ if (fsfs_info->shard_size)
+ SVN_ERR(svn_cmdline_printf(pool, _("FSFS Sharded: yes\n")));
+ else
+ SVN_ERR(svn_cmdline_printf(pool, _("FSFS Sharded: no\n")));
+
+ if (fsfs_info->shard_size)
+ SVN_ERR(svn_cmdline_printf(pool, _("FSFS Shard Size: %d\n"),
+ fsfs_info->shard_size));
+
+ /* Print packing statistics, if supported by the FS format. */
+ if (fs_format >= SVN_FS_FS__MIN_PACKED_FORMAT && fsfs_info->shard_size)
+ {
+ const int shard_size = fsfs_info->shard_size;
+ const int shards_packed = fsfs_info->min_unpacked_rev / shard_size;
+ const int shards_full = (youngest + 1) / shard_size;
+ SVN_ERR(svn_cmdline_printf(pool, _("FSFS Shards Packed: %d/%d\n"),
+ shards_packed, shards_full));
+ }
+ }
+ }
+
+ {
+ apr_array_header_t *files;
+ int i;
+
+ SVN_ERR(svn_fs_info_config_files(&files, fs, pool, pool));
+ for (i = 0; i < files->nelts; i++)
+ SVN_ERR(svn_cmdline_printf(pool, _("Configuration File: %s\n"),
+ svn_dirent_local_style(
+ APR_ARRAY_IDX(files, i, const char *),
+ pool)));
+ }
+
+ /* 'svn info' prints an extra newline here, to support multiple targets.
+ We'll do the same. */
+ SVN_ERR(svn_cmdline_printf(pool, "\n"));
+
+ return SVN_NO_ERROR;
+}
+
/* This implements `svn_opt_subcommand_t'. */
static svn_error_t *
subcommand_lock(apr_getopt_t *os, void *baton, apr_pool_t *pool)
Modified: subversion/branches/verify-keep-going/subversion/svndumpfilter/svndumpfilter.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svndumpfilter/svndumpfilter.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svndumpfilter/svndumpfilter.c (original)
+++ subversion/branches/verify-keep-going/subversion/svndumpfilter/svndumpfilter.c Wed Jun 5 09:22:43 2013
@@ -894,7 +894,7 @@ delete_node_property(void *node_baton, c
"are not enabled for node '%s' in original "
"revision %ld"),
nb->node_path, rb->rev_orig);
-
+
nb->has_props = TRUE;
write_propdel_to_stringbuf(&(nb->props), name);
Modified: subversion/branches/verify-keep-going/subversion/svnlook/svnlook.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svnlook/svnlook.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svnlook/svnlook.c (original)
+++ subversion/branches/verify-keep-going/subversion/svnlook/svnlook.c Wed Jun 5 09:22:43 2013
@@ -47,6 +47,7 @@
#include "svn_time.h"
#include "svn_utf.h"
#include "svn_subst.h"
+#include "svn_sorts.h"
#include "svn_opt.h"
#include "svn_props.h"
#include "svn_diff.h"
@@ -962,7 +963,7 @@ print_diff_tree(svn_stream_t *out_stream
if (diff_cmd_argc)
{
int i;
- diff_cmd_argv = apr_palloc(pool,
+ diff_cmd_argv = apr_palloc(pool,
diff_cmd_argc * sizeof(char *));
for (i = 0; i < diff_cmd_argc; i++)
SVN_ERR(svn_utf_cstring_to_utf8(&diff_cmd_argv[i],
@@ -1167,7 +1168,6 @@ print_tree(svn_fs_root_t *root,
{
apr_pool_t *subpool;
apr_hash_t *entries;
- apr_hash_index_t *hi;
const char* name;
SVN_ERR(check_cancel(NULL));
@@ -1215,11 +1215,18 @@ print_tree(svn_fs_root_t *root,
/* Recursively handle the node's children. */
if (recurse || (indentation == 0))
{
+ apr_array_header_t *sorted_entries;
+ int i;
+
SVN_ERR(svn_fs_dir_entries(&entries, root, path, pool));
subpool = svn_pool_create(pool);
- for (hi = apr_hash_first(pool, entries); hi; hi = apr_hash_next(hi))
- {
- svn_fs_dirent_t *entry = svn__apr_hash_index_val(hi);
+ sorted_entries = svn_sort__hash(entries,
+ svn_sort_compare_items_lexically, pool);
+ for (i = 0; i < sorted_entries->nelts; i++)
+ {
+ svn_sort__item_t item = APR_ARRAY_IDX(sorted_entries, i,
+ svn_sort__item_t);
+ svn_fs_dirent_t *entry = item.value;
svn_pool_clear(subpool);
SVN_ERR(print_tree(root,
Modified: subversion/branches/verify-keep-going/subversion/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svnmucc/svnmucc.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svnmucc/svnmucc.c (original)
+++ subversion/branches/verify-keep-going/subversion/svnmucc/svnmucc.c Wed Jun 5 09:22:43 2013
@@ -952,7 +952,7 @@ usage(apr_pool_t *pool, int exit_val)
" NAME[=VALUE]\n"
" --non-interactive : do no interactive prompting (default is to\n"
" prompt only if standard input is a terminal)\n"
- " --force-interactive : do interactive propmting even if standard\n"
+ " --force-interactive : do interactive prompting even if standard\n"
" input is not a terminal\n"
" --trust-server-cert : accept SSL server certificates from unknown\n"
" certificate authorities without prompting (but\n"
@@ -1036,7 +1036,7 @@ sanitize_log_sources(apr_hash_t *revprop
svn_hash_sets(revprops, SVN_PROP_REVISION_LOG,
svn_string_create(message, hash_pool));
}
-
+
return SVN_NO_ERROR;
}
Modified: subversion/branches/verify-keep-going/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svnrdump/dump_editor.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svnrdump/dump_editor.c (original)
+++ subversion/branches/verify-keep-going/subversion/svnrdump/dump_editor.c Wed Jun 5 09:22:43 2013
@@ -114,7 +114,7 @@ struct file_baton
/* The action associate with this node. */
enum svn_node_action action;
-
+
/* Flags to trigger dumping props and text. */
svn_boolean_t dump_text;
svn_boolean_t dump_props;
@@ -202,7 +202,7 @@ make_dir_baton(const char *path,
new_db->parent_dir_baton = pb;
new_db->pool = pool;
new_db->repos_relpath = repos_relpath;
- new_db->copyfrom_path = copyfrom_path
+ new_db->copyfrom_path = copyfrom_path
? svn_relpath_canonicalize(copyfrom_path, pool)
: NULL;
new_db->copyfrom_rev = copyfrom_rev;
@@ -556,7 +556,7 @@ dump_pending(struct dump_edit_baton *eb,
/* Some pending properties to dump? */
SVN_ERR(do_dump_props(NULL, eb->stream, db->props, db->deleted_props,
&(db->dump_props), db->pool, scratch_pool));
-
+
/* Some pending newlines to dump? */
SVN_ERR(do_dump_newlines(eb, &(db->dump_newlines), scratch_pool));
}
@@ -590,7 +590,7 @@ open_root(void *edit_baton,
{
struct dump_edit_baton *eb = edit_baton;
struct dir_baton *new_db = NULL;
-
+
/* Clear the per-revision pool after each revision */
svn_pool_clear(eb->pool);
@@ -778,7 +778,7 @@ close_directory(void *dir_baton,
out (at some point in the past, prior to our handling other
nodes), we might need to generate a second "change" record just
to carry the information we've since learned about the
- directory. */
+ directory. */
if ((! this_pending) && (db->dump_props))
{
SVN_ERR(dump_node(db->eb, db->repos_relpath, db, NULL,
@@ -823,13 +823,13 @@ add_file(const char *path,
/* Make the file baton. */
fb = make_file_baton(path, pb, pool);
-
+
/* This might be a replacement -- is the path already deleted? */
val = svn_hash_gets(pb->deleted_entries, path);
/* Detect add-with-history. */
if (ARE_VALID_COPY_ARGS(copyfrom_path, copyfrom_rev))
- {
+ {
fb->copyfrom_path = svn_relpath_canonicalize(copyfrom_path, fb->pool);
fb->copyfrom_rev = copyfrom_rev;
fb->is_copy = TRUE;
@@ -883,7 +883,7 @@ change_dir_prop(void *parent_baton,
{
struct dir_baton *db = parent_baton;
svn_boolean_t this_pending;
-
+
LDR_DBG(("change_dir_prop %p\n", parent_baton));
/* This directory is not pending, but something else is, so handle
@@ -1000,7 +1000,7 @@ close_file(void *file_baton,
struct dump_edit_baton *eb = fb->eb;
apr_finfo_t *info = apr_pcalloc(pool, sizeof(apr_finfo_t));
svn_stringbuf_t *propstring;
-
+
LDR_DBG(("close_file %p\n", file_baton));
SVN_ERR(dump_pending(eb, pool));
Modified: subversion/branches/verify-keep-going/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svnrdump/load_editor.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svnrdump/load_editor.c (original)
+++ subversion/branches/verify-keep-going/subversion/svnrdump/load_editor.c Wed Jun 5 09:22:43 2013
@@ -853,7 +853,7 @@ set_revision_property(void *baton,
struct revision_baton *rb = baton;
SVN_ERR(svn_rdump__normalize_prop(name, &value, rb->pool));
-
+
SVN_ERR(svn_repos__validate_prop(name, value, rb->pool));
if (rb->rev > 0)
Modified: subversion/branches/verify-keep-going/subversion/svnrdump/svnrdump.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svnrdump/svnrdump.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svnrdump/svnrdump.c (original)
+++ subversion/branches/verify-keep-going/subversion/svnrdump/svnrdump.c Wed Jun 5 09:22:43 2013
@@ -378,7 +378,7 @@ init_client_context(svn_client_ctx_t **c
### server will allow it, or at least try to limit all its
### auxiliary GETs/PROPFINDs to happening (well-ordered) on a
### single server connection.
- ###
+ ###
### See http://subversion.tigris.org/issues/show_bug.cgi?id=4116.
*/
cfg_servers = svn_hash_gets(ctx->config, SVN_CONFIG_CATEGORY_SERVERS);
@@ -994,9 +994,6 @@ main(int argc, const char **argv)
"are mutually exclusive"));
return svn_cmdline_handle_exit_error(err, pool, "svnrdump: ");
}
- else
- non_interactive = !svn_cmdline__be_interactive(non_interactive,
- force_interactive);
if (opt_baton->help)
{
@@ -1080,14 +1077,14 @@ main(int argc, const char **argv)
}
}
- if (subcommand && strcmp(subcommand->name, "--version") == 0)
+ if (strcmp(subcommand->name, "--version") == 0)
{
SVNRDUMP_ERR(version(argv[0], opt_baton->quiet, pool));
svn_pool_destroy(pool);
exit(EXIT_SUCCESS);
}
- if (subcommand && strcmp(subcommand->name, "help") == 0)
+ if (strcmp(subcommand->name, "help") == 0)
{
SVNRDUMP_ERR(help_cmd(os, opt_baton, pool));
svn_pool_destroy(pool);
@@ -1128,6 +1125,22 @@ main(int argc, const char **argv)
opt_baton->url = svn_uri_canonicalize(repos_url, pool);
}
+ if (strcmp(subcommand->name, "load") == 0)
+ {
+ /*
+ * By default (no --*-interactive options given), the 'load' subcommand
+ * is interactive unless username and password were provided on the
+ * command line. This allows prompting for auth creds to work without
+ * requiring users to remember to use --force-interactive.
+ * See issue #3913, "svnrdump load is not working in interactive mode".
+ */
+ if (!non_interactive && !force_interactive)
+ force_interactive = (username == NULL || password == NULL);
+ }
+
+ non_interactive = !svn_cmdline__be_interactive(non_interactive,
+ force_interactive);
+
SVNRDUMP_ERR(init_client_context(&(opt_baton->ctx),
non_interactive,
username,
Modified: subversion/branches/verify-keep-going/subversion/svnserve/cyrus_auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svnserve/cyrus_auth.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svnserve/cyrus_auth.c (original)
+++ subversion/branches/verify-keep-going/subversion/svnserve/cyrus_auth.c Wed Jun 5 09:22:43 2013
@@ -38,6 +38,7 @@
#include "private/svn_atomic.h"
#include "private/ra_svn_sasl.h"
+#include "private/svn_ra_svn_private.h"
#include "server.h"
@@ -133,8 +134,8 @@ static svn_error_t *
fail_auth(svn_ra_svn_conn_t *conn, apr_pool_t *pool, sasl_conn_t *sasl_ctx)
{
const char *msg = sasl_errdetail(sasl_ctx);
- SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "w(c)", "failure", msg));
- return svn_ra_svn_flush(conn, pool);
+ SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w(c)", "failure", msg));
+ return svn_ra_svn__flush(conn, pool);
}
/* Like svn_ra_svn_write_cmd_failure, but also clears the given error
@@ -142,7 +143,7 @@ fail_auth(svn_ra_svn_conn_t *conn, apr_p
static svn_error_t *
write_failure(svn_ra_svn_conn_t *conn, apr_pool_t *pool, svn_error_t **err_p)
{
- svn_error_t *write_err = svn_ra_svn_write_cmd_failure(conn, pool, *err_p);
+ svn_error_t *write_err = svn_ra_svn__write_cmd_failure(conn, pool, *err_p);
svn_error_clear(*err_p);
*err_p = SVN_NO_ERROR;
return write_err;
@@ -155,7 +156,7 @@ fail_cmd(svn_ra_svn_conn_t *conn, apr_po
svn_error_t *err = svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
sasl_errdetail(sasl_ctx));
SVN_ERR(write_failure(conn, pool, &err));
- return svn_ra_svn_flush(conn, pool);
+ return svn_ra_svn__flush(conn, pool);
}
static svn_error_t *try_auth(svn_ra_svn_conn_t *conn,
@@ -173,7 +174,7 @@ static svn_error_t *try_auth(svn_ra_svn_
*success = FALSE;
/* Read the client's chosen mech and the initial token. */
- SVN_ERR(svn_ra_svn_read_tuple(conn, pool, "w(?s)", &mech, &in));
+ SVN_ERR(svn_ra_svn__read_tuple(conn, pool, "w(?s)", &mech, &in));
if (strcmp(mech, "EXTERNAL") == 0 && !in)
in = svn_string_create(b->tunnel_user, pool);
@@ -199,10 +200,10 @@ static svn_error_t *try_auth(svn_ra_svn_
if (use_base64)
arg = svn_base64_encode_string2(arg, TRUE, pool);
- SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "w(s)", "step", arg));
+ SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w(s)", "step", arg));
/* Read and decode the client response. */
- SVN_ERR(svn_ra_svn_read_item(conn, pool, &item));
+ SVN_ERR(svn_ra_svn__read_item(conn, pool, &item));
if (item->kind != SVN_RA_SVN_STRING)
return SVN_NO_ERROR;
@@ -223,7 +224,7 @@ static svn_error_t *try_auth(svn_ra_svn_
arg = NULL;
*success = TRUE;
- SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "w(?s)", "success", arg));
+ SVN_ERR(svn_ra_svn__write_tuple(conn, pool, "w(?s)", "success", arg));
return SVN_NO_ERROR;
}
@@ -258,7 +259,7 @@ svn_error_t *cyrus_auth_request(svn_ra_s
{
svn_error_t *err = svn_error_wrap_apr(apr_err, _("Can't get hostname"));
SVN_ERR(write_failure(conn, pool, &err));
- return svn_ra_svn_flush(conn, pool);
+ return svn_ra_svn__flush(conn, pool);
}
/* Create a SASL context. SASL_SUCCESS_DATA tells SASL that the protocol
@@ -273,7 +274,7 @@ svn_error_t *cyrus_auth_request(svn_ra_s
svn_error_t *err = svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
sasl_errstring(result, NULL, NULL));
SVN_ERR(write_failure(conn, pool, &err));
- return svn_ra_svn_flush(conn, pool);
+ return svn_ra_svn__flush(conn, pool);
}
/* Make sure the context is always destroyed. */
@@ -324,12 +325,12 @@ svn_error_t *cyrus_auth_request(svn_ra_s
_("Could not obtain the list"
" of SASL mechanisms"));
SVN_ERR(write_failure(conn, pool, &err));
- return svn_ra_svn_flush(conn, pool);
+ return svn_ra_svn__flush(conn, pool);
}
/* Send the list of mechanisms and the realm to the client. */
- SVN_ERR(svn_ra_svn_write_cmd_response(conn, pool, "(w)c",
- mechlist, b->realm));
+ SVN_ERR(svn_ra_svn__write_cmd_response(conn, pool, "(w)c",
+ mechlist, b->realm));
/* The main authentication loop. */
subpool = svn_pool_create(pool);
@@ -366,7 +367,7 @@ svn_error_t *cyrus_auth_request(svn_ra_s
_("Couldn't obtain the authenticated"
" username"));
SVN_ERR(write_failure(conn, pool, &err));
- return svn_ra_svn_flush(conn, pool);
+ return svn_ra_svn__flush(conn, pool);
}
}