You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/05/07 15:26:27 UTC
svn commit: r1479901 [6/7] - in /subversion/branches/wc-collate-path: ./
build/ac-macros/ build/generator/ build/generator/templates/
contrib/server-side/fsfsfixer/ contrib/server-side/fsfsfixer/fixer/
subversion/bindings/ctypes-python/ subversion/bind...
Modified: subversion/branches/wc-collate-path/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/cl.h?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/cl.h (original)
+++ subversion/branches/wc-collate-path/subversion/svn/cl.h Tue May 7 13:26:25 2013
@@ -158,7 +158,7 @@ typedef struct svn_cl__opt_state_t
/* Was --no-unlock specified? */
svn_boolean_t no_unlock;
- const char *message; /* log message */
+ const char *message; /* log message (not converted to UTF-8) */
svn_boolean_t force; /* be more forceful, as in "svn rm -f ..." */
svn_boolean_t force_log; /* force validity of a suspect log msg file */
svn_boolean_t incremental; /* yield output suitable for concatenation */
@@ -168,19 +168,22 @@ typedef struct svn_cl__opt_state_t
svn_boolean_t verbose; /* be verbose */
svn_boolean_t update; /* contact the server for the full story */
svn_boolean_t strict; /* do strictly what was requested */
- svn_stringbuf_t *filedata; /* contents of file used as option data */
- const char *encoding; /* the locale/encoding of the data*/
+ svn_stringbuf_t *filedata; /* contents of file used as option data
+ (not converted to UTF-8) */
+ const char *encoding; /* the locale/encoding of 'message' and of
+ 'filedata' (not converted to UTF-8) */
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! */
+ const char *auth_username; /* auth username */
+ const char *auth_password; /* auth password */
+ const char *extensions; /* subprocess extension args */
+ apr_array_header_t *targets; /* target list from file */
svn_boolean_t xml; /* output in xml, e.g., "svn log --xml" */
svn_boolean_t no_ignore; /* disregard default ignores & svn:ignore's */
svn_boolean_t no_auth_cache; /* do not cache authentication information */
struct
{
- const char *diff_cmd; /* the external diff command to use */
+ const char *diff_cmd; /* the external diff command to use
+ (not converted to UTF-8) */
svn_boolean_t internal_diff; /* override diff_cmd in config file */
svn_boolean_t no_diff_added; /* do not show diffs for deleted files */
svn_boolean_t no_diff_deleted; /* do not show diffs for deleted files */
@@ -197,8 +200,10 @@ typedef struct svn_cl__opt_state_t
svn_boolean_t stop_on_copy; /* don't cross copies during processing */
svn_boolean_t dry_run; /* try operation but make no changes */
svn_boolean_t revprop; /* operate on a revision property */
- const char *merge_cmd; /* the external merge command to use */
- const char *editor_cmd; /* the external editor command to use */
+ const char *merge_cmd; /* the external merge command to use
+ (not converted to UTF-8) */
+ const char *editor_cmd; /* the external editor command to use
+ (not converted to UTF-8) */
svn_boolean_t record_only; /* whether to record mergeinfo */
const char *old_target; /* diff target */
const char *new_target; /* diff target */
@@ -210,13 +215,12 @@ typedef struct svn_cl__opt_state_t
const char *native_eol; /* override system standard eol marker */
svn_boolean_t remove; /* deassociate a changelist */
apr_array_header_t *changelists; /* changelist filters */
- const char *changelist; /* operate on this changelist
- THIS IS TEMPORARY (LAST OF CHANGELISTS) */
svn_boolean_t keep_changelists;/* don't remove changelists after commit */
svn_boolean_t keep_local; /* delete path only from repository */
svn_boolean_t all_revprops; /* retrieve all revprops */
svn_boolean_t no_revprops; /* retrieve no revprops */
- apr_hash_t *revprop_table; /* table of revision properties to get/set */
+ apr_hash_t *revprop_table; /* table of revision properties to get/set
+ (not converted to UTF-8) */
svn_boolean_t parents; /* create intermediate directories */
svn_boolean_t use_merge_history; /* use/display extra merge information */
svn_cl__accept_t accept_which; /* how to handle conflicts */
@@ -331,6 +335,31 @@ svn_cl__check_cancel(void *baton);
typedef struct svn_cl__interactive_conflict_baton_t
svn_cl__interactive_conflict_baton_t;
+/* Conflict stats for operations such as update and merge. */
+typedef struct svn_cl__conflict_stats_t svn_cl__conflict_stats_t;
+
+/* Return a new, initialized, conflict stats structure, allocated in
+ * POOL. */
+svn_cl__conflict_stats_t *
+svn_cl__conflict_stats_create(apr_pool_t *pool);
+
+/* Update CONFLICT_STATS to reflect that a conflict on PATH_LOCAL of kind
+ * CONFLICT_KIND is resolved. (There is no support for updating the
+ * 'skipped paths' stats, since skips cannot be 'resolved'.) */
+void
+svn_cl__conflict_stats_resolved(svn_cl__conflict_stats_t *conflict_stats,
+ const char *path_local,
+ svn_wc_conflict_kind_t conflict_kind);
+
+/* Print the conflict stats accumulated in CONFLICT_STATS.
+ *
+ * Return any error encountered during printing.
+ * See also svn_cl__notifier_print_conflict_stats().
+ */
+svn_error_t *
+svn_cl__print_conflict_stats(svn_cl__conflict_stats_t *conflict_stats,
+ apr_pool_t *scratch_pool);
+
/* Create and return an baton for use with svn_cl__conflict_func_interactive
* in *B, allocated from RESULT_POOL, and initialised with the values
* ACCEPT_WHICH, CONFIG, EDITOR_CMD, CANCEL_FUNC and CANCEL_BATON. */
@@ -340,6 +369,7 @@ svn_cl__get_conflict_func_interactive_ba
svn_cl__accept_t accept_which,
apr_hash_t *config,
const char *editor_cmd,
+ svn_cl__conflict_stats_t *conflict_stats,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *result_pool);
@@ -516,6 +546,7 @@ svn_cl__merge_file(const char *base_path
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);
/* Make the notifier for use with BATON print the appropriate summary
@@ -551,21 +582,17 @@ svn_cl__check_externals_failed_notify_wr
const svn_wc_notify_t *n,
apr_pool_t *pool);
-/* Reset to zero the conflict stats accumulated in BATON, which is the
- * notifier baton from svn_cl__get_notifier().
- */
-svn_error_t *
-svn_cl__notifier_reset_conflict_stats(void *baton);
-
-/* Print the conflict stats accumulated in BATON, which is the
- * notifier baton from svn_cl__get_notifier().
+/* Print the conflict stats accumulated in BATON, which is the
+ * notifier baton from svn_cl__get_notifier(). This is just like
+ * calling svn_cl__print_conflict_stats().
+ *
* Return any error encountered during printing.
*/
svn_error_t *
svn_cl__notifier_print_conflict_stats(void *baton, apr_pool_t *scratch_pool);
-/*** Log message callback stuffs. ***/
+/*** Log message callback stuffs. ***/
/* Allocate in POOL a baton for use with svn_cl__get_log_message().
@@ -671,6 +698,17 @@ const char *
svn_cl__operation_str_human_readable(svn_wc_operation_t operation,
apr_pool_t *pool);
+
+/* What use is a property name intended for.
+ Used by svn_cl__check_svn_prop_name to customize error messages. */
+typedef enum svn_cl__prop_use_e
+ {
+ svn_cl__prop_use_set, /* setting the property */
+ svn_cl__prop_use_edit, /* editing the property */
+ svn_cl__prop_use_use /* using the property name */
+ }
+svn_cl__prop_use_t;
+
/* If PROPNAME looks like but is not identical to one of the svn:
* poperties, raise an error and suggest a better spelling. Names that
* raise errors look like this:
@@ -685,7 +723,9 @@ svn_cl__operation_str_human_readable(svn
* Use SCRATCH_POOL for temporary allocations.
*/
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);
/* If PROPNAME is one of the svn: properties with a boolean value, and
Modified: subversion/branches/wc-collate-path/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/conflict-callbacks.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/conflict-callbacks.c Tue May 7 13:26:25 2013
@@ -55,6 +55,8 @@ struct svn_cl__interactive_conflict_bato
svn_cmdline_prompt_baton_t *pb;
const char *path_prefix;
svn_boolean_t quit;
+ svn_cl__conflict_stats_t *conflict_stats;
+ svn_boolean_t printed_summary;
};
svn_error_t *
@@ -63,6 +65,7 @@ svn_cl__get_conflict_func_interactive_ba
svn_cl__accept_t accept_which,
apr_hash_t *config,
const char *editor_cmd,
+ svn_cl__conflict_stats_t *conflict_stats,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *result_pool)
@@ -79,6 +82,8 @@ svn_cl__get_conflict_func_interactive_ba
(*b)->pb = pb;
SVN_ERR(svn_dirent_get_absolute(&(*b)->path_prefix, "", result_pool));
(*b)->quit = FALSE;
+ (*b)->conflict_stats = conflict_stats;
+ (*b)->printed_summary = FALSE;
return SVN_NO_ERROR;
}
@@ -149,36 +154,33 @@ show_diff(const svn_wc_conflict_descript
if (desc->operation == svn_wc_operation_merge)
{
path1 = desc->my_abspath;
- label1 = apr_psprintf(pool, _("MINE - %s"),
- svn_cl__local_style_skip_ancestor(
- path_prefix, path1, pool));
+ label1 = _("MINE");
}
else
{
path1 = desc->their_abspath;
- label1 = apr_psprintf(pool, _("THEIRS - %s"),
- svn_cl__local_style_skip_ancestor(
- path_prefix, path1, pool));
+ label1 = _("THEIRS");
}
path2 = desc->merged_file;
- label2 = apr_psprintf(pool, _("MERGED - %s"),
- svn_cl__local_style_skip_ancestor(
- path_prefix, path2, pool));
+ label2 = _("MERGED");
}
else
{
/* There's no merged file, but we can show the
difference between mine and theirs. */
path1 = desc->their_abspath;
- label1 = apr_psprintf(pool, _("THEIRS - %s"),
- svn_cl__local_style_skip_ancestor(
- path_prefix, path1, pool));
+ label1 = _("THEIRS");
path2 = desc->my_abspath;
- label2 = apr_psprintf(pool, _("MINE - %s"),
- svn_cl__local_style_skip_ancestor(
- path_prefix, path2, pool));
+ label2 = _("MINE");
}
+ label1 = apr_psprintf(pool, "%s\t- %s",
+ svn_cl__local_style_skip_ancestor(
+ path_prefix, path1, pool), label1);
+ label2 = apr_psprintf(pool, "%s\t- %s",
+ svn_cl__local_style_skip_ancestor(
+ path_prefix, path2, pool), label2);
+
options = svn_diff_file_options_create(pool);
options->ignore_eol_style = TRUE;
SVN_ERR(svn_stream_for_stdout(&output, pool));
@@ -1067,12 +1069,13 @@ handle_obstructed_add(svn_wc_conflict_re
return SVN_NO_ERROR;
}
-svn_error_t *
-svn_cl__conflict_func_interactive(svn_wc_conflict_result_t **result,
- const svn_wc_conflict_description2_t *desc,
- void *baton,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
+/* The body of svn_cl__conflict_func_interactive(). */
+static svn_error_t *
+conflict_func_interactive(svn_wc_conflict_result_t **result,
+ const svn_wc_conflict_description2_t *desc,
+ void *baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_cl__interactive_conflict_baton_t *b = baton;
svn_error_t *err;
@@ -1200,6 +1203,13 @@ svn_cl__conflict_func_interactive(svn_wc
break;
}
+ /* Print a summary of conflicts before starting interactive resolution */
+ if (! b->printed_summary)
+ {
+ SVN_ERR(svn_cl__print_conflict_stats(b->conflict_stats, scratch_pool));
+ b->printed_summary = TRUE;
+ }
+
/* We're in interactive mode and either the user gave no --accept
option or the option did not apply; let's prompt. */
@@ -1208,7 +1218,7 @@ svn_cl__conflict_func_interactive(svn_wc
Conflicting edits on a file's text, or
Conflicting edits on a property.
*/
- if (((desc->node_kind == svn_node_file)
+ if (((desc->kind == svn_wc_conflict_kind_text)
&& (desc->action == svn_wc_conflict_action_edit)
&& (desc->reason == svn_wc_conflict_reason_edited)))
SVN_ERR(handle_text_conflict(*result, desc, b, scratch_pool));
@@ -1247,3 +1257,28 @@ svn_cl__conflict_func_interactive(svn_wc
return SVN_NO_ERROR;
}
+
+svn_error_t *
+svn_cl__conflict_func_interactive(svn_wc_conflict_result_t **result,
+ const svn_wc_conflict_description2_t *desc,
+ void *baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_cl__interactive_conflict_baton_t *b = baton;
+
+ SVN_ERR(conflict_func_interactive(result, desc, baton,
+ result_pool, scratch_pool));
+
+ /* If we are resolving a conflict, adjust the summary of conflicts. */
+ if ((*result)->choice != svn_wc_conflict_choose_postpone)
+ {
+ const char *local_path
+ = svn_cl__local_style_skip_ancestor(
+ b->path_prefix, desc->local_abspath, scratch_pool);
+
+ svn_cl__conflict_stats_resolved(b->conflict_stats, local_path,
+ desc->kind);
+ }
+ return SVN_NO_ERROR;
+}
Modified: subversion/branches/wc-collate-path/subversion/svn/diff-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/diff-cmd.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/diff-cmd.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/diff-cmd.c Tue May 7 13:26:25 2013
@@ -37,6 +37,7 @@
#include "svn_types.h"
#include "svn_cmdline.h"
#include "svn_xml.h"
+#include "svn_hash.h"
#include "cl.h"
#include "svn_private_config.h"
@@ -179,6 +180,7 @@ svn_cl__diff(apr_getopt_t *os,
const char *old_target, *new_target;
apr_pool_t *iterpool;
svn_boolean_t pegged_diff = FALSE;
+ svn_boolean_t ignore_content_type;
svn_boolean_t show_copies_as_adds =
opt_state->diff.patch_compatible || opt_state->diff.show_copies_as_adds;
svn_boolean_t ignore_properties =
@@ -337,6 +339,21 @@ svn_cl__diff(apr_getopt_t *os,
}
+ /* Should we ignore the content-type when deciding what to diff? */
+ if (opt_state->force)
+ {
+ ignore_content_type = TRUE;
+ }
+ else
+ {
+ SVN_ERR(svn_config_get_bool(svn_hash_gets(ctx->config,
+ SVN_CONFIG_CATEGORY_CONFIG),
+ &ignore_content_type,
+ SVN_CONFIG_SECTION_MISCELLANY,
+ SVN_CONFIG_OPTION_DIFF_IGNORE_CONTENT_TYPE,
+ FALSE));
+ }
+
svn_opt_push_implicit_dot_target(targets, pool);
iterpool = svn_pool_create(pool);
@@ -399,7 +416,7 @@ svn_cl__diff(apr_getopt_t *os,
opt_state->diff.no_diff_added,
opt_state->diff.no_diff_deleted,
show_copies_as_adds,
- opt_state->force,
+ ignore_content_type,
ignore_properties,
opt_state->diff.properties_only,
opt_state->diff.use_git_diff_format,
@@ -450,7 +467,7 @@ svn_cl__diff(apr_getopt_t *os,
opt_state->diff.no_diff_added,
opt_state->diff.no_diff_deleted,
show_copies_as_adds,
- opt_state->force,
+ ignore_content_type,
ignore_properties,
opt_state->diff.properties_only,
opt_state->diff.use_git_diff_format,
Modified: subversion/branches/wc-collate-path/subversion/svn/log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/log-cmd.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/log-cmd.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/log-cmd.c Tue May 7 13:26:25 2013
@@ -159,7 +159,7 @@ match_search_pattern(const char *search_
{
/* Match any substring containing the pattern, like UNIX 'grep' does. */
const char *pattern = apr_psprintf(pool, "*%s*", search_pattern);
- int flags = APR_FNM_CASE_BLIND;
+ int flags = 0;
/* Does the author match the search pattern? */
if (author && apr_fnmatch(pattern, author, flags) == APR_SUCCESS)
Modified: subversion/branches/wc-collate-path/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/notify.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/notify.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/notify.c Tue May 7 13:26:25 2013
@@ -56,37 +56,74 @@ 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;
-
- 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;
+ 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;
+ }
}
static const char *
@@ -108,20 +145,20 @@ resolved_str(apr_pool_t *pool, int n_res
}
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")));
@@ -158,11 +195,20 @@ svn_cl__notifier_print_conflict_stats(vo
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;
}
@@ -191,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
@@ -214,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)))
@@ -284,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;
}
@@ -299,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
@@ -307,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)
@@ -337,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)))
@@ -390,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)
@@ -403,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)
@@ -602,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)
@@ -615,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)
@@ -992,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;
@@ -1140,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));
@@ -1151,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/wc-collate-path/subversion/svn/propedit-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/propedit-cmd.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/propedit-cmd.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/propedit-cmd.c Tue May 7 13:26:25 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/wc-collate-path/subversion/svn/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/props.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/props.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/props.c Tue May 7 13:26:25 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/wc-collate-path/subversion/svn/propset-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/propset-cmd.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/propset-cmd.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/propset-cmd.c Tue May 7 13:26:25 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/wc-collate-path/subversion/svn/resolve-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/resolve-cmd.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/resolve-cmd.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/resolve-cmd.c Tue May 7 13:26:25 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/wc-collate-path/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/svn.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/svn.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/svn.c Tue May 7 13:26:25 2013
@@ -1722,13 +1722,15 @@ 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;
@@ -1796,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,
@@ -1812,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)
{
@@ -1916,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'"),
@@ -1944,20 +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));
reading_file_from_stdin = (strcmp(utf8_opt_arg, "-") == 0);
- dash_F_arg = opt_arg;
+ 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));
@@ -2107,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)
@@ -2125,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;
@@ -2136,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'"),
@@ -2159,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;
@@ -2193,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)
@@ -2262,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. */
@@ -2444,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.)
@@ -2661,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)
@@ -2758,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. */
@@ -2854,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;
}
Modified: subversion/branches/wc-collate-path/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svn/util.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svn/util.c (original)
+++ subversion/branches/wc-collate-path/subversion/svn/util.c Tue May 7 13:26:25 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);
Modified: subversion/branches/wc-collate-path/subversion/svnadmin/svnadmin.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svnadmin/svnadmin.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svnadmin/svnadmin.c (original)
+++ subversion/branches/wc-collate-path/subversion/svnadmin/svnadmin.c Tue May 7 13:26:25 2013
@@ -155,6 +155,7 @@ static svn_opt_subcommand_t
subcommand_freeze,
subcommand_help,
subcommand_hotcopy,
+ subcommand_info,
subcommand_load,
subcommand_list_dblogs,
subcommand_list_unused_dblogs,
@@ -232,7 +233,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")},
@@ -358,11 +359,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"
@@ -461,7 +467,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} },
@@ -481,7 +487,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', 'M'} },
{ NULL, NULL, {0}, NULL, {0} }
@@ -1537,7 +1543,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,
@@ -1598,7 +1604,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_repos_verify_fs2(repos, lower, upper,
!opt_state->quiet
@@ -1624,6 +1630,111 @@ 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;
+
+ /* 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, fs_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));
+ SVN_ERR(svn_cmdline_printf(pool, _("Filesystem Format: %d\n"),
+ fs_format));
+
+ 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;
+ char *as_string;
+
+ SVN_ERR(svn_repos_capabilities(&capabilities_set, repos, pool, pool));
+ SVN_ERR(svn_hash_keys(&capabilities, capabilities_set, pool));
+ as_string = svn_cstring_join(capabilities, ",", pool);
+
+ /* Delete the trailing comma. */
+ if (as_string[0])
+ as_string[strlen(as_string)-1] = '\0';
+
+ if (capabilities->nelts)
+ SVN_ERR(svn_cmdline_printf(pool, _("Repository Capabilities: %s\n"),
+ as_string));
+ }
+
+ {
+ 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));
+ 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));
+
+ if (fsfs_info->min_unpacked_rev + fsfs_info->shard_size > youngest + 1)
+ SVN_ERR(svn_cmdline_printf(pool, _("FSFS Packed: yes\n")));
+ else if (fsfs_info->min_unpacked_rev)
+ SVN_ERR(svn_cmdline_printf(pool, _("FSFS Packed: partly\n")));
+ else
+ SVN_ERR(svn_cmdline_printf(pool, _("FSFS Packed: no\n")));
+ }
+ }
+
+ {
+ 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"),
+ APR_ARRAY_IDX(files, i, const char *)));
+ }
+
+ /* '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/wc-collate-path/subversion/svnlook/svnlook.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svnlook/svnlook.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svnlook/svnlook.c (original)
+++ subversion/branches/wc-collate-path/subversion/svnlook/svnlook.c Tue May 7 13:26:25 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"
@@ -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/wc-collate-path/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svnserve/serve.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svnserve/serve.c (original)
+++ subversion/branches/wc-collate-path/subversion/svnserve/serve.c Tue May 7 13:26:25 2013
@@ -276,7 +276,8 @@ svn_error_t *load_pwdb_config(server_bat
pwdb_path = svn_dirent_internal_style(pwdb_path, pool);
pwdb_path = svn_dirent_join(server->base, pwdb_path, pool);
- err = svn_config_read2(&server->pwdb, pwdb_path, TRUE, FALSE, pool);
+ err = svn_config_read3(&server->pwdb, pwdb_path, TRUE,
+ FALSE, FALSE, pool);
if (err)
{
log_server_error(err, server, conn, pool);
@@ -1814,15 +1815,15 @@ static svn_error_t *update(svn_ra_svn_co
svn_revnum_t rev;
const char *target, *full_path, *depth_word;
svn_boolean_t recurse;
- apr_uint64_t send_copyfrom_args; /* Optional; default FALSE */
- apr_uint64_t ignore_ancestry; /* Optional; default FALSE */
+ svn_tristate_t send_copyfrom_args; /* Optional; default FALSE */
+ svn_tristate_t ignore_ancestry; /* Optional; default FALSE */
/* Default to unknown. Old clients won't send depth, but we'll
handle that by converting recurse if necessary. */
svn_depth_t depth = svn_depth_unknown;
svn_boolean_t is_checkout;
/* Parse the arguments. */
- SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "(?r)cb?wB?B", &rev, &target,
+ SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "(?r)cb?w3?3", &rev, &target,
&recurse, &depth_word,
&send_copyfrom_args, &ignore_ancestry));
target = svn_relpath_canonicalize(target, pool);
@@ -1842,8 +1843,8 @@ static svn_error_t *update(svn_ra_svn_co
SVN_ERR(accept_report(&is_checkout, NULL,
conn, pool, b, rev, target, NULL, TRUE,
depth,
- (send_copyfrom_args == TRUE) /* send_copyfrom_args */,
- (ignore_ancestry == TRUE) /* ignore_ancestry */));
+ (send_copyfrom_args == svn_tristate_true),
+ (ignore_ancestry == svn_tristate_true)));
if (is_checkout)
{
SVN_ERR(log_command(b, conn, pool, "%s",
@@ -1854,7 +1855,9 @@ static svn_error_t *update(svn_ra_svn_co
{
SVN_ERR(log_command(b, conn, pool, "%s",
svn_log__update(full_path, rev, depth,
- send_copyfrom_args, pool)));
+ (send_copyfrom_args
+ == svn_tristate_true),
+ pool)));
}
return SVN_NO_ERROR;
@@ -1871,11 +1874,11 @@ static svn_error_t *switch_cmd(svn_ra_sv
/* Default to unknown. Old clients won't send depth, but we'll
handle that by converting recurse if necessary. */
svn_depth_t depth = svn_depth_unknown;
- apr_uint64_t send_copyfrom_args; /* Optional; default FALSE */
- apr_uint64_t ignore_ancestry; /* Optional; default TRUE */
+ svn_tristate_t send_copyfrom_args; /* Optional; default FALSE */
+ svn_tristate_t ignore_ancestry; /* Optional; default TRUE */
/* Parse the arguments. */
- SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "(?r)cbc?w?BB", &rev, &target,
+ SVN_ERR(svn_ra_svn__parse_tuple(params, pool, "(?r)cbc?w?33", &rev, &target,
&recurse, &switch_url, &depth_word,
&send_copyfrom_args, &ignore_ancestry));
target = svn_relpath_canonicalize(target, pool);
@@ -1904,8 +1907,8 @@ static svn_error_t *switch_cmd(svn_ra_sv
return accept_report(NULL, NULL,
conn, pool, b, rev, target, switch_path, TRUE,
depth,
- (send_copyfrom_args == TRUE) /* send_copyfrom_args */,
- (ignore_ancestry != FALSE) /* ignore_ancestry */);
+ (send_copyfrom_args == svn_tristate_true),
+ (ignore_ancestry != svn_tristate_false));
}
static svn_error_t *status(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
@@ -3286,9 +3289,10 @@ static svn_error_t *find_repos(const cha
{
b->base = svn_repos_conf_dir(b->repos, pool);
- SVN_ERR(svn_config_read2(&b->cfg, svn_repos_svnserve_conf(b->repos, pool),
+ SVN_ERR(svn_config_read3(&b->cfg, svn_repos_svnserve_conf(b->repos, pool),
FALSE, /* must_exist */
FALSE, /* section_names_case_sensitive */
+ FALSE, /* option_names_case_sensitive */
pool));
SVN_ERR(load_pwdb_config(b, conn, pool));
SVN_ERR(load_authz_config(b, conn, repos_root, pool));
Modified: subversion/branches/wc-collate-path/subversion/svnserve/svnserve.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/svnserve/svnserve.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/svnserve/svnserve.c (original)
+++ subversion/branches/wc-collate-path/subversion/svnserve/svnserve.c Tue May 7 13:26:25 2013
@@ -755,9 +755,10 @@ int main(int argc, const char *argv[])
{
params.base = svn_dirent_dirname(config_filename, pool);
- SVN_INT_ERR(svn_config_read2(¶ms.cfg, config_filename,
+ SVN_INT_ERR(svn_config_read3(¶ms.cfg, config_filename,
TRUE, /* must_exist */
FALSE, /* section_names_case_sensitive */
+ FALSE, /* option_names_case_sensitive */
pool));
}
Modified: subversion/branches/wc-collate-path/subversion/tests/cmdline/authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/cmdline/authz_tests.py?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/cmdline/authz_tests.py (original)
+++ subversion/branches/wc-collate-path/subversion/tests/cmdline/authz_tests.py Tue May 7 13:26:25 2013
@@ -576,7 +576,8 @@ def authz_log_and_tracing_test(sbox):
if sbox.repo_url.startswith('http'):
expected_err2 = expected_err
else:
- expected_err2 = ".*svn: E220001: Item is not readable.*"
+ expected_err2 = ".*svn: E220001: Unreadable path encountered; " \
+ "access denied.*"
# if we do the same thing directly on the unreadable file, we get:
# svn: Item is not readable
Modified: subversion/branches/wc-collate-path/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/cmdline/diff_tests.py?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/wc-collate-path/subversion/tests/cmdline/diff_tests.py Tue May 7 13:26:25 2013
@@ -1899,7 +1899,7 @@ def diff_keywords(sbox):
def diff_force(sbox):
- "show diffs for binary files with --force"
+ "show diffs for binary files"
sbox.build()
wc_dir = sbox.wc_dir
@@ -1943,34 +1943,20 @@ def diff_force(sbox):
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
- # Check that we get diff when the first, the second and both files are
- # marked as binary.
+ # Check that we get diff when the first, the second and both files
+ # are marked as binary. First we'll use --force. Then we'll use
+ # the configuration option 'diff-ignore-content-type'.
re_nodisplay = re.compile('^Cannot display:')
- exit_code, stdout, stderr = svntest.main.run_svn(None,
- 'diff', '-r1:2', iota_path,
- '--force')
-
- for line in stdout:
- if (re_nodisplay.match(line)):
- raise svntest.Failure
-
- exit_code, stdout, stderr = svntest.main.run_svn(None,
- 'diff', '-r2:1', iota_path,
- '--force')
-
- for line in stdout:
- if (re_nodisplay.match(line)):
- raise svntest.Failure
-
- exit_code, stdout, stderr = svntest.main.run_svn(None,
- 'diff', '-r2:3', iota_path,
- '--force')
-
- for line in stdout:
- if (re_nodisplay.match(line)):
- raise svntest.Failure
+ for opt in ['--force',
+ '--config-option=config:miscellany:diff-ignore-content-type=yes']:
+ for range in ['-r1:2', '-r2:1', '-r2:3']:
+ exit_code, stdout, stderr = svntest.main.run_svn(None, 'diff', range,
+ iota_path, opt)
+ for line in stdout:
+ if (re_nodisplay.match(line)):
+ raise svntest.Failure
#----------------------------------------------------------------------
# Regression test for issue #2333: Renaming a directory should produce
Modified: subversion/branches/wc-collate-path/subversion/tests/cmdline/log_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/cmdline/log_tests.py?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/cmdline/log_tests.py (original)
+++ subversion/branches/wc-collate-path/subversion/tests/cmdline/log_tests.py Tue May 7 13:26:25 2013
@@ -2296,13 +2296,13 @@ def log_search(sbox):
log_chain = parse_log_output(output)
check_log_chain(log_chain, [7, 6, 3])
- # search is case-insensitive
+ # search is case-sensitive
exit_code, output, err = svntest.actions.run_and_verify_svn(
None, None, [], 'log', '--search',
'FOR REVISION [367]')
log_chain = parse_log_output(output)
- check_log_chain(log_chain, [7, 6, 3])
+ check_log_chain(log_chain, [])
# multi-pattern search
exit_code, output, err = svntest.actions.run_and_verify_svn(
@@ -2369,7 +2369,6 @@ def merge_sensitive_log_with_search(sbox
# Test for issue #4355 'svn_client_log5 broken with multiple revisions
# which span a rename'.
@Issue(4355)
-@XFail()
@SkipUnless(server_has_mergeinfo)
def log_multiple_revs_spanning_rename(sbox):
"log for multiple revs which span a rename"
@@ -2380,6 +2379,7 @@ def log_multiple_revs_spanning_rename(sb
msg_file=os.path.abspath(msg_file)
mu_path1 = os.path.join(wc_dir, 'A', 'mu')
mu_path2 = os.path.join(wc_dir, 'trunk', 'mu')
+ trunk_path = os.path.join(wc_dir, 'trunk')
# r2 - Change a file.
msg=""" Log message for revision 2
@@ -2402,6 +2402,7 @@ def log_multiple_revs_spanning_rename(sb
svntest.main.file_write(msg_file, msg)
svntest.main.file_append(mu_path2, "4")
svntest.main.run_svn(None, 'ci', '-F', msg_file, wc_dir)
+ svntest.main.run_svn(None, 'up', wc_dir)
# Check that log can handle a revision range that spans a rename.
exit_code, output, err = svntest.actions.run_and_verify_svn(
@@ -2451,11 +2452,12 @@ def log_multiple_revs_spanning_rename(sb
# Discreet revision *ranges* which span a rename should work too.
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '-r1:1', '-r4:2', sbox.repo_url + '/trunk')
+ None, None, [], 'log', '-r1', '-r4:2', sbox.repo_url + '/trunk')
log_chain = parse_log_output(output)
check_log_chain(log_chain, [1,4,3,2])
- # As above, but revision ranges from younger to older revs fail:
+ # As above, but revision ranges from younger to older. Previously this
+ # failed with:
#
# >svn log ^/trunk -r1:1 -r2:4
# ------------------------------------------------------------------------
@@ -2471,10 +2473,26 @@ def log_multiple_revs_spanning_rename(sb
# (apr_err=SVN_ERR_FS_NOT_FOUND)
# svn: E160013: File not found: revision 4, path '/A'
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '-r1:1', '-r2:4', sbox.repo_url + '/trunk')
+ None, None, [], 'log', '-r1', '-r2:4', sbox.repo_url + '/trunk')
log_chain = parse_log_output(output)
check_log_chain(log_chain, [1,2,3,4])
+ # Discrete revs with WC-only opt revs shouldn't cause any problems.
+ exit_code, output, err = svntest.actions.run_and_verify_svn(
+ None, None, [], 'log', '-r1', '-rPREV', trunk_path)
+ log_chain = parse_log_output(output)
+ check_log_chain(log_chain, [1,3])
+
+ exit_code, output, err = svntest.actions.run_and_verify_svn(
+ None, None, [], 'log', '-r1', '-rCOMMITTED', trunk_path)
+ log_chain = parse_log_output(output)
+ check_log_chain(log_chain, [1,4])
+
+ exit_code, output, err = svntest.actions.run_and_verify_svn(
+ None, None, [], 'log', '-r1', '-rBASE', trunk_path)
+ log_chain = parse_log_output(output)
+ check_log_chain(log_chain, [1,4])
+
########################################################################
# Run the tests
Modified: subversion/branches/wc-collate-path/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/cmdline/svnadmin_tests.py?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/wc-collate-path/subversion/tests/cmdline/svnadmin_tests.py Tue May 7 13:26:25 2013
@@ -548,6 +548,8 @@ def verify_windows_paths_in_repos(sbox):
exit_code, output, errput = svntest.main.run_svnadmin("verify",
sbox.repo_dir)
+ if errput:
+ raise SVNUnexpectedStderr(errput)
# unfortunately, FSFS needs to do more checks than BDB resulting in
# different progress output
@@ -557,13 +559,13 @@ def verify_windows_paths_in_repos(sbox):
'STDERR', ["* Verifying repository metadata ...\n",
"* Verified revision 0.\n",
"* Verified revision 1.\n",
- "* Verified revision 2.\n"], errput)
+ "* Verified revision 2.\n"], output)
else:
svntest.verify.compare_and_display_lines(
"Error while running 'svnadmin verify'.",
'STDERR', ["* Verified revision 0.\n",
"* Verified revision 1.\n",
- "* Verified revision 2.\n"], errput)
+ "* Verified revision 2.\n"], output)
#----------------------------------------------------------------------
@@ -1062,8 +1064,10 @@ def verify_with_invalid_revprops(sbox):
exit_code, output, errput = svntest.main.run_svnadmin("verify",
sbox.repo_dir)
+ if errput:
+ raise SVNUnexpectedStderr(errput)
if svntest.verify.verify_outputs(
- "Output of 'svnadmin verify' is unexpected.", None, errput, None,
+ "Output of 'svnadmin verify' is unexpected.", None, output, None,
".*Verified revision 0*"):
raise svntest.Failure
@@ -1621,7 +1625,8 @@ def hotcopy_incremental_packed(sbox):
# Pack revisions 0 and 1.
svntest.actions.run_and_verify_svnadmin(
- None, None, [], "pack", os.path.join(cwd, sbox.repo_dir))
+ None, ['Packing revisions in shard 0...done.\n'], [], "pack",
+ os.path.join(cwd, sbox.repo_dir))
# Commit 5 more revs, hotcopy and pack after each commit.
for i in [1, 2, 3, 4, 5]:
@@ -1637,8 +1642,12 @@ def hotcopy_incremental_packed(sbox):
if i < 5:
sbox.simple_mkdir("newdir-%i" % i)
sbox.simple_commit()
+ if not i % 2:
+ expected_output = ['Packing revisions in shard %d...done.\n' % (i/2)]
+ else:
+ expected_output = []
svntest.actions.run_and_verify_svnadmin(
- None, None, [], "pack", os.path.join(cwd, sbox.repo_dir))
+ None, expected_output, [], "pack", os.path.join(cwd, sbox.repo_dir))
def locking(sbox):
Modified: subversion/branches/wc-collate-path/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/cmdline/upgrade_tests.py?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/branches/wc-collate-path/subversion/tests/cmdline/upgrade_tests.py Tue May 7 13:26:25 2013
@@ -1278,6 +1278,136 @@ def upgrade_from_1_7_conflict(sbox):
# a working copy used to cause a pointless 'upgrade required' error.
svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
+def do_iprops_upgrade(nonrootfile, rootfile, sbox):
+
+ wc_dir = sbox.wc_dir
+
+ replace_sbox_with_tarfile(sbox, nonrootfile)
+ svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
+ svntest.actions.run_and_verify_svn(None, None, [], 'relocate',
+ 'file:///tmp/repo', sbox.repo_url, wc_dir)
+
+ expected_output = []
+ expected_disk = svntest.wc.State('', {
+ 'E' : Item(),
+ 'E/alpha' : Item(contents="This is the file 'alpha'.\n"),
+ 'E/beta' : Item(contents="This is the file 'beta'.\n"),
+ 'F' : Item(),
+ 'lambda' : Item(contents="This is the file 'lambda'.\n"),
+ })
+ expected_status = svntest.wc.State(sbox.wc_dir, {
+ '' : Item(),
+ 'E' : Item(switched='S'),
+ 'E/alpha' : Item(),
+ 'E/beta' : Item(),
+ 'F' : Item(),
+ 'lambda' : Item(),
+ })
+ expected_status.tweak(status=' ', wc_rev=2)
+
+ # No inherited props after upgrade until an update
+ expected_iprops = {}
+ expected_explicit_props = {}
+ svntest.actions.run_and_verify_inherited_prop_xml(
+ wc_dir, expected_iprops, expected_explicit_props)
+ svntest.actions.run_and_verify_inherited_prop_xml(
+ sbox.ospath('E'), expected_iprops, expected_explicit_props)
+
+ # Update populates the inherited props
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output,
+ expected_disk,
+ expected_status)
+
+ expected_iprops = {sbox.repo_url : {'p' : 'v'},
+ sbox.repo_url + '/A' : {'pA' : 'vA'}}
+ svntest.actions.run_and_verify_inherited_prop_xml(
+ wc_dir, expected_iprops, expected_explicit_props)
+
+ expected_iprops = {sbox.repo_url : {'p' : 'v'},
+ sbox.repo_url + '/X' : {'pX' : 'vX'}}
+ svntest.actions.run_and_verify_inherited_prop_xml(
+ sbox.ospath('E'), expected_iprops, expected_explicit_props)
+
+ # Now try with a repository root working copy
+ replace_sbox_with_tarfile(sbox, rootfile)
+ svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
+ svntest.actions.run_and_verify_svn(None, None, [], 'relocate',
+ 'file:///tmp/repo', sbox.repo_url, wc_dir)
+
+ # Unswitched inherited props available after upgrade
+ expected_iprops = {wc_dir : {'p' : 'v'},
+ sbox.ospath('A') : {'pA' : 'vA'}}
+ svntest.actions.run_and_verify_inherited_prop_xml(
+ sbox.ospath('A/B'), expected_iprops, expected_explicit_props)
+
+ # Switched inherited props not populated until update after upgrade
+ expected_iprops = {}
+ svntest.actions.run_and_verify_inherited_prop_xml(
+ sbox.ospath('A/B/E'), expected_iprops, expected_explicit_props)
+
+ expected_disk = svntest.wc.State('', {
+ 'A' : Item(),
+ 'A/B' : Item(),
+ 'A/B/E' : Item(),
+ })
+ expected_status = svntest.wc.State(sbox.wc_dir, {
+ '' : Item(),
+ 'A' : Item(),
+ 'A/B' : Item(),
+ 'A/B/E' : Item(switched='S'),
+ })
+ expected_status.tweak(status=' ', wc_rev=2)
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output,
+ expected_disk,
+ expected_status)
+
+ expected_iprops = {wc_dir : {'p' : 'v'},
+ sbox.ospath('A') : {'pA' : 'vA'}}
+ svntest.actions.run_and_verify_inherited_prop_xml(
+ sbox.ospath('A/B'), expected_iprops, expected_explicit_props)
+
+ expected_iprops = {sbox.repo_url : {'p' : 'v'},
+ sbox.repo_url + '/X' : {'pX' : 'vX'}}
+ expected_explicit_props = {}
+ svntest.actions.run_and_verify_inherited_prop_xml(
+ sbox.ospath('A/B/E'), expected_iprops, expected_explicit_props)
+
+def iprops_upgrade(sbox):
+ "inherited properties after upgrade from 1.7"
+
+ sbox.build()
+
+ sbox.simple_copy('A', 'X')
+ sbox.simple_propset('p', 'v', '')
+ sbox.simple_propset('pA', 'vA', 'A')
+ sbox.simple_propset('pX', 'vX', 'X')
+ sbox.simple_commit()
+ svntest.main.run_svnadmin('setuuid', sbox.repo_dir,
+ '8f4d0ebe-2ebf-4f62-ad11-804fd88c2382')
+
+ do_iprops_upgrade('iprops_upgrade_nonroot.tar.bz2',
+ 'iprops_upgrade_root.tar.bz2',
+ sbox)
+
+def iprops_upgrade1_6(sbox):
+ "inherited properties after upgrade from 1.6"
+
+ sbox.build()
+
+ sbox.simple_copy('A', 'X')
+ sbox.simple_propset('p', 'v', '')
+ sbox.simple_propset('pA', 'vA', 'A')
+ sbox.simple_propset('pX', 'vX', 'X')
+ sbox.simple_commit()
+ svntest.main.run_svnadmin('setuuid', sbox.repo_dir,
+ '8f4d0ebe-2ebf-4f62-ad11-804fd88c2382')
+
+ do_iprops_upgrade('iprops_upgrade_nonroot1_6.tar.bz2',
+ 'iprops_upgrade_root1_6.tar.bz2',
+ sbox)
+
########################################################################
# Run the tests
@@ -1330,6 +1460,8 @@ test_list = [ None,
upgrade_missing_replaced,
upgrade_not_present_replaced,
upgrade_from_1_7_conflict,
+ iprops_upgrade,
+ iprops_upgrade1_6,
]
Modified: subversion/branches/wc-collate-path/subversion/tests/libsvn_delta/random-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/tests/libsvn_delta/random-test.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/tests/libsvn_delta/random-test.c (original)
+++ subversion/branches/wc-collate-path/subversion/tests/libsvn_delta/random-test.c Tue May 7 13:26:25 2013
@@ -500,6 +500,8 @@ random_combine_test(apr_pool_t *pool)
{
apr_uint32_t seed;
svn_error_t *err = do_random_combine_test(pool, &seed);
+ if (err)
+ fprintf(stderr, "SEED: %lu\n", (unsigned long)seed);
return err;
}