You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2012/07/11 12:26:26 UTC
svn commit: r1360103 [16/18] - in /subversion/branches/ev2-export: ./ build/
build/ac-macros/ build/generator/ build/generator/templates/ build/win32/
contrib/server-side/ notes/wc-ng/ subversion/bindings/javahl/native/
subversion/bindings/javahl/src/o...
Modified: subversion/branches/ev2-export/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/cl.h?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/cl.h (original)
+++ subversion/branches/ev2-export/subversion/svn/cl.h Wed Jul 11 10:26:19 2012
@@ -237,6 +237,11 @@ typedef struct svn_cl__opt_state_t
svn_boolean_t show_diff; /* produce diff output (maps to --diff) */
svn_boolean_t allow_mixed_rev; /* Allow operation on mixed-revision WC */
svn_boolean_t include_externals; /* Recurses (in)to file & dir externals */
+ const char *search_pattern; /* pattern argument for --search */
+ svn_boolean_t case_insensitive_search; /* perform case-insensitive search */
+
+ svn_wc_conflict_resolver_func2_t conflict_func;
+ void *conflict_baton;
} svn_cl__opt_state_t;
@@ -571,6 +576,18 @@ svn_cl__merge_file_externally(const char
svn_boolean_t *remains_in_conflict,
apr_pool_t *pool);
+/* Like svn_cl__merge_file_externally, but using a built-in merge tool
+ * with help from an external editor specified by EDITOR_CMD. */
+svn_error_t *
+svn_cl__merge_file(const char *base_path,
+ const char *their_path,
+ const char *my_path,
+ const char *merged_path,
+ const char *wc_path,
+ const char *editor_cmd,
+ apr_hash_t *config,
+ svn_boolean_t *remains_in_conflict,
+ apr_pool_t *scratch_pool);
/*** Notification functions to display results on the terminal. */
@@ -601,6 +618,14 @@ svn_cl__notifier_mark_export(void *baton
svn_error_t *
svn_cl__notifier_mark_wc_to_repos_copy(void *baton);
+/* Return TRUE if any conflicts were detected during notification. */
+svn_boolean_t
+svn_cl__notifier_check_conflicts(void *baton);
+
+/* Return a sorted array of conflicted paths detected during notification. */
+apr_array_header_t *
+svn_cl__notifier_get_conflicted_paths(void *baton, apr_pool_t *result_pool);
+
/* Baton for use with svn_cl__check_externals_failed_notify_wrapper(). */
struct svn_cl__check_externals_failed_notify_baton
{
@@ -848,6 +873,15 @@ svn_cl__check_related_source_and_target(
svn_client_ctx_t *ctx,
apr_pool_t *pool);
+/* Run the conflict resolver for all targets in the TARGETS list with
+ * the specified DEPTH. */
+svn_error_t *
+svn_cl__resolve_conflicts(apr_array_header_t *targets,
+ svn_depth_t depth,
+ const svn_cl__opt_state_t *opt_state,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/ev2-export/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/conflict-callbacks.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/ev2-export/subversion/svn/conflict-callbacks.c Wed Jul 11 10:26:19 2012
@@ -191,15 +191,19 @@ open_editor(svn_boolean_t *performed_edi
b->config, pool);
if (err && (err->apr_err == SVN_ERR_CL_NO_EXTERNAL_EDITOR))
{
+ svn_error_t *root_err = svn_error_root_cause(err);
+
SVN_ERR(svn_cmdline_fprintf(stderr, pool, "%s\n",
- err->message ? err->message :
+ root_err->message ? root_err->message :
_("No editor found.")));
svn_error_clear(err);
}
else if (err && (err->apr_err == SVN_ERR_EXTERNAL_PROGRAM))
{
+ svn_error_t *root_err = svn_error_root_cause(err);
+
SVN_ERR(svn_cmdline_fprintf(stderr, pool, "%s\n",
- err->message ? err->message :
+ root_err->message ? root_err->message :
_("Error running editor.")));
svn_error_clear(err);
}
@@ -241,14 +245,16 @@ launch_resolver(svn_boolean_t *performed
{
SVN_ERR(svn_cmdline_fprintf(stderr, pool, "%s\n",
err->message ? err->message :
- _("No merge tool found.\n")));
+ _("No merge tool found, "
+ "try '(m) merge' instead.\n")));
svn_error_clear(err);
}
else if (err && err->apr_err == SVN_ERR_EXTERNAL_PROGRAM)
{
SVN_ERR(svn_cmdline_fprintf(stderr, pool, "%s\n",
err->message ? err->message :
- _("Error running merge tool.")));
+ _("Error running merge tool, "
+ "try '(m) merge' instead.")));
svn_error_clear(err);
}
else if (err)
@@ -482,7 +488,7 @@ svn_cl__conflict_handler(svn_wc_conflict
if (diff_allowed)
{
prompt = apr_pstrcat(subpool, prompt,
- _(", (df) diff-full, (e) edit"),
+ _(", (df) diff-full, (e) edit, (m) merge"),
(char *)NULL);
if (knows_something)
@@ -538,6 +544,8 @@ svn_cl__conflict_handler(svn_wc_conflict
"\n"
" (p) postpone - mark the conflict to be "
"resolved later\n"
+ " (m) merge - use internal merge tool to "
+ "resolve conflict\n"
" (l) launch - launch external tool to "
"resolve conflict\n"
" (s) show all - show this list\n\n")));
@@ -657,6 +665,38 @@ svn_cl__conflict_handler(svn_wc_conflict
if (performed_edit)
knows_something = TRUE;
}
+ else if (strcmp(answer, "m") == 0 || strcmp(answer, ":-M") == 0)
+ {
+ if (desc->kind != svn_wc_conflict_kind_text)
+ {
+ SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
+ _("Invalid option; can only "
+ "resolve text conflicts with "
+ "the internal merge tool."
+ "\n\n")));
+ continue;
+ }
+
+ if (desc->base_abspath && desc->their_abspath &&
+ desc->my_abspath && desc->merged_file)
+ {
+ svn_boolean_t remains_in_conflict;
+
+ SVN_ERR(svn_cl__merge_file(desc->base_abspath,
+ desc->their_abspath,
+ desc->my_abspath,
+ desc->merged_file,
+ desc->local_abspath,
+ b->editor_cmd,
+ b->config,
+ &remains_in_conflict,
+ subpool));
+ knows_something = !remains_in_conflict;
+ }
+ else
+ SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
+ _("Invalid option.\n\n")));
+ }
else if (strcmp(answer, "l") == 0 || strcmp(answer, ":-l") == 0)
{
if (desc->kind == svn_wc_conflict_kind_property)
@@ -814,3 +854,57 @@ svn_cl__conflict_handler(svn_wc_conflict
svn_pool_destroy(subpool);
return SVN_NO_ERROR;
}
+
+svn_error_t *
+svn_cl__resolve_conflicts(apr_array_header_t *targets,
+ svn_depth_t depth,
+ const svn_cl__opt_state_t *opt_state,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool)
+{
+ int i;
+ apr_pool_t *iterpool;
+
+ iterpool = svn_pool_create(scratch_pool);
+ for (i = 0; i < targets->nelts; i++)
+ {
+ const char *target = APR_ARRAY_IDX(targets, i, const char *);
+ svn_error_t *err = SVN_NO_ERROR;
+ const char *local_abspath;
+ svn_wc_conflict_resolver_func2_t conflict_func2;
+ void *conflict_baton2;
+
+ svn_pool_clear(iterpool);
+
+ SVN_ERR(svn_dirent_get_absolute(&local_abspath, target, iterpool));
+
+
+ /* Store old state */
+ conflict_func2 = ctx->conflict_func2;
+ conflict_baton2 = ctx->conflict_baton2;
+
+ /* Store interactive resolver */
+ ctx->conflict_func2 = opt_state->conflict_func;
+ ctx->conflict_baton2 = opt_state->conflict_baton;
+
+ err = svn_client_resolve(local_abspath, depth,
+ svn_wc_conflict_choose_unspecified,
+ ctx, iterpool);
+
+ /* Restore state */
+ ctx->conflict_func2 = conflict_func2;
+ ctx->conflict_baton2 = conflict_baton2;
+
+ if (err)
+ {
+ if ((err->apr_err != SVN_ERR_WC_NOT_WORKING_COPY)
+ && (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND))
+ return svn_error_trace(err);
+
+ svn_error_clear(err);
+ }
+ }
+ svn_pool_destroy(iterpool);
+
+ return SVN_NO_ERROR;
+}
Modified: subversion/branches/ev2-export/subversion/svn/export-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/export-cmd.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/export-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/export-cmd.c Wed Jul 11 10:26:19 2012
@@ -114,9 +114,15 @@ svn_cl__export(apr_getopt_t *os,
"the directory or use --force to overwrite"));
if (nwb.had_externals_error)
- return svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS, NULL,
- _("Failure occurred processing one or more "
- "externals definitions"));
+ {
+ svn_error_t *externals_err;
+
+ externals_err = svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS,
+ NULL,
+ _("Failure occurred processing one or "
+ "more externals definitions"));
+ return svn_error_compose_create(externals_err, err);
+ }
return svn_error_trace(err);
}
Modified: subversion/branches/ev2-export/subversion/svn/log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/log-cmd.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/log-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/log-cmd.c Wed Jul 11 10:26:19 2012
@@ -24,6 +24,7 @@
#define APR_WANT_STRFUNC
#define APR_WANT_STDIO
#include <apr_want.h>
+#include <apr_fnmatch.h>
#include "svn_client.h"
#include "svn_compat.h"
@@ -70,6 +71,11 @@ struct log_receiver_baton
/* Stack which keeps track of merge revision nesting, using svn_revnum_t's */
apr_array_header_t *merge_stack;
+ /* Log message search pattern. Log entries will only be shown if the author,
+ * the log message, or a changed path matches this pattern. */
+ const char *search_pattern;
+ svn_boolean_t case_insensitive_search;
+
/* Pool for persistent allocations. */
apr_pool_t *pool;
};
@@ -141,6 +147,63 @@ display_diff(const svn_log_entry_t *log_
}
+/* Return TRUE if SEARCH_PATTERN matches the AUTHOR, DATE, LOG_MESSAGE,
+ * or a path in the set of keys of the CHANGED_PATHS hash. Else, return FALSE.
+ * Any of AUTHOR, DATE, LOG_MESSAGE, and CHANGED_PATHS may be NULL. */
+static svn_boolean_t
+match_search_pattern(const char *search_pattern,
+ const char *author,
+ const char *date,
+ const char *log_message,
+ apr_hash_t *changed_paths,
+ svn_boolean_t case_insensitive_search,
+ apr_pool_t *pool)
+{
+ /* Match any substring containing the pattern, like UNIX 'grep' does. */
+ const char *pattern = apr_psprintf(pool, "*%s*", search_pattern);
+ int flags = (case_insensitive_search ? APR_FNM_CASE_BLIND : 0);
+
+ /* Does the author match the search pattern? */
+ if (author && apr_fnmatch(pattern, author, flags) == APR_SUCCESS)
+ return TRUE;
+
+ /* Does the date the search pattern? */
+ if (date && apr_fnmatch(pattern, date, flags) == APR_SUCCESS)
+ return TRUE;
+
+ /* Does the log message the search pattern? */
+ if (log_message && apr_fnmatch(pattern, log_message, flags) == APR_SUCCESS)
+ return TRUE;
+
+ if (changed_paths)
+ {
+ apr_hash_index_t *hi;
+
+ /* Does a changed path match the search pattern? */
+ for (hi = apr_hash_first(pool, changed_paths);
+ hi;
+ hi = apr_hash_next(hi))
+ {
+ const char *path = svn__apr_hash_index_key(hi);
+ svn_log_changed_path2_t *log_item;
+
+ if (apr_fnmatch(pattern, path, flags) == APR_SUCCESS)
+ return TRUE;
+
+ /* Match copy-from paths, too. */
+ log_item = svn__apr_hash_index_val(hi);
+ if (log_item->copyfrom_path
+ && SVN_IS_VALID_REVNUM(log_item->copyfrom_rev)
+ && apr_fnmatch(pattern,
+ log_item->copyfrom_path, flags) == APR_SUCCESS)
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+
/* Implement `svn_log_entry_receiver_t', printing the logs in
* a human-readable and machine-parseable format.
*
@@ -257,6 +320,17 @@ log_entry_receiver(void *baton,
if (! lb->omit_log_message && message == NULL)
message = "";
+ if (lb->search_pattern &&
+ ! match_search_pattern(lb->search_pattern, author, date, message,
+ log_entry->changed_paths2,
+ lb->case_insensitive_search, pool))
+ {
+ if (log_entry->has_children)
+ APR_ARRAY_PUSH(lb->merge_stack, svn_revnum_t) = log_entry->revision;
+
+ return SVN_NO_ERROR;
+ }
+
SVN_ERR(svn_cmdline_printf(pool,
SEP_STRING "r%ld | %s | %s",
log_entry->revision, author, date));
@@ -418,13 +492,6 @@ log_entry_receiver_xml(void *baton,
svn_compat_log_revprops_out(&author, &date, &message, log_entry->revprops);
- if (author)
- author = svn_xml_fuzzy_escape(author, pool);
- if (date)
- date = svn_xml_fuzzy_escape(date, pool);
- if (message)
- message = svn_xml_fuzzy_escape(message, pool);
-
if (log_entry->revision == 0 && message == NULL)
return SVN_NO_ERROR;
@@ -437,6 +504,25 @@ log_entry_receiver_xml(void *baton,
return SVN_NO_ERROR;
}
+ /* Match search pattern before XML-escaping. */
+ if (lb->search_pattern &&
+ ! match_search_pattern(lb->search_pattern, author, date, message,
+ log_entry->changed_paths2,
+ lb->case_insensitive_search, pool))
+ {
+ if (log_entry->has_children)
+ APR_ARRAY_PUSH(lb->merge_stack, svn_revnum_t) = log_entry->revision;
+
+ return SVN_NO_ERROR;
+ }
+
+ if (author)
+ author = svn_xml_fuzzy_escape(author, pool);
+ if (date)
+ date = svn_xml_fuzzy_escape(date, pool);
+ if (message)
+ message = svn_xml_fuzzy_escape(message, pool);
+
revstr = apr_psprintf(pool, "%ld", log_entry->revision);
/* <logentry revision="xxx"> */
svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "logentry",
@@ -654,6 +740,8 @@ svn_cl__log(apr_getopt_t *os,
: opt_state->depth;
lb.diff_extensions = opt_state->extensions;
lb.merge_stack = apr_array_make(pool, 0, sizeof(svn_revnum_t));
+ lb.search_pattern = opt_state->search_pattern;
+ lb.case_insensitive_search = opt_state->case_insensitive_search;
lb.pool = pool;
if (opt_state->xml)
Modified: subversion/branches/ev2-export/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/main.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/main.c (original)
+++ subversion/branches/ev2-export/subversion/svn/main.c Wed Jul 11 10:26:19 2012
@@ -130,6 +130,8 @@ typedef enum svn_cl__longopt_t {
opt_allow_mixed_revisions,
opt_include_externals,
opt_symmetric,
+ opt_search,
+ opt_isearch,
} svn_cl__longopt_t;
@@ -375,6 +377,11 @@ const apr_getopt_option_t svn_cl__option
"fixed revision. (See the svn:externals property)")},
{"symmetric", opt_symmetric, 0,
N_("Symmetric merge")},
+ {"search", opt_search, 1,
+ N_("use ARG as search pattern (glob syntax)")},
+
+ {"isearch", opt_isearch, 1,
+ N_("like --search, but case-insensitive")},
/* Long-opt Aliases
*
@@ -678,7 +685,17 @@ const svn_opt_subcommand_desc2_t svn_cl_
"\n"
" The --depth option is only valid in combination with the --diff option\n"
" and limits the scope of the displayed diff to the specified depth.\n"
-
+ "\n"
+ " If the --search option is used, log messages are displayed only if the\n"
+ " provided search pattern matches the author, date, log message text,\n"
+ " or, if the --verbose option is also provided, a changed path.\n"
+ " The search pattern may include glob syntax wildcards:\n"
+ " ? matches any single character\n"
+ " * matches a sequence of arbitrary characters\n"
+ " [...] matches any of the characters listed inside the brackets\n"
+ " If --limit is used in combination with --search, --limit restricts the\n"
+ " number of log messages searched, rather than restricting the output\n"
+ " to a particular number of matching log messages.\n"
"\n"
" Examples:\n"
"\n"
@@ -707,7 +724,8 @@ const svn_opt_subcommand_desc2_t svn_cl_
" svn log --stop-on-copy --limit 1 -r0:HEAD ^/branches/foo\n"),
{'r', 'q', 'v', 'g', 'c', opt_targets, opt_stop_on_copy, opt_incremental,
opt_xml, 'l', opt_with_all_revprops, opt_with_no_revprops, opt_with_revprop,
- opt_depth, opt_diff, opt_diff_cmd, opt_internal_diff, 'x'},
+ opt_depth, opt_diff, opt_diff_cmd, opt_internal_diff, 'x', opt_search,
+ opt_isearch},
{{opt_with_revprop, N_("retrieve revision property ARG")},
{'c', N_("the change made in revision ARG")}} },
@@ -1049,6 +1067,11 @@ const svn_opt_subcommand_desc2_t svn_cl_
" specified by the --show-revs option. If --show-revs isn't passed,\n"
" it defaults to --show-revs='merged'.\n"
"\n"
+ " If --revision (-r) is provided, filter the displayed information to\n"
+ " show only that which is associated with the revisions within the\n"
+ " specified range. Revision numbers, dates, and the 'HEAD' keyword are\n"
+ " valid range values.\n"
+ "\n"
" The depth can be 'empty' or 'infinity'; the default is 'empty'.\n"),
{'r', 'R', opt_depth, opt_show_revs} },
@@ -1391,20 +1414,20 @@ const svn_opt_subcommand_desc2_t svn_cl_
"\n"
" Example output:\n"
" svn status wc\n"
- " M wc/bar.c\n"
- " A + wc/qax.c\n"
+ " M wc/bar.c\n"
+ " A + wc/qax.c\n"
"\n"
" svn status -u wc\n"
- " M 965 wc/bar.c\n"
- " * 965 wc/foo.c\n"
- " A + - wc/qax.c\n"
+ " M 965 wc/bar.c\n"
+ " * 965 wc/foo.c\n"
+ " A + - wc/qax.c\n"
" Status against revision: 981\n"
"\n"
" svn status --show-updates --verbose wc\n"
- " M 965 938 kfogel wc/bar.c\n"
- " * 965 922 sussman wc/foo.c\n"
- " A + - 687 joe wc/qax.c\n"
- " 965 687 joe wc/zig.c\n"
+ " M 965 938 kfogel wc/bar.c\n"
+ " * 965 922 sussman wc/foo.c\n"
+ " A + - 687 joe wc/qax.c\n"
+ " 965 687 joe wc/zig.c\n"
" Status against revision: 981\n"
"\n"
" svn status\n"
@@ -2148,6 +2171,13 @@ main(int argc, const char *argv[])
case opt_properties_only:
opt_state.diff.properties_only = TRUE;
break;
+ case opt_search:
+ opt_state.search_pattern = opt_arg;
+ break;
+ case opt_isearch:
+ opt_state.search_pattern = opt_arg;
+ opt_state.case_insensitive_search = TRUE;
+ break;
default:
/* Hmmm. Perhaps this would be a good place to squirrel away
opts that commands like svn diff might need. Hmmm indeed. */
@@ -2463,6 +2493,7 @@ main(int argc, const char *argv[])
if (subcommand->cmd_func != svn_cl__blame
&& subcommand->cmd_func != svn_cl__diff
&& subcommand->cmd_func != svn_cl__log
+ && subcommand->cmd_func != svn_cl__mergeinfo
&& subcommand->cmd_func != svn_cl__merge)
{
if (opt_state.end_revision.kind != svn_opt_revision_unspecified)
@@ -2681,6 +2712,13 @@ main(int argc, const char *argv[])
we can change this. */
svn_handle_error2(err, stderr, TRUE, "svn: ");
+ /* The new svn behavior is to postpone everything until after the operation
+ completed */
+ ctx->conflict_func = NULL;
+ ctx->conflict_baton = NULL;
+ ctx->conflict_func2 = NULL;
+ ctx->conflict_baton2 = NULL;
+
if ((opt_state.accept_which == svn_cl__accept_unspecified
&& (!interactive_conflicts || opt_state.non_interactive))
|| opt_state.accept_which == svn_cl__accept_postpone)
@@ -2688,10 +2726,8 @@ main(int argc, const char *argv[])
/* If no --accept option at all and we're non-interactive, we're
leaving the conflicts behind, so don't need the callback. Same if
the user said to postpone. */
- ctx->conflict_func = NULL;
- ctx->conflict_baton = NULL;
- ctx->conflict_func2 = NULL;
- ctx->conflict_baton2 = NULL;
+ opt_state.conflict_func = NULL;
+ opt_state.conflict_baton = NULL;
}
else
{
@@ -2717,16 +2753,14 @@ main(int argc, const char *argv[])
pool, "svn: ");
}
- ctx->conflict_func = NULL;
- ctx->conflict_baton = NULL;
- ctx->conflict_func2 = svn_cl__conflict_handler;
+ opt_state.conflict_func = svn_cl__conflict_handler;
SVN_INT_ERR(svn_cl__conflict_baton_make(&conflict_baton2,
opt_state.accept_which,
ctx->config,
opt_state.editor_cmd,
pb,
pool));
- ctx->conflict_baton2 = conflict_baton2;
+ opt_state.conflict_baton = conflict_baton2;
}
/* And now we finally run the subcommand. */
Modified: subversion/branches/ev2-export/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/merge-cmd.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/merge-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/merge-cmd.c Wed Jul 11 10:26:19 2012
@@ -61,8 +61,14 @@ merge_reintegrate(const char *source_pat
if (url1)
{
- svn_opt_revision_t revision1 = { svn_opt_revision_number, { rev1 } };
- svn_opt_revision_t revision2 = { svn_opt_revision_number, { rev2 } };
+ svn_opt_revision_t revision1;
+ svn_opt_revision_t revision2;
+
+ revision1.kind = svn_opt_revision_number;
+ revision1.value.number = rev1;
+
+ revision2.kind = svn_opt_revision_number;
+ revision2.value.number = rev2;
/* Do the merge. Set 'allow_mixed_rev' to true, not because we want
* to allow a mixed-rev WC but simply to bypass the check, as it was
@@ -146,7 +152,8 @@ svn_cl__merge(apr_getopt_t *os,
apr_array_header_t *targets;
const char *sourcepath1 = NULL, *sourcepath2 = NULL, *targetpath = "";
svn_boolean_t two_sources_specified = TRUE;
- svn_error_t *err;
+ svn_error_t *err = SVN_NO_ERROR;
+ svn_error_t *merge_err = SVN_NO_ERROR;
svn_opt_revision_t first_range_start, first_range_end, peg_revision1,
peg_revision2;
apr_array_header_t *options, *ranges_to_merge = opt_state->revision_ranges;
@@ -384,6 +391,9 @@ svn_cl__merge(apr_getopt_t *os,
"with --reintegrate"));
}
+ /* Postpone conflict resolution during the merge operation.
+ * If any conflicts occur we'll run the conflict resolver later. */
+
#ifdef SVN_WITH_SYMMETRIC_MERGE
if (opt_state->symmetric_merge)
{
@@ -393,22 +403,26 @@ svn_cl__merge(apr_getopt_t *os,
if (two_sources_specified)
return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("SOURCE2 can't be used with --symmetric"));
+ if (first_range_start.kind != svn_opt_revision_unspecified
+ || first_range_end.kind != svn_opt_revision_unspecified)
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("a revision range can't be used with --symmetric"));
SVN_ERR_W(svn_cl__check_related_source_and_target(
sourcepath1, &peg_revision1, targetpath, &unspecified,
ctx, pool),
_("Source and target must be different but related branches"));
- err = symmetric_merge(sourcepath1, &peg_revision1, targetpath,
- opt_state->depth,
- opt_state->ignore_ancestry,
- opt_state->force,
- opt_state->record_only,
- opt_state->dry_run,
- opt_state->allow_mixed_rev,
- allow_local_mods,
- allow_switched_subtrees,
- options, ctx, pool);
+ merge_err = symmetric_merge(sourcepath1, &peg_revision1, targetpath,
+ opt_state->depth,
+ opt_state->ignore_ancestry,
+ opt_state->force,
+ opt_state->record_only,
+ opt_state->dry_run,
+ opt_state->allow_mixed_rev,
+ allow_local_mods,
+ allow_switched_subtrees,
+ options, ctx, pool);
}
else
#endif
@@ -419,8 +433,8 @@ svn_cl__merge(apr_getopt_t *os,
ctx, pool),
_("Source and target must be different but related branches"));
- err = merge_reintegrate(sourcepath1, &peg_revision1, targetpath,
- opt_state->dry_run, options, ctx, pool);
+ merge_err = merge_reintegrate(sourcepath1, &peg_revision1, targetpath,
+ opt_state->dry_run, options, ctx, pool);
}
else if (! two_sources_specified)
{
@@ -444,19 +458,19 @@ svn_cl__merge(apr_getopt_t *os,
_("Source and target must be different but related branches"));
}
- err = svn_client_merge_peg4(sourcepath1,
- ranges_to_merge,
- &peg_revision1,
- targetpath,
- opt_state->depth,
- opt_state->ignore_ancestry,
- opt_state->force,
- opt_state->record_only,
- opt_state->dry_run,
- opt_state->allow_mixed_rev,
- options,
- ctx,
- pool);
+ merge_err = svn_client_merge_peg4(sourcepath1,
+ ranges_to_merge,
+ &peg_revision1,
+ targetpath,
+ opt_state->depth,
+ opt_state->ignore_ancestry,
+ opt_state->force,
+ opt_state->record_only,
+ opt_state->dry_run,
+ opt_state->allow_mixed_rev,
+ options,
+ ctx,
+ pool);
}
else
{
@@ -464,36 +478,47 @@ svn_cl__merge(apr_getopt_t *os,
return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("Merge sources must both be "
"either paths or URLs"));
- err = svn_client_merge4(sourcepath1,
- &first_range_start,
- sourcepath2,
- &first_range_end,
- targetpath,
- opt_state->depth,
- opt_state->ignore_ancestry,
- opt_state->force,
- opt_state->record_only,
- opt_state->dry_run,
- opt_state->allow_mixed_rev,
- options,
- ctx,
- pool);
+ merge_err = svn_client_merge4(sourcepath1,
+ &first_range_start,
+ sourcepath2,
+ &first_range_end,
+ targetpath,
+ opt_state->depth,
+ opt_state->ignore_ancestry,
+ opt_state->force,
+ opt_state->record_only,
+ opt_state->dry_run,
+ opt_state->allow_mixed_rev,
+ options,
+ ctx,
+ pool);
}
if (! opt_state->quiet)
- SVN_ERR(svn_cl__print_conflict_stats(ctx->notify_baton2, pool));
+ err = svn_cl__print_conflict_stats(ctx->notify_baton2, pool);
+
+ if (!err
+ && opt_state->conflict_func
+ && svn_cl__notifier_check_conflicts(ctx->notify_baton2))
+ {
+ err = svn_cl__resolve_conflicts(
+ svn_cl__notifier_get_conflicted_paths(ctx->notify_baton2, pool),
+ opt_state->depth, opt_state, ctx, pool);
+ }
- if (err)
+ if (merge_err)
{
- if(err->apr_err == SVN_ERR_CLIENT_INVALID_MERGEINFO_NO_MERGETRACKING)
+ if (merge_err->apr_err ==
+ SVN_ERR_CLIENT_INVALID_MERGEINFO_NO_MERGETRACKING)
{
err = svn_error_quick_wrap(
- err,
+ svn_error_compose_create(merge_err, err),
_("Merge tracking not possible, use --ignore-ancestry or\n"
"fix invalid mergeinfo in target with 'svn propset'"));
}
- else if (! opt_state->reintegrate)
+ else
{
+ err = svn_error_compose_create(merge_err, err);
return svn_cl__may_need_force(err);
}
}
Modified: subversion/branches/ev2-export/subversion/svn/mergeinfo-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/mergeinfo-cmd.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/mergeinfo-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/mergeinfo-cmd.c Wed Jul 11 10:26:19 2012
@@ -122,19 +122,23 @@ svn_cl__mergeinfo(apr_getopt_t *os,
/* Do the real work, depending on the requested data flavor. */
if (opt_state->show_revs == svn_cl__show_revs_merged)
{
- SVN_ERR(svn_client_mergeinfo_log(TRUE, target, &tgt_peg_revision,
- source, &src_peg_revision,
- print_log_rev, NULL,
- TRUE, depth, NULL, ctx,
- pool));
+ SVN_ERR(svn_client_mergeinfo_log2(TRUE, target, &tgt_peg_revision,
+ source, &src_peg_revision,
+ &(opt_state->start_revision),
+ &(opt_state->end_revision),
+ print_log_rev, NULL,
+ TRUE, depth, NULL, ctx,
+ pool));
}
else if (opt_state->show_revs == svn_cl__show_revs_eligible)
{
- SVN_ERR(svn_client_mergeinfo_log(FALSE, target, &tgt_peg_revision,
- source, &src_peg_revision,
- print_log_rev, NULL,
- TRUE, depth, NULL, ctx,
- pool));
+ SVN_ERR(svn_client_mergeinfo_log2(FALSE, target, &tgt_peg_revision,
+ source, &src_peg_revision,
+ &(opt_state->start_revision),
+ &(opt_state->end_revision),
+ print_log_rev, NULL,
+ TRUE, depth, NULL, ctx,
+ pool));
}
return SVN_NO_ERROR;
}
Modified: subversion/branches/ev2-export/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/notify.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/notify.c (original)
+++ subversion/branches/ev2-export/subversion/svn/notify.c Wed Jul 11 10:26:19 2012
@@ -35,6 +35,7 @@
#include "svn_pools.h"
#include "svn_dirent_uri.h"
#include "svn_path.h"
+#include "svn_sorts.h"
#include "cl.h"
#include "svn_private_config.h"
@@ -57,6 +58,7 @@ struct notify_baton
unsigned int prop_conflicts;
unsigned int tree_conflicts;
unsigned int skipped_paths;
+ apr_hash_t *conflicted_paths;
/* The cwd, for use in decomposing absolute paths. */
const char *path_prefix;
@@ -100,6 +102,16 @@ svn_cl__print_conflict_stats(void *notif
return SVN_NO_ERROR;
}
+/* Add a conflicted path to the list of conflicted paths stored
+ * in the notify baton. */
+static void
+add_conflicted_path(struct notify_baton *nb, const char *path)
+{
+ apr_hash_set(nb->conflicted_paths,
+ apr_pstrdup(apr_hash_pool_get(nb->conflicted_paths), path),
+ APR_HASH_KEY_STRING, "");
+}
+
/* This implements `svn_wc_notify_func2_t'.
* NOTE: This function can't fail, so we just ignore any print errors. */
static void
@@ -213,6 +225,7 @@ notify(void *baton, const svn_wc_notify_
if (n->content_state == svn_wc_notify_state_conflicted)
{
nb->text_conflicts++;
+ add_conflicted_path(nb, n->path);
if ((err = svn_cmdline_printf(pool, "C %s\n", path_local)))
goto print_error;
}
@@ -228,6 +241,7 @@ notify(void *baton, const svn_wc_notify_
if (n->content_state == svn_wc_notify_state_conflicted)
{
nb->text_conflicts++;
+ add_conflicted_path(nb, n->path);
statchar_buf[0] = 'C';
}
else
@@ -236,6 +250,7 @@ notify(void *baton, const svn_wc_notify_
if (n->prop_state == svn_wc_notify_state_conflicted)
{
nb->prop_conflicts++;
+ add_conflicted_path(nb, n->path);
statchar_buf[1] = 'C';
}
else if (n->prop_state == svn_wc_notify_state_merged)
@@ -302,6 +317,7 @@ notify(void *baton, const svn_wc_notify_
if (n->content_state == svn_wc_notify_state_conflicted)
{
nb->text_conflicts++;
+ add_conflicted_path(nb, n->path);
statchar_buf[0] = 'C';
}
else if (n->kind == svn_node_file)
@@ -315,6 +331,7 @@ notify(void *baton, const svn_wc_notify_
if (n->prop_state == svn_wc_notify_state_conflicted)
{
nb->prop_conflicts++;
+ add_conflicted_path(nb, n->path);
statchar_buf[1] = 'C';
}
else if (n->prop_state == svn_wc_notify_state_changed)
@@ -508,6 +525,7 @@ notify(void *baton, const svn_wc_notify_
if (n->content_state == svn_wc_notify_state_conflicted)
{
nb->text_conflicts++;
+ add_conflicted_path(nb, n->path);
statchar_buf[0] = 'C';
}
else if (n->kind == svn_node_file)
@@ -521,6 +539,7 @@ notify(void *baton, const svn_wc_notify_
if (n->prop_state == svn_wc_notify_state_conflicted)
{
nb->prop_conflicts++;
+ add_conflicted_path(nb, n->path);
statchar_buf[1] = 'C';
}
else if (n->prop_state == svn_wc_notify_state_merged)
@@ -898,6 +917,7 @@ notify(void *baton, const svn_wc_notify_
case svn_wc_notify_tree_conflict:
nb->tree_conflicts++;
+ add_conflicted_path(nb, n->path);
if ((err = svn_cmdline_printf(pool, " C %s\n", path_local)))
goto print_error;
break;
@@ -982,6 +1002,14 @@ notify(void *baton, const svn_wc_notify_
goto print_error;
break;
+ case svn_wc_notify_conflict_resolver_starting:
+ /* Once all operations invoke the interactive conflict resolution after
+ * they've completed, we can run svn_cl__print_conflict_stats() here. */
+ break;
+
+ case svn_wc_notify_conflict_resolver_done:
+ break;
+
default:
break;
}
@@ -1030,6 +1058,7 @@ svn_cl__get_notifier(svn_wc_notify_func2
nb->prop_conflicts = 0;
nb->tree_conflicts = 0;
nb->skipped_paths = 0;
+ nb->conflicted_paths = apr_hash_make(pool);
SVN_ERR(svn_dirent_get_absolute(&nb->path_prefix, "", pool));
*notify_func_p = notify;
@@ -1078,3 +1107,35 @@ svn_cl__check_externals_failed_notify_wr
nwb->wrapped_func(nwb->wrapped_baton, n, pool);
}
+svn_boolean_t
+svn_cl__notifier_check_conflicts(void *baton)
+{
+ struct notify_baton *nb = baton;
+
+ return (nb->text_conflicts || nb->prop_conflicts || nb->tree_conflicts);
+}
+
+apr_array_header_t *
+svn_cl__notifier_get_conflicted_paths(void *baton, apr_pool_t *result_pool)
+{
+ struct notify_baton *nb = baton;
+ apr_array_header_t *sorted_array;
+ apr_array_header_t *result_array;
+ int i;
+
+ sorted_array = svn_sort__hash(nb->conflicted_paths,
+ svn_sort_compare_items_as_paths,
+ apr_hash_pool_get(nb->conflicted_paths));
+ result_array = apr_array_make(result_pool, sorted_array->nelts,
+ sizeof(const char *));
+ for (i = 0; i < sorted_array->nelts; i++)
+ {
+ svn_sort__item_t item;
+
+ item = APR_ARRAY_IDX(sorted_array, i, svn_sort__item_t);
+ APR_ARRAY_PUSH(result_array, const char *) = apr_pstrdup(result_pool,
+ item.key);
+ }
+
+ return result_array;
+}
Modified: subversion/branches/ev2-export/subversion/svn/resolve-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/resolve-cmd.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/resolve-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/resolve-cmd.c Wed Jul 11 10:26:19 2012
@@ -55,6 +55,8 @@ 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;
switch (opt_state->accept_which)
{
@@ -77,7 +79,7 @@ svn_cl__resolve(apr_getopt_t *os,
conflict_choice = svn_wc_conflict_choose_mine_full;
break;
case svn_cl__accept_unspecified:
- if (ctx->conflict_func2 == NULL)
+ if (opt_state->conflict_func == NULL)
return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("missing --accept option"));
conflict_choice = svn_wc_conflict_choose_unspecified;
@@ -106,6 +108,14 @@ 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;
+
+ /* Store interactive resolver */
+ ctx->conflict_func2 = opt_state->conflict_func;
+ ctx->conflict_baton2 = opt_state->conflict_baton;
+
iterpool = svn_pool_create(scratch_pool);
for (i = 0; i < targets->nelts; i++)
{
@@ -125,6 +135,10 @@ 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/ev2-export/subversion/svn/switch-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/switch-cmd.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/switch-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/switch-cmd.c Wed Jul 11 10:26:19 2012
@@ -93,7 +93,8 @@ svn_cl__switch(apr_getopt_t *os,
void *baton,
apr_pool_t *scratch_pool)
{
- svn_error_t *err;
+ svn_error_t *err = SVN_NO_ERROR;
+ svn_error_t *externals_err = SVN_NO_ERROR;
svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
apr_array_header_t *targets;
@@ -156,6 +157,9 @@ svn_cl__switch(apr_getopt_t *os,
ctx->notify_func2 = svn_cl__check_externals_failed_notify_wrapper;
ctx->notify_baton2 = &nwb;
+ /* Postpone conflict resolution during the switch operation.
+ * If any conflicts occur we'll run the conflict resolver later. */
+
/* Do the 'switch' update. */
err = svn_client_switch3(NULL, target, switch_url, &peg_revision,
&(opt_state->start_revision), depth,
@@ -175,13 +179,29 @@ svn_cl__switch(apr_getopt_t *os,
return err;
}
+ if (nwb.had_externals_error)
+ externals_err = svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS,
+ NULL,
+ _("Failure occurred processing one or "
+ "more externals definitions"));
+
if (! opt_state->quiet)
- SVN_ERR(svn_cl__print_conflict_stats(nwb.wrapped_baton, scratch_pool));
+ {
+ err = svn_cl__print_conflict_stats(nwb.wrapped_baton, scratch_pool);
+ if (err)
+ return svn_error_compose_create(externals_err, err);
+ }
- if (nwb.had_externals_error)
- return svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS, NULL,
- _("Failure occurred processing one or more "
- "externals definitions"));
+ if (opt_state->conflict_func
+ && svn_cl__notifier_check_conflicts(nwb.wrapped_baton))
+ {
+ err = svn_cl__resolve_conflicts(
+ svn_cl__notifier_get_conflicted_paths(nwb.wrapped_baton,
+ scratch_pool),
+ depth, opt_state, ctx, scratch_pool);
+ if (err)
+ return svn_error_compose_create(externals_err, err);
+ }
- return SVN_NO_ERROR;
+ return svn_error_compose_create(externals_err, err);
}
Modified: subversion/branches/ev2-export/subversion/svn/update-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/update-cmd.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/update-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/update-cmd.c Wed Jul 11 10:26:19 2012
@@ -110,6 +110,10 @@ svn_cl__update(apr_getopt_t *os,
svn_boolean_t depth_is_sticky;
struct svn_cl__check_externals_failed_notify_baton nwb;
apr_array_header_t *result_revs;
+ svn_wc_conflict_resolver_func2_t conflict_func2 = ctx->conflict_func2;
+ void *conflict_baton2 = ctx->conflict_baton2;
+ svn_error_t *err = SVN_NO_ERROR;
+ svn_error_t *externals_err = SVN_NO_ERROR;
SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
opt_state->targets,
@@ -154,6 +158,9 @@ svn_cl__update(apr_getopt_t *os,
ctx->notify_func2 = svn_cl__check_externals_failed_notify_wrapper;
ctx->notify_baton2 = &nwb;
+ /* Postpone conflict resolution during the update operation.
+ * If any conflicts occur we'll run the conflict resolver later. */
+
SVN_ERR(svn_client_update4(&result_revs, targets,
&(opt_state->start_revision),
depth, depth_is_sticky,
@@ -162,20 +169,38 @@ svn_cl__update(apr_getopt_t *os,
opt_state->parents,
ctx, scratch_pool));
+ if (nwb.had_externals_error)
+ externals_err = svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS,
+ NULL,
+ _("Failure occurred processing one or "
+ "more externals definitions"));
+
if (! opt_state->quiet)
{
- SVN_ERR(print_update_summary(targets, result_revs, scratch_pool));
+ err = print_update_summary(targets, result_revs, scratch_pool);
+ if (err)
+ return svn_error_compose_create(externals_err, err);
/* ### Layering problem: This call assumes that the baton we're
* passing is the one that was originally provided by
* svn_cl__get_notifier(), but that isn't promised. */
- SVN_ERR(svn_cl__print_conflict_stats(nwb.wrapped_baton, scratch_pool));
+ err = svn_cl__print_conflict_stats(nwb.wrapped_baton, scratch_pool);
+ if (err)
+ return svn_error_compose_create(externals_err, err);
}
- if (nwb.had_externals_error)
- return svn_error_create(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS, NULL,
- _("Failure occurred processing one or more "
- "externals definitions"));
+ if (opt_state->conflict_func
+ && svn_cl__notifier_check_conflicts(nwb.wrapped_baton))
+ {
+ ctx->conflict_func2 = conflict_func2;
+ ctx->conflict_baton2 = conflict_baton2;
+ err = svn_cl__resolve_conflicts(
+ svn_cl__notifier_get_conflicted_paths(nwb.wrapped_baton,
+ scratch_pool),
+ depth, opt_state, ctx, scratch_pool);
+ if (err)
+ return svn_error_compose_create(externals_err, err);
+ }
- return SVN_NO_ERROR;
+ return svn_error_compose_create(externals_err, err);
}
Modified: subversion/branches/ev2-export/subversion/svnadmin/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svnadmin/main.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svnadmin/main.c (original)
+++ subversion/branches/ev2-export/subversion/svnadmin/main.c Wed Jul 11 10:26:19 2012
@@ -191,7 +191,8 @@ enum svnadmin__cmdline_options_t
svnadmin__wait,
svnadmin__pre_1_4_compatible,
svnadmin__pre_1_5_compatible,
- svnadmin__pre_1_6_compatible
+ svnadmin__pre_1_6_compatible,
+ svnadmin__pre_1_8_compatible
};
/* Option codes and descriptions.
@@ -280,6 +281,10 @@ static const apr_getopt_option_t options
N_("use format compatible with Subversion versions\n"
" earlier than 1.6")},
+ {"pre-1.8-compatible", svnadmin__pre_1_8_compatible, 0,
+ N_("use format compatible with Subversion versions\n"
+ " earlier than 1.8")},
+
{"memory-cache-size", 'M', 1,
N_("size of the extra in-memory cache in MB used to\n"
" minimize redundant operations. Default: 16.\n"
@@ -305,7 +310,8 @@ static const svn_opt_subcommand_desc2_t
"Create a new, empty repository at REPOS_PATH.\n"),
{svnadmin__bdb_txn_nosync, svnadmin__bdb_log_keep,
svnadmin__config_dir, svnadmin__fs_type, svnadmin__pre_1_4_compatible,
- svnadmin__pre_1_5_compatible, svnadmin__pre_1_6_compatible
+ svnadmin__pre_1_5_compatible, svnadmin__pre_1_6_compatible,
+ svnadmin__pre_1_8_compatible
} },
{"deltify", subcommand_deltify, {0}, N_
@@ -475,6 +481,7 @@ struct svnadmin_opt_state
svn_boolean_t pre_1_4_compatible; /* --pre-1.4-compatible */
svn_boolean_t pre_1_5_compatible; /* --pre-1.5-compatible */
svn_boolean_t pre_1_6_compatible; /* --pre-1.6-compatible */
+ svn_boolean_t pre_1_8_compatible; /* --pre-1.8-compatible */
svn_opt_revision_t start_revision, end_revision; /* -r X[:Y] */
svn_boolean_t help; /* --help or -? */
svn_boolean_t version; /* --version */
@@ -625,6 +632,11 @@ subcommand_create(apr_getopt_t *os, void
APR_HASH_KEY_STRING,
"1");
+ if (opt_state->pre_1_8_compatible)
+ apr_hash_set(fs_config, SVN_FS_CONFIG_PRE_1_8_COMPATIBLE,
+ APR_HASH_KEY_STRING,
+ "1");
+
SVN_ERR(svn_repos_create(&repos, opt_state->repository_path,
NULL, NULL, NULL, fs_config, pool));
svn_fs_set_warning_func(svn_repos_fs(repos), warning_func, NULL);
@@ -1896,6 +1908,9 @@ main(int argc, const char *argv[])
case svnadmin__pre_1_6_compatible:
opt_state.pre_1_6_compatible = TRUE;
break;
+ case svnadmin__pre_1_8_compatible:
+ opt_state.pre_1_8_compatible = TRUE;
+ break;
case svnadmin__fs_type:
err = svn_utf_cstring_to_utf8(&opt_state.fs_type, opt_arg, pool);
if (err)
Modified: subversion/branches/ev2-export/subversion/svndumpfilter/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svndumpfilter/main.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svndumpfilter/main.c (original)
+++ subversion/branches/ev2-export/subversion/svndumpfilter/main.c Wed Jul 11 10:26:19 2012
@@ -110,6 +110,28 @@ write_prop_to_stringbuf(svn_stringbuf_t
}
+/* Writes a property deletion in dumpfile format to given stringbuf. */
+static void
+write_propdel_to_stringbuf(svn_stringbuf_t **strbuf,
+ const char *name)
+{
+ int bytes_used;
+ size_t namelen;
+ char buf[SVN_KEYLINE_MAXLEN];
+
+ /* Output name length, then name. */
+ namelen = strlen(name);
+ svn_stringbuf_appendbytes(*strbuf, "D ", 2);
+
+ bytes_used = apr_snprintf(buf, sizeof(buf), "%" APR_SIZE_T_FMT, namelen);
+ svn_stringbuf_appendbytes(*strbuf, buf, bytes_used);
+ svn_stringbuf_appendbyte(*strbuf, '\n');
+
+ svn_stringbuf_appendbytes(*strbuf, name, namelen);
+ svn_stringbuf_appendbyte(*strbuf, '\n');
+}
+
+
/* Compare the node-path PATH with the (const char *) prefixes in PFXLIST.
* Return TRUE if any prefix is a prefix of PATH (matching whole path
* components); FALSE otherwise.
@@ -187,6 +209,7 @@ struct parse_baton_t
svn_boolean_t do_renumber_revs;
svn_boolean_t preserve_revprops;
svn_boolean_t skip_missing_merge_sources;
+ svn_boolean_t allow_deltas;
apr_array_header_t *prefixes;
/* Input and output streams. */
@@ -250,12 +273,36 @@ struct node_baton_t
/* Pointers to dumpfile data. */
svn_stringbuf_t *header;
svn_stringbuf_t *props;
+
+ /* Expect deltas? */
+ svn_boolean_t has_prop_delta;
+ svn_boolean_t has_text_delta;
+
+ /* We might need the node path in a parse error message. */
+ char *node_path;
};
/* Filtering vtable members */
+/* File-format stamp. */
+static svn_error_t *
+magic_header_record(int version, void *parse_baton, apr_pool_t *pool)
+{
+ struct parse_baton_t *pb = parse_baton;
+
+ if (version >= SVN_REPOS_DUMPFILE_FORMAT_VERSION_DELTAS)
+ pb->allow_deltas = TRUE;
+
+ SVN_ERR(svn_stream_printf(pb->out_stream, pool,
+ SVN_REPOS_DUMPFILE_MAGIC_HEADER ": %d\n\n",
+ version));
+
+ return SVN_NO_ERROR;
+}
+
+
/* New revision: set up revision_baton, decide if we skip it. */
static svn_error_t *
new_revision_record(void **revision_baton,
@@ -553,10 +600,13 @@ new_node_record(void **node_baton,
nb->has_props = FALSE;
nb->has_text = FALSE;
+ nb->has_prop_delta = FALSE;
+ nb->has_text_delta = FALSE;
nb->writing_begun = FALSE;
nb->tcl = tcl ? svn__atoui64(tcl) : 0;
nb->header = svn_stringbuf_create_empty(pool);
nb->props = svn_stringbuf_create_empty(pool);
+ nb->node_path = apr_pstrdup(pool, node_path);
/* Now we know for sure that we have a node that will not be
skipped, flush the revision if it has not already been done. */
@@ -569,6 +619,14 @@ new_node_record(void **node_baton,
const char *key = svn__apr_hash_index_key(hi);
const char *val = svn__apr_hash_index_val(hi);
+ if ((!strcmp(key, SVN_REPOS_DUMPFILE_PROP_DELTA))
+ && (!strcmp(val, "true")))
+ nb->has_prop_delta = TRUE;
+
+ if ((!strcmp(key, SVN_REPOS_DUMPFILE_TEXT_DELTA))
+ && (!strcmp(val, "true")))
+ nb->has_text_delta = TRUE;
+
if ((!strcmp(key, SVN_REPOS_DUMPFILE_CONTENT_LENGTH))
|| (!strcmp(key, SVN_REPOS_DUMPFILE_PROP_CONTENT_LENGTH))
|| (!strcmp(key, SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH)))
@@ -791,10 +849,12 @@ set_node_property(void *node_baton,
if (nb->do_skip)
return SVN_NO_ERROR;
- if (!nb->has_props)
- return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
- _("Delta property block detected - "
- "not supported by svndumpfilter"));
+ if (! (nb->has_props || nb->has_prop_delta))
+ return svn_error_createf(SVN_ERR_STREAM_MALFORMED_DATA, NULL,
+ _("Delta property block detected, but deltas "
+ "are not enabled for node '%s' in original "
+ "revision %ld"),
+ nb->node_path, rb->rev_orig);
if (strcmp(name, SVN_PROP_MERGEINFO) == 0)
{
@@ -804,6 +864,7 @@ set_node_property(void *node_baton,
value = filtered_mergeinfo;
}
+ nb->has_props = TRUE;
write_prop_to_stringbuf(nb->props, name, value);
return SVN_NO_ERROR;
@@ -811,6 +872,29 @@ set_node_property(void *node_baton,
static svn_error_t *
+delete_node_property(void *node_baton, const char *name)
+{
+ struct node_baton_t *nb = node_baton;
+ struct revision_baton_t *rb = nb->rb;
+
+ if (nb->do_skip)
+ return SVN_NO_ERROR;
+
+ if (!nb->has_prop_delta)
+ return svn_error_createf(SVN_ERR_STREAM_MALFORMED_DATA, NULL,
+ _("Delta property block detected, but deltas "
+ "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);
+
+ return SVN_NO_ERROR;
+}
+
+
+static svn_error_t *
remove_node_props(void *node_baton)
{
struct node_baton_t *nb = node_baton;
@@ -878,14 +962,15 @@ close_revision(void *revision_baton)
/* Filtering vtable */
-svn_repos_parse_fns2_t filtering_vtable =
+svn_repos_parse_fns3_t filtering_vtable =
{
- new_revision_record,
+ magic_header_record,
uuid_record,
+ new_revision_record,
new_node_record,
set_revision_property,
set_node_property,
- NULL,
+ delete_node_property,
remove_node_props,
set_fulltext,
NULL,
@@ -1031,17 +1116,7 @@ parse_baton_initialize(struct parse_bato
baton->renumber_history = apr_hash_make(pool);
baton->last_live_revision = SVN_INVALID_REVNUM;
baton->oldest_original_rev = SVN_INVALID_REVNUM;
-
- /* This is non-ideal: We should pass through the version of the
- * input dumpstream. However, our API currently doesn't allow that.
- * Hardcoding version 2 is acceptable because:
- * - We currently do not accept version 3 or greater.
- * - Dumpstream version 1 is so ancient as to be ignorable
- * (0.17.x and earlier)
- */
- SVN_ERR(svn_stream_printf(baton->out_stream, pool,
- SVN_REPOS_DUMPFILE_MAGIC_HEADER ": %d\n\n",
- 2));
+ baton->allow_deltas = FALSE;
*pb = baton;
return SVN_NO_ERROR;
@@ -1144,8 +1219,8 @@ do_filter(apr_getopt_t *os,
}
SVN_ERR(parse_baton_initialize(&pb, opt_state, do_exclude, pool));
- SVN_ERR(svn_repos_parse_dumpstream2(pb->in_stream, &filtering_vtable, pb,
- NULL, NULL, pool));
+ SVN_ERR(svn_repos_parse_dumpstream3(pb->in_stream, &filtering_vtable, pb,
+ TRUE, NULL, NULL, pool));
/* The rest of this is just reporting. If we aren't reporting, get
outta here. */
Modified: subversion/branches/ev2-export/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svnrdump/load_editor.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svnrdump/load_editor.c (original)
+++ subversion/branches/ev2-export/subversion/svnrdump/load_editor.c Wed Jul 11 10:26:19 2012
@@ -584,6 +584,14 @@ new_revision_record(void **revision_bato
}
static svn_error_t *
+magic_header_record(int version,
+ void *parse_baton,
+ apr_pool_t *pool)
+{
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
uuid_record(const char *uuid,
void *parse_baton,
apr_pool_t *pool)
@@ -1146,7 +1154,7 @@ svn_rdump__load_dumpstream(svn_stream_t
void *cancel_baton,
apr_pool_t *pool)
{
- svn_repos_parse_fns2_t *parser;
+ svn_repos_parse_fns3_t *parser;
struct parse_baton *parse_baton;
const svn_string_t *lock_string;
svn_boolean_t be_atomic;
@@ -1163,8 +1171,9 @@ svn_rdump__load_dumpstream(svn_stream_t
session_url, pool));
parser = apr_pcalloc(pool, sizeof(*parser));
- parser->new_revision_record = new_revision_record;
+ parser->magic_header_record = magic_header_record;
parser->uuid_record = uuid_record;
+ parser->new_revision_record = new_revision_record;
parser->new_node_record = new_node_record;
parser->set_revision_property = set_revision_property;
parser->set_node_property = set_node_property;
@@ -1185,7 +1194,7 @@ svn_rdump__load_dumpstream(svn_stream_t
parse_baton->last_rev_mapped = SVN_INVALID_REVNUM;
parse_baton->oldest_dumpstream_rev = SVN_INVALID_REVNUM;
- err = svn_repos_parse_dumpstream2(stream, parser, parse_baton,
+ err = svn_repos_parse_dumpstream3(stream, parser, parse_baton, FALSE,
cancel_func, cancel_baton, pool);
/* If all goes well, or if we're cancelled cleanly, don't leave a
Modified: subversion/branches/ev2-export/subversion/svnserve/cyrus_auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svnserve/cyrus_auth.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svnserve/cyrus_auth.c (original)
+++ subversion/branches/ev2-export/subversion/svnserve/cyrus_auth.c Wed Jul 11 10:26:19 2012
@@ -61,7 +61,7 @@ static int canonicalize_username(sasl_co
char *out, /* the output buffer */
unsigned out_max, unsigned *out_len)
{
- int realm_len = strlen(user_realm);
+ size_t realm_len = strlen(user_realm);
char *pos;
*out_len = inlen;
Modified: subversion/branches/ev2-export/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svnserve/serve.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svnserve/serve.c (original)
+++ subversion/branches/ev2-export/subversion/svnserve/serve.c Wed Jul 11 10:26:19 2012
@@ -2928,7 +2928,7 @@ repos_path_valid(const char *path)
consisting of just dots and spaces. Win32 functions treat
paths such as ".. " and "......." inconsistently. Make sure
no one can escape out of the root. */
- if (path - s >= 2 && strspn(s, ". ") == path - s)
+ if (path - s >= 2 && strspn(s, ". ") == (size_t)(path - s))
return FALSE;
#else /* ! WIN32 */
if (path - s == 2 && s[0] == '.' && s[1] == '.')
Modified: subversion/branches/ev2-export/subversion/svnversion/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svnversion/main.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svnversion/main.c (original)
+++ subversion/branches/ev2-export/subversion/svnversion/main.c Wed Jul 11 10:26:19 2012
@@ -179,10 +179,8 @@ main(int argc, const char *argv[])
if (APR_STATUS_IS_EOF(status))
break;
if (status != APR_SUCCESS)
- {
- usage(pool);
- return EXIT_FAILURE;
- }
+ usage(pool); /* this will exit() */
+
switch (opt)
{
case 'n':
@@ -201,8 +199,7 @@ main(int argc, const char *argv[])
is_version = TRUE;
break;
default:
- usage(pool);
- return EXIT_FAILURE;
+ usage(pool); /* this will exit() */
}
}
@@ -212,10 +209,7 @@ main(int argc, const char *argv[])
exit(0);
}
if (os->ind > argc || os->ind < argc - 2)
- {
- usage(pool);
- return EXIT_FAILURE;
- }
+ usage(pool); /* this will exit() */
SVN_INT_ERR(svn_utf_cstring_to_utf8(&wc_path,
(os->ind < argc) ? os->argv[os->ind]
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/atomic-ra-revprop-change.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/atomic-ra-revprop-change.c?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/atomic-ra-revprop-change.c (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/atomic-ra-revprop-change.c Wed Jul 11 10:26:19 2012
@@ -31,6 +31,7 @@
#include "svn_pools.h"
#include "svn_dirent_uri.h"
#include "svn_ra.h"
+#include "svn_cmdline.h"
#include "private/svn_skel.h"
@@ -41,7 +42,7 @@
#define KEY_NEW_PROPVAL "value"
#define USAGE_MSG \
- "Usage: %s URL REVISION PROPNAME VALUES_SKEL HTTP_LIBRARY WANT_ERROR\n" \
+ "Usage: %s URL REVISION PROPNAME VALUES_SKEL WANT_ERROR CONFIG_DIR\n" \
"\n" \
"VALUES_SKEL is a proplist skel containing pseudo-properties '%s' \n" \
"and '%s'. A pseudo-property missing from the skel is interpreted \n" \
@@ -52,83 +53,28 @@
"the exit code shall be zero.\n"
-
-/* implements svn_auth_simple_prompt_func_t */
-static svn_error_t *
-aborting_simple_prompt_func(svn_auth_cred_simple_t **cred,
- void *baton,
- const char *realm,
- const char *username,
- svn_boolean_t may_save,
- apr_pool_t *pool)
-{
- /* Oops, the jrandom:rayjandom we passed for SVN_AUTH_PARAM_DEFAULT_* failed,
- and the prompt provider has retried.
- */
- SVN_ERR_MALFUNCTION();
-}
-
-/* implements svn_auth_username_prompt_func_t */
-static svn_error_t *
-aborting_username_prompt_func(svn_auth_cred_username_t **cred,
- void *baton,
- const char *realm,
- svn_boolean_t may_save,
- apr_pool_t *pool)
-{
- /* Oops, the jrandom:rayjandom we passed for SVN_AUTH_PARAM_DEFAULT_* failed,
- and the prompt provider has retried.
- */
- SVN_ERR_MALFUNCTION();
-}
-
static svn_error_t *
construct_auth_baton(svn_auth_baton_t **auth_baton_p,
+ const char *config_dir,
apr_pool_t *pool)
{
- apr_array_header_t *providers;
- svn_auth_provider_object_t *simple_provider;
- svn_auth_baton_t *auth_baton;
-
- /* A bit of dancing just to pass jrandom:rayjandom. */
- providers = apr_array_make(pool, 2, sizeof(svn_auth_provider_object_t *)),
- svn_auth_get_simple_prompt_provider(&simple_provider,
- aborting_simple_prompt_func, NULL,
- 0, pool);
- APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = simple_provider;
- svn_auth_get_username_prompt_provider(&simple_provider,
- aborting_username_prompt_func, NULL,
- 0, pool);
- APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = simple_provider;
- svn_auth_open(&auth_baton, providers, pool);
- svn_auth_set_parameter(auth_baton,
- SVN_AUTH_PARAM_DEFAULT_USERNAME, "jrandom");
- svn_auth_set_parameter(auth_baton,
- SVN_AUTH_PARAM_DEFAULT_PASSWORD, "rayjandom");
-
- *auth_baton_p = auth_baton;
+ SVN_ERR(svn_cmdline_create_auth_baton(auth_baton_p,
+ TRUE /* non_interactive */,
+ "jrandom", "rayjandom",
+ config_dir,
+ TRUE /* no_auth_cache */,
+ FALSE /* trust_server_cert */,
+ NULL, NULL, NULL, pool));
return SVN_NO_ERROR;
}
static svn_error_t *
construct_config(apr_hash_t **config_p,
- const char *http_library,
+ const char *config_dir,
apr_pool_t *pool)
{
- apr_hash_t *config;
- svn_config_t *servers;
-
- /* Populate SERVERS. */
- SVN_ERR(svn_config_create(&servers, FALSE, pool));
- svn_config_set(servers, SVN_CONFIG_SECTION_GLOBAL,
- SVN_CONFIG_OPTION_HTTP_LIBRARY, http_library);
-
- /* Populate CONFIG. */
- config = apr_hash_make(pool);
- apr_hash_set(config, SVN_CONFIG_CATEGORY_SERVERS,
- APR_HASH_KEY_STRING, servers);
+ SVN_ERR(svn_config_get_config(config_p, config_dir, pool));
- *config_p = config;
return SVN_NO_ERROR;
}
@@ -138,8 +84,8 @@ change_rev_prop(const char *url,
const char *propname,
const svn_string_t *propval,
const svn_string_t *old_value,
- const char *http_library,
svn_boolean_t want_error,
+ const char *config_dir,
apr_pool_t *pool)
{
svn_ra_callbacks2_t *callbacks;
@@ -149,8 +95,8 @@ change_rev_prop(const char *url,
svn_error_t *err;
SVN_ERR(svn_ra_create_callbacks(&callbacks, pool));
- SVN_ERR(construct_auth_baton(&callbacks->auth_baton, pool));
- SVN_ERR(construct_config(&config, http_library, pool));
+ SVN_ERR(construct_auth_baton(&callbacks->auth_baton, config_dir, pool));
+ SVN_ERR(construct_config(&config, config_dir, pool));
SVN_ERR(svn_ra_open4(&sess, NULL, url, NULL, callbacks, NULL /* baton */,
config, pool));
@@ -216,9 +162,9 @@ main(int argc, const char *argv[])
const char *propname;
svn_string_t *propval;
svn_string_t *old_propval;
- const char *http_library;
char *digits_end = NULL;
svn_boolean_t want_error;
+ const char *config_dir;
if (argc != 7)
{
@@ -240,8 +186,9 @@ main(int argc, const char *argv[])
revision = strtol(argv[2], &digits_end, 10);
propname = argv[3];
SVN_INT_ERR(extract_values_from_skel(&old_propval, &propval, argv[4], pool));
- http_library = argv[5];
- want_error = !strcmp(argv[6], "1");
+ want_error = !strcmp(argv[5], "1");
+ config_dir = svn_dirent_canonicalize(argv[6], pool);
+
if ((! SVN_IS_VALID_REVNUM(revision)) || (! digits_end) || *digits_end)
SVN_INT_ERR(svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
@@ -249,7 +196,7 @@ main(int argc, const char *argv[])
/* Do something. */
err = change_rev_prop(url, revision, propname, propval, old_propval,
- http_library, want_error, pool);
+ want_error, config_dir, pool);
if (err)
{
svn_handle_error2(err, stderr, FALSE, "atomic-ra-revprop-change: ");
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/copy_tests.py?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/copy_tests.py Wed Jul 11 10:26:19 2012
@@ -5694,6 +5694,54 @@ def copy_to_unversioned_parent(sbox):
sbox.ospath('A/B'),
sbox.ospath('Unversioned/B2'))
+def copy_text_conflict(sbox):
+ "copy with a text conflict should not copy markers"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ mu_path = sbox.ospath('A/mu')
+ svntest.main.file_append(mu_path, 'appended mu text')
+
+ sbox.simple_commit()
+ svntest.main.file_append(mu_path, 'appended mu text')
+
+ sbox.simple_update(revision='1')
+
+ svntest.actions.run_and_verify_svn(None, None, [], 'cp',
+ sbox.ospath('A'),
+ sbox.ospath('A_copied'))
+
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.tweak('A/mu', status='C ')
+ expected_status.add({
+ # The markers in A
+ 'A/mu.mine' : Item(status='? '),
+ 'A/mu.r1' : Item(status='? '),
+ 'A/mu.r2' : Item(status='? '),
+ # And what is copied (without markers)
+ 'A_copied' : Item(status='A ', copied='+', wc_rev='-'),
+ 'A_copied/C' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/B' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/B/lambda' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/B/E' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/B/E/alpha': Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/B/E/beta' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/B/F' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D/G' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D/G/tau' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D/G/rho' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D/G/pi' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D/H' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D/H/omega': Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D/H/psi' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D/H/chi' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/D/gamma' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_copied/mu' : Item(status='M ', copied='+', wc_rev='-'),
+ })
+ svntest.actions.run_and_verify_unquiet_status(wc_dir, expected_status)
+
########################################################################
# Run the tests
@@ -5809,6 +5857,7 @@ test_list = [ None,
wc_wc_copy_incomplete,
three_nested_moves,
copy_to_unversioned_parent,
+ copy_text_conflict,
]
if __name__ == '__main__':
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/davautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/davautocheck.sh?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/davautocheck.sh (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/davautocheck.sh Wed Jul 11 10:26:19 2012
@@ -69,6 +69,8 @@
# the environment.
#
# To enable "SVNCacheRevProps on" set CACHE_REVPROPS in the environment.
+#
+# To test over https set USE_SSL in the environment.
#
# To use value for "SVNPathAuthz" directive set SVN_PATH_AUTHZ with
# appropriate value in the environment.
@@ -282,6 +284,10 @@ if [ ${APACHE_MPM:+set} ]; then
LOAD_MOD_MPM=$(get_loadmodule_config mod_mpm_$APACHE_MPM) \
|| fail "MPM module not found"
fi
+if [ ${USE_SSL:+set} ]; then
+ LOAD_MOD_SSL=$(get_loadmodule_config mod_ssl) \
+ || fail "SSL module not found"
+fi
random_port() {
if [ -n "$BASH_VERSION" ]; then
@@ -309,6 +315,53 @@ mkdir "$HTTPD_ROOT" \
say "Using directory '$HTTPD_ROOT'..."
+if [ ${USE_SSL:+set} ]; then
+ say "Setting up SSL"
+ BASE_URL="https://localhost:$HTTPD_PORT"
+# A self-signed certifcate for localhost generated via:
+# openssl req -new -x509 -nodes -out cert.pem -keyout cert-key.pem
+ SSL_CERTIFICATE_FILE="$HTTPD_ROOT/cert.pem"
+cat > "$SSL_CERTIFICATE_FILE" <<__EOF__
+-----BEGIN CERTIFICATE-----
+MIICrTCCAhagAwIBAgIJAN/ks6HqqeVKMA0GCSqGSIb3DQEBBQUAMEQxGjAYBgNV
+BAoTEUFwYWNoZSBTdWJ2ZXJzaW9uMRIwEAYDVQQLEwl0ZXN0c3VpdGUxEjAQBgNV
+BAMTCWxvY2FsaG9zdDAeFw0xMjA2MTIyMTIyNDlaFw0xMjA3MTIyMTIyNDlaMEQx
+GjAYBgNVBAoTEUFwYWNoZSBTdWJ2ZXJzaW9uMRIwEAYDVQQLEwl0ZXN0c3VpdGUx
+EjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA
+pAIkUHZbKgb6n75AZu7YG3skAeFZRVCiu9K/KwLKxDlhDuXhAjrGUOyfwtvj0Ezw
+F6J1Ke6NJFNOMw9FKcp9BegUyWHQ0hTxQSbgIGCgZGG74LUO5kdHQBU9bu/3daF+
+TC0e08OO90RLAoNr/CADZOTDDPD1QYFS3Au49GZPtI8CAwEAAaOBpjCBozAdBgNV
+HQ4EFgQUKgls7+vC/CGZKNJUczUSo+ZL2wAwdAYDVR0jBG0wa4AUKgls7+vC/CGZ
+KNJUczUSo+ZL2wChSKRGMEQxGjAYBgNVBAoTEUFwYWNoZSBTdWJ2ZXJzaW9uMRIw
+EAYDVQQLEwl0ZXN0c3VpdGUxEjAQBgNVBAMTCWxvY2FsaG9zdIIJAN/ks6HqqeVK
+MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAFMkecdq3XuJaRaC+4G38
+RNzUFR5Mnv/Ue/43J5CEJ5g2RTxro8DnGcYw2Qbv8lCUDBhkQ8L/lwnLe5jd204D
+Ad9t+1LXNyrYYncOmoZyzKupbfR0m6qz2Q45tqEztHokVWLnchiBaOL0nnGY0rPM
+zyc9CVIgp7ivvAud6ja++CQ=
+-----END CERTIFICATE-----
+__EOF__
+ SSL_CERTIFICATE_KEY_FILE="$HTTPD_ROOT/cert-key.pem"
+cat > "$SSL_CERTIFICATE_KEY_FILE" <<__EOF__
+ -----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQCkAiRQdlsqBvqfvkBm7tgbeyQB4VlFUKK70r8rAsrEOWEO5eEC
+OsZQ7J/C2+PQTPAXonUp7o0kU04zD0Upyn0F6BTJYdDSFPFBJuAgYKBkYbvgtQ7m
+R0dAFT1u7/d1oX5MLR7Tw473REsCg2v8IANk5MMM8PVBgVLcC7j0Zk+0jwIDAQAB
+AoGAFU0x6kF1FcBSTO0o8DWVW/xicNwT/Cy89igpLCzwqQvKz2SMFP4NQ/V3ypdE
+v4k+pdMz5H5XVqB7R6Z0FTl3g1ecfZoxYuMYWgzaaS6nx1xWJUqMTUqHArt9Sl/K
+/k6H5cNPC3JxGv7Blz87a3ypi93ZgSOJZDixG0BoRClGegECQQDVLTMqH5pVeBH1
+kfY2O8initMhi1lluM7yREbvZtxm844P11m7V4sOX9XQtBaaW3qLjzIru0TBJCL6
+F1JF7mYlAkEAxPRsJuFtBtWpQvnFzX3uXtaJtKtBIHbyBhmzo4f+ed/JU4Kzu1Pk
+CMnKgglg8rzU8/0HIU0AiaV2ItlQwb6PowJATZkWds7qLxJ19x4ascMxV0uBb0R6
+Vjzfl/CioaKfuBoQLFQHpdpIFANuoXnsgGOsSADoEmMos+WjlcXHfQ06wQJBAJTe
+79Tftephm+QtKc9urbvvy/zNKZghcEUeLkOgqsByYBoIhFRHT+k4piJudmJkS071
+ZetM6eghMk+bFcisgqMCQDD3kQ8gYOS9GbHPuTF4dfFSBx51nvd+hWNna1wi3rl+
+7nYzmrRWOp4ZMUG7i6GwqYHZ9stwJ/xRup5oink5VoQ=
+-----END RSA PRIVATE KEY-----
+__EOF__
+ SSL_MAKE_VAR="SSL_CERT=$SSL_CERTIFICATE_FILE"
+ SSL_TEST_ARG="--ssl-cert $SSL_CERTIFICATE_FILE"
+fi
+
say "Adding users for lock authentication"
$HTPASSWD -bc $HTTPD_USERS jrandom rayjandom
$HTPASSWD -b $HTTPD_USERS jconstant rayjandom
@@ -317,6 +370,7 @@ touch $HTTPD_MIME_TYPES
cat > "$HTTPD_CFG" <<__EOF__
$LOAD_MOD_MPM
+$LOAD_MOD_SSL
$LOAD_MOD_LOG_CONFIG
$LOAD_MOD_MIME
$LOAD_MOD_ALIAS
@@ -346,6 +400,14 @@ else
__EOF__
fi
+if [ ${USE_SSL:+set} ]; then
+cat >> "$HTTPD_CFG" <<__EOF__
+SSLEngine on
+SSLCertificateFile $SSL_CERTIFICATE_FILE
+SSLCertificateKeyFile $SSL_CERTIFICATE_KEY_FILE
+__EOF__
+fi
+
cat >> "$HTTPD_CFG" <<__EOF__
Listen $HTTPD_PORT
ServerName localhost
@@ -424,7 +486,7 @@ say "HTTPD started and listening on '$BA
### server/request.c:ap_process_request_internal():
### [Wed Feb 22 13:06:55 2006] [crit] [client 127.0.0.1] configuration error: couldn't check user: /cfg
HTTP_FETCH=wget
-HTTP_FETCH_OUTPUT="-q -O"
+HTTP_FETCH_OUTPUT="--no-check-certificate -q -O"
type wget > /dev/null 2>&1
if [ $? -ne 0 ]; then
type curl > /dev/null 2>&1
@@ -432,7 +494,7 @@ if [ $? -ne 0 ]; then
fail "Neither curl or wget found."
fi
HTTP_FETCH=curl
- HTTP_FETCH_OUTPUT='-s -o'
+ HTTP_FETCH_OUTPUT='-s -k -o'
fi
$HTTP_FETCH $HTTP_FETCH_OUTPUT "$HTTPD_CFG-copy" "$BASE_URL/cfg"
diff -q "$HTTPD_CFG" "$HTTPD_CFG-copy" > /dev/null \
@@ -463,13 +525,13 @@ else
fi
if [ $# = 0 ]; then
- time make check "BASE_URL=$BASE_URL"
+ time make check "BASE_URL=$BASE_URL" $SSL_MAKE_VAR
r=$?
else
(cd "$ABS_BUILDDIR/subversion/tests/cmdline/"
TEST="$1"
shift
- time "$ABS_SRCDIR/subversion/tests/cmdline/${TEST}_tests.py" "--url=$BASE_URL" "$@")
+ time "$ABS_SRCDIR/subversion/tests/cmdline/${TEST}_tests.py" "--url=$BASE_URL" $SSL_TEST_ARG "$@")
r=$?
fi
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout Wed Jul 11 10:26:19 2012
@@ -30,6 +30,17 @@ usage: 1. log [PATH][@REV]
The --depth option is only valid in combination with the --diff option
and limits the scope of the displayed diff to the specified depth.
+ If the --search option is used, log messages are displayed only if the
+ provided search pattern matches the author, date, log message text,
+ or, if the --verbose option is also provided, a changed path.
+ The search pattern may include glob syntax wildcards:
+ ? matches any single character
+ * matches a sequence of arbitrary characters
+ [...] matches any of the characters listed inside the brackets
+ If --limit is used in combination with --search, --limit restricts the
+ number of log messages searched, rather than restricting the output
+ to a particular number of matching log messages.
+
Examples:
Show the latest 5 log messages for the current working copy
@@ -99,6 +110,8 @@ Valid options:
Ignore changes in EOL style.
-p (--show-c-function):
Show C function name in diff output.
+ --search ARG : use ARG as search pattern (glob syntax)
+ --isearch ARG : like --search, but case-insensitive
Global options:
--username ARG : specify a username ARG
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/log_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/log_tests.py?rev=1360103&r1=1360102&r2=1360103&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/log_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/log_tests.py Wed Jul 11 10:26:19 2012
@@ -2280,6 +2280,55 @@ def log_diff_moved(sbox):
compare_diff_output(r2diff, log_chain[1]['diff_lines'])
compare_diff_output(r1diff, log_chain[2]['diff_lines'])
+
+#----------------------------------------------------------------------
+def log_search(sbox):
+ "'svn log --search'"
+
+ guarantee_repos_and_wc(sbox)
+
+ os.chdir(sbox.wc_dir)
+
+ 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])
+
+ # case-insensitive search
+ exit_code, output, err = svntest.actions.run_and_verify_svn(
+ None, None, [], 'log', '--isearch',
+ 'FOR REVISION [367]')
+
+ log_chain = parse_log_output(output)
+ check_log_chain(log_chain, [7, 6, 3])
+
+@SkipUnless(server_has_mergeinfo)
+def merge_sensitive_log_with_search(sbox):
+ "test 'svn log -g --search'"
+
+ merge_history_repos(sbox)
+
+ TRUNK_path = os.path.join(sbox.wc_dir, "trunk")
+
+ # Run log -g on a non-copying revision that adds mergeinfo,
+ # and perform a search that only matches the merged revision
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ 'log', '-g',
+ '-r6',
+ '--search',
+ 'upsilon',
+ TRUNK_path)
+
+ # Parse and check output. The only revision should be r4 (the merge rev).
+ log_chain = parse_log_output(output)
+ expected_merges = {
+ 4 : [6],
+ }
+ check_merge_results(log_chain, expected_merges)
+
+
########################################################################
# Run the tests
@@ -2323,6 +2372,8 @@ test_list = [ None,
log_diff,
log_xml_old,
log_diff_moved,
+ log_search,
+ merge_sensitive_log_with_search,
]
if __name__ == '__main__':