You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pr...@apache.org on 2013/02/13 11:21:36 UTC
svn commit: r1445542 [12/16] - in /subversion/branches/verify-keep-going: ./
build/generator/ build/generator/swig/ build/generator/templates/
build/win32/ contrib/server-side/fsfsfixer/fixer/
contrib/server-side/svncutter/ notes/ notes/api-errata/1.7/...
Modified: subversion/branches/verify-keep-going/subversion/svn/blame-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svn/blame-cmd.c?rev=1445542&r1=1445541&r2=1445542&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svn/blame-cmd.c (original)
+++ subversion/branches/verify-keep-going/subversion/svn/blame-cmd.c Wed Feb 13 10:21:33 2013
@@ -375,10 +375,13 @@ svn_cl__blame(apr_getopt_t *os,
{
svn_error_clear(err);
SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("Skipping binary file: '%s'\n"),
+ _("Skipping binary file "
+ "(use --force to treat as text): "
+ "'%s'\n"),
target));
}
else if (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND ||
+ err->apr_err == SVN_ERR_ENTRY_NOT_FOUND ||
err->apr_err == SVN_ERR_FS_NOT_FILE ||
err->apr_err == SVN_ERR_FS_NOT_FOUND)
{
Modified: subversion/branches/verify-keep-going/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svn/cl.h?rev=1445542&r1=1445541&r2=1445542&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svn/cl.h (original)
+++ subversion/branches/verify-keep-going/subversion/svn/cl.h Wed Feb 13 10:21:33 2013
@@ -817,6 +817,18 @@ svn_cl__check_related_source_and_target(
svn_client_ctx_t *ctx,
apr_pool_t *pool);
+/* If the user is setting a mime-type to mark one of the TARGETS as binary,
+ * as determined by property name PROPNAME and value PROPVAL, then check
+ * whether Subversion's own binary-file detection recognizes the target as
+ * a binary file. If Subversion doesn't consider the target to be a binary
+ * file, assume the user is making an error and print a warning to inform
+ * the user that some operations might fail on the file in the future. */
+svn_error_t *
+svn_cl__propset_print_binary_mime_type_warning(apr_array_header_t *targets,
+ const char *propname,
+ const svn_string_t *propval,
+ apr_pool_t *scratch_pool);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/verify-keep-going/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svn/conflict-callbacks.c?rev=1445542&r1=1445541&r2=1445542&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/verify-keep-going/subversion/svn/conflict-callbacks.c Wed Feb 13 10:21:33 2013
@@ -307,59 +307,101 @@ typedef struct resolver_option_t
{
const char *code; /* one or two characters */
const char *short_desc; /* short description */
- const char *long_desc; /* longer description */
+ const char *long_desc; /* longer description (localized) */
+ svn_wc_conflict_choice_t choice; /* or -1 if not a simple choice */
} resolver_option_t;
/* Resolver options for a text conflict */
+/* (opt->code == "" causes a blank line break in help_string()) */
static const resolver_option_t text_conflict_options[] =
{
- { "e", "edit", N_("change merged file in an editor") },
- { "df", "diff-full", N_("show all changes made to merged file") },
- { "r", "resolved", N_("accept merged version of file") },
+ { "e", "edit", N_("change merged file in an editor"), -1 },
+ { "df", "diff-full", N_("show all changes made to merged file"), -1 },
+ { "r", "resolved", N_("accept merged version of file"),
+ svn_wc_conflict_choose_merged },
{ "" },
- { "dc", "display-conflict", N_("show all conflicts (ignoring merged version)") },
- { "mc", "mine-conflict", N_("accept my version for all conflicts (same)") },
- { "tc", "theirs-conflict", N_("accept their version for all conflicts (same)") },
+ { "dc", "display-conflict", N_("show all conflicts (ignoring merged version)"), -1 },
+ { "mc", "mine-conflict", N_("accept my version for all conflicts (same)"),
+ svn_wc_conflict_choose_mine_conflict },
+ { "tc", "theirs-conflict", N_("accept their version for all conflicts (same)"),
+ svn_wc_conflict_choose_theirs_conflict },
{ "" },
{ "mf", "mine-full", N_("accept my version of entire file (even "
- "non-conflicts)") },
- { "tf", "theirs-full", N_("accept their version of entire file (same)") },
+ "non-conflicts)"),
+ svn_wc_conflict_choose_mine_full },
+ { "tf", "theirs-full", N_("accept their version of entire file (same)"),
+ svn_wc_conflict_choose_theirs_full },
{ "" },
- { "p", "postpone", N_("mark the conflict to be resolved later") },
- { "m", "merge", N_("use internal merge tool to resolve conflict") },
- { "l", "launch", N_("launch external tool to resolve conflict") },
- { "s", "show all options", N_("show this list") },
+ { "p", "postpone", N_("mark the conflict to be resolved later"),
+ svn_wc_conflict_choose_postpone },
+ { "m", "merge", N_("use internal merge tool to resolve conflict"), -1 },
+ { "l", "launch", N_("launch external tool to resolve conflict"), -1 },
+ { "q", "quit", N_("postpone all remaining conflicts"),
+ svn_cl__accept_postpone },
+ { "s", "show all options", N_("show this list (also 'h', '?')"), -1 },
{ NULL }
};
/* Resolver options for a property conflict */
static const resolver_option_t prop_conflict_options[] =
{
- { "p", "postpone", N_("mark the conflict to be resolved later") },
+ { "p", "postpone", N_("mark the conflict to be resolved later"),
+ svn_wc_conflict_choose_postpone },
{ "mf", "mine-full", N_("accept my version of entire file (even "
- "non-conflicts)") },
- { "tf", "theirs-full", N_("accept their version of entire file (same)") },
+ "non-conflicts)"),
+ svn_wc_conflict_choose_mine_full },
+ { "tf", "theirs-full", N_("accept their version of entire file (same)"),
+ svn_wc_conflict_choose_theirs_full },
+ { "q", "quit", N_("postpone all remaining conflicts"),
+ svn_cl__accept_postpone },
+ { "h", "help", N_("show this help (also '?')"), -1 },
{ NULL }
};
/* Resolver options for an obstructued addition */
static const resolver_option_t obstructed_add_options[] =
{
- { "p", "postpone", N_("resolve the conflict later") },
- { "mf", "mine-full", N_("accept pre-existing item (ignore upstream addition)") },
- { "tf", "theirs-full", N_("accept incoming item (overwrite pre-existing item)") },
- { "h", "help", N_("show this help") },
+ { "p", "postpone", N_("resolve the conflict later"),
+ svn_wc_conflict_choose_postpone },
+ { "mf", "mine-full", N_("accept pre-existing item (ignore upstream addition)"),
+ svn_wc_conflict_choose_mine_full },
+ { "tf", "theirs-full", N_("accept incoming item (overwrite pre-existing item)"),
+ svn_wc_conflict_choose_theirs_full },
+ { "q", "quit", N_("postpone all remaining conflicts"),
+ svn_cl__accept_postpone },
+ { "h", "help", N_("show this help (also '?')"), -1 },
{ NULL }
};
/* Resolver options for a tree conflict */
static const resolver_option_t tree_conflict_options[] =
{
- { "p", "postpone", N_("resolve the conflict later") },
- { "r", "resolved", N_("accept current working copy state") },
- { "mc", "mine-conflict", N_("prefer local change") },
- { "tc", "theirs-conflict", N_("prefer incoming change") },
- { "h", "show help", N_("show this help") },
+ { "p", "postpone", N_("resolve the conflict later"),
+ svn_wc_conflict_choose_postpone },
+ { "r", "resolved", N_("accept current working copy state"),
+ svn_wc_conflict_choose_merged },
+ { "mc", "mine-conflict", N_("prefer local change"),
+ svn_wc_conflict_choose_mine_conflict },
+ { "tc", "theirs-conflict", N_("prefer incoming change"),
+ svn_wc_conflict_choose_theirs_conflict },
+ { "q", "quit", N_("postpone all remaining conflicts"),
+ svn_cl__accept_postpone },
+ { "h", "help", N_("show this help (also '?')"), -1 },
+ { NULL }
+};
+
+static const resolver_option_t tree_conflict_options_update_moved_away[] =
+{
+ { "p", "postpone", N_("resolve the conflict later"),
+ svn_wc_conflict_choose_postpone },
+ { "mc", "mine-conflict", N_("apply the update to the move destination"),
+ svn_wc_conflict_choose_mine_conflict },
+ { "tc", "theirs-conflict", N_("break the move, change move destination into "
+ "a copy"),
+ svn_wc_conflict_choose_theirs_conflict },
+ { "q", "quit", N_("postpone all remaining conflicts"),
+ svn_cl__accept_postpone },
+ { "h", "help", N_("show this help (also '?')"), -1 },
{ NULL }
};
@@ -451,6 +493,37 @@ help_string(const resolver_option_t *opt
return result;
}
+/* Prompt the user with CONFLICT_OPTIONS, restricted to the options listed
+ * in OPTIONS_TO_SHOW if that is non-null. Set *OPT to point to the chosen
+ * one of CONFLICT_OPTIONS (not necessarily one of OPTIONS_TO_SHOW), or to
+ * NULL if the answer was not one of them.
+ *
+ * If the answer is the (globally recognized) 'help' option, then display
+ * the help (on stderr) and return with *OPT == NULL.
+ */
+static svn_error_t *
+prompt_user(const resolver_option_t **opt,
+ const resolver_option_t *conflict_options,
+ const char *const *options_to_show,
+ void *prompt_baton,
+ apr_pool_t *scratch_pool)
+{
+ const char *prompt
+ = prompt_string(conflict_options, options_to_show, scratch_pool);
+ const char *answer;
+
+ SVN_ERR(svn_cmdline_prompt_user2(&answer, prompt, prompt_baton, scratch_pool));
+ *opt = find_option(conflict_options, answer);
+
+ if (strcmp(answer, "h") == 0 || strcmp(answer, "?") == 0)
+ {
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, "\n%s\n",
+ help_string(conflict_options,
+ scratch_pool)));
+ *opt = NULL;
+ }
+ return SVN_NO_ERROR;
+}
/* Ask the user what to do about the text conflict described by DESC.
* Return the answer in RESULT. B is the conflict baton for this
@@ -491,8 +564,7 @@ handle_text_conflict(svn_wc_conflict_res
{
const char *options[ARRAY_LEN(text_conflict_options)];
const char **next_option = options;
- const char *prompt;
- const char *answer;
+ const resolver_option_t *opt;
svn_pool_clear(iterpool);
@@ -521,67 +593,25 @@ handle_text_conflict(svn_wc_conflict_res
}
*next_option++ = "s";
*next_option++ = NULL;
- prompt = prompt_string(text_conflict_options, options, iterpool);
- SVN_ERR(svn_cmdline_prompt_user2(&answer, prompt, b->pb, iterpool));
+ SVN_ERR(prompt_user(&opt, text_conflict_options, options, b->pb,
+ iterpool));
+ if (! opt)
+ continue;
- if (strcmp(answer, "s") == 0)
- {
- SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, "\n%s\n",
- help_string(text_conflict_options,
- iterpool)));
- }
- else if (strcmp(answer, "p") == 0 || strcmp(answer, ":-P") == 0)
- {
- /* Do nothing, let file be marked conflicted. */
- result->choice = svn_wc_conflict_choose_postpone;
- break;
- }
- else if (strcmp(answer, "mc") == 0 || strcmp(answer, "X-)") == 0)
- {
- if (desc->is_binary)
- {
- SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
- _("Invalid option; cannot choose "
- "based on conflicts in a "
- "binary file.\n\n")));
- continue;
- }
- result->choice = svn_wc_conflict_choose_mine_conflict;
- if (performed_edit)
- result->save_merged = TRUE;
- break;
- }
- else if (strcmp(answer, "tc") == 0 || strcmp(answer, "X-(") == 0)
+ if (strcmp(opt->code, "q") == 0)
{
- if (desc->is_binary)
- {
- SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
- _("Invalid option; cannot choose "
- "based on conflicts in a "
- "binary file.\n\n")));
- continue;
- }
- result->choice = svn_wc_conflict_choose_theirs_conflict;
- if (performed_edit)
- result->save_merged = TRUE;
- break;
- }
- else if (strcmp(answer, "mf") == 0 || strcmp(answer, ":-)") == 0)
- {
- result->choice = svn_wc_conflict_choose_mine_full;
- if (performed_edit)
- result->save_merged = TRUE;
+ result->choice = opt->choice;
+ b->accept_which = opt->choice;
break;
}
- else if (strcmp(answer, "tf") == 0 || strcmp(answer, ":-(") == 0)
+ else if (strcmp(opt->code, "s") == 0)
{
- result->choice = svn_wc_conflict_choose_theirs_full;
- if (performed_edit)
- result->save_merged = TRUE;
- break;
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, "\n%s\n",
+ help_string(text_conflict_options,
+ iterpool)));
}
- else if (strcmp(answer, "dc") == 0)
+ else if (strcmp(opt->code, "dc") == 0)
{
if (desc->is_binary)
{
@@ -602,7 +632,7 @@ handle_text_conflict(svn_wc_conflict_res
SVN_ERR(show_conflicts(desc, iterpool));
knows_something = TRUE;
}
- else if (strcmp(answer, "df") == 0)
+ else if (strcmp(opt->code, "df") == 0)
{
if (! diff_allowed)
{
@@ -615,14 +645,14 @@ handle_text_conflict(svn_wc_conflict_res
SVN_ERR(show_diff(desc, iterpool));
knows_something = TRUE;
}
- else if (strcmp(answer, "e") == 0 || strcmp(answer, ":-E") == 0)
+ else if (strcmp(opt->code, "e") == 0 || strcmp(opt->code, ":-E") == 0)
{
SVN_ERR(open_editor(&performed_edit, desc, b, iterpool));
if (performed_edit)
knows_something = TRUE;
}
- else if (strcmp(answer, "m") == 0 || strcmp(answer, ":-g") == 0 ||
- strcmp(answer, "=>-") == 0 || strcmp(answer, ":>.") == 0)
+ else if (strcmp(opt->code, "m") == 0 || strcmp(opt->code, ":-g") == 0 ||
+ strcmp(opt->code, "=>-") == 0 || strcmp(opt->code, ":>.") == 0)
{
if (desc->kind != svn_wc_conflict_kind_text)
{
@@ -655,7 +685,7 @@ handle_text_conflict(svn_wc_conflict_res
SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
_("Invalid option.\n\n")));
}
- else if (strcmp(answer, "l") == 0 || strcmp(answer, ":-l") == 0)
+ else if (strcmp(opt->code, "l") == 0 || strcmp(opt->code, ":-l") == 0)
{
if (desc->base_abspath && desc->their_abspath &&
desc->my_abspath && desc->merged_file)
@@ -668,19 +698,34 @@ handle_text_conflict(svn_wc_conflict_res
SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
_("Invalid option.\n\n")));
}
- else if (strcmp(answer, "r") == 0)
+ else if (opt->choice != -1)
{
+ if ((opt->choice == svn_wc_conflict_choose_mine_conflict
+ || opt->choice == svn_wc_conflict_choose_theirs_conflict)
+ && desc->is_binary)
+ {
+ SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
+ _("Invalid option; cannot choose "
+ "based on conflicts in a "
+ "binary file.\n\n")));
+ continue;
+ }
+
/* We only allow the user accept the merged version of
the file if they've edited it, or at least looked at
the diff. */
- if (knows_something)
+ if (result->choice == svn_wc_conflict_choose_merged
+ && ! knows_something)
{
- result->choice = svn_wc_conflict_choose_merged;
- break;
+ SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
+ _("Invalid option.\n\n")));
+ continue;
}
- else
- SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
- _("Invalid option.\n\n")));
+
+ result->choice = opt->choice;
+ if (performed_edit)
+ result->save_merged = TRUE;
+ break;
}
}
svn_pool_destroy(iterpool);
@@ -698,8 +743,6 @@ handle_prop_conflict(svn_wc_conflict_res
svn_cl__interactive_conflict_baton_t *b,
apr_pool_t *scratch_pool)
{
- const char *prompt
- = prompt_string(prop_conflict_options, NULL, scratch_pool);
apr_pool_t *iterpool;
SVN_ERR_ASSERT(desc->kind == svn_wc_conflict_kind_property);
@@ -742,26 +785,24 @@ handle_prop_conflict(svn_wc_conflict_res
iterpool = svn_pool_create(scratch_pool);
while (TRUE)
{
- const char *answer;
+ const resolver_option_t *opt;
svn_pool_clear(iterpool);
- SVN_ERR(svn_cmdline_prompt_user2(&answer, prompt, b->pb, iterpool));
+ SVN_ERR(prompt_user(&opt, prop_conflict_options, NULL, b->pb,
+ iterpool));
+ if (! opt)
+ continue;
- if (strcmp(answer, "p") == 0 || strcmp(answer, ":-P") == 0)
- {
- /* Do nothing, let property be marked conflicted. */
- result->choice = svn_wc_conflict_choose_postpone;
- break;
- }
- else if (strcmp(answer, "mf") == 0 || strcmp(answer, ":-)") == 0)
+ if (strcmp(opt->code, "q") == 0)
{
- result->choice = svn_wc_conflict_choose_mine_full;
+ result->choice = opt->choice;
+ b->accept_which = opt->choice;
break;
}
- else if (strcmp(answer, "tf") == 0 || strcmp(answer, ":-(") == 0)
+ else if (opt->choice != -1)
{
- result->choice = svn_wc_conflict_choose_theirs_full;
+ result->choice = opt->choice;
break;
}
}
@@ -780,8 +821,6 @@ handle_tree_conflict(svn_wc_conflict_res
svn_cl__interactive_conflict_baton_t *b,
apr_pool_t *scratch_pool)
{
- const char *prompt
- = prompt_string(tree_conflict_options, NULL, scratch_pool);
const char *readable_desc;
apr_pool_t *iterpool;
@@ -798,36 +837,33 @@ handle_tree_conflict(svn_wc_conflict_res
iterpool = svn_pool_create(scratch_pool);
while (1)
{
- const char *answer;
+ const resolver_option_t *opt;
+ const resolver_option_t *tc_opts;
svn_pool_clear(iterpool);
- SVN_ERR(svn_cmdline_prompt_user2(&answer, prompt, b->pb, iterpool));
-
- if (strcmp(answer, "h") == 0 || strcmp(answer, "?") == 0)
+ if ((desc->operation == svn_wc_operation_update ||
+ desc->operation == svn_wc_operation_switch) &&
+ desc->reason == svn_wc_conflict_reason_moved_away)
{
- SVN_ERR(svn_cmdline_fprintf(stderr, iterpool, "%s",
- help_string(tree_conflict_options,
- iterpool)));
- }
- if (strcmp(answer, "p") == 0 || strcmp(answer, ":-p") == 0)
- {
- result->choice = svn_wc_conflict_choose_postpone;
- break;
+ tc_opts = tree_conflict_options_update_moved_away;
}
- else if (strcmp(answer, "r") == 0)
- {
- result->choice = svn_wc_conflict_choose_merged;
- break;
- }
- else if (strcmp(answer, "mc") == 0)
+ else
+ tc_opts = tree_conflict_options;
+
+ SVN_ERR(prompt_user(&opt, tc_opts, NULL, b->pb, iterpool));
+ if (! opt)
+ continue;
+
+ if (strcmp(opt->code, "q") == 0)
{
- result->choice = svn_wc_conflict_choose_mine_conflict;
+ result->choice = opt->choice;
+ b->accept_which = opt->choice;
break;
}
- else if (strcmp(answer, "tc") == 0)
+ else if (opt->choice != -1)
{
- result->choice = svn_wc_conflict_choose_theirs_conflict;
+ result->choice = opt->choice;
break;
}
}
@@ -846,8 +882,6 @@ handle_obstructed_add(svn_wc_conflict_re
svn_cl__interactive_conflict_baton_t *b,
apr_pool_t *scratch_pool)
{
- const char *prompt
- = prompt_string(obstructed_add_options, NULL, scratch_pool);
apr_pool_t *iterpool;
SVN_ERR(svn_cmdline_fprintf(
@@ -861,31 +895,24 @@ handle_obstructed_add(svn_wc_conflict_re
iterpool = svn_pool_create(scratch_pool);
while (1)
{
- const char *answer;
+ const resolver_option_t *opt;
svn_pool_clear(iterpool);
- SVN_ERR(svn_cmdline_prompt_user2(&answer, prompt, b->pb, iterpool));
+ SVN_ERR(prompt_user(&opt, obstructed_add_options, NULL, b->pb,
+ iterpool));
+ if (! opt)
+ continue;
- if (strcmp(answer, "h") == 0 || strcmp(answer, "?") == 0)
- {
- SVN_ERR(svn_cmdline_fprintf(stderr, iterpool, "%s\n",
- help_string(obstructed_add_options,
- iterpool)));
- }
- if (strcmp(answer, "p") == 0 || strcmp(answer, ":-P") == 0)
- {
- result->choice = svn_wc_conflict_choose_postpone;
- break;
- }
- if (strcmp(answer, "mf") == 0 || strcmp(answer, ":-)") == 0)
+ if (strcmp(opt->code, "q") == 0)
{
- result->choice = svn_wc_conflict_choose_mine_full;
+ result->choice = opt->choice;
+ b->accept_which = opt->choice;
break;
}
- if (strcmp(answer, "tf") == 0 || strcmp(answer, ":-(") == 0)
+ else if (opt->choice != -1)
{
- result->choice = svn_wc_conflict_choose_theirs_full;
+ result->choice = opt->choice;
break;
}
}
@@ -923,6 +950,10 @@ svn_cl__conflict_func_interactive(svn_wc
(*result)->choice = svn_wc_conflict_choose_base;
return SVN_NO_ERROR;
case svn_cl__accept_working:
+ /* If the caller didn't merge the property values, then I guess
+ * 'choose working' means 'choose mine'... */
+ if (! desc->merged_file)
+ (*result)->merged_file = desc->my_abspath;
(*result)->choice = svn_wc_conflict_choose_merged;
return SVN_NO_ERROR;
case svn_cl__accept_mine_conflict:
Modified: subversion/branches/verify-keep-going/subversion/svn/diff-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svn/diff-cmd.c?rev=1445542&r1=1445541&r2=1445542&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svn/diff-cmd.c (original)
+++ subversion/branches/verify-keep-going/subversion/svn/diff-cmd.c Wed Feb 13 10:21:33 2013
@@ -221,12 +221,13 @@ svn_cl__diff(apr_getopt_t *os,
if (! opt_state->old_target && ! opt_state->new_target
&& (targets->nelts == 2)
- && svn_path_is_url(APR_ARRAY_IDX(targets, 0, const char *))
- && svn_path_is_url(APR_ARRAY_IDX(targets, 1, const char *))
+ && (svn_path_is_url(APR_ARRAY_IDX(targets, 0, const char *))
+ || svn_path_is_url(APR_ARRAY_IDX(targets, 1, const char *)))
&& opt_state->start_revision.kind == svn_opt_revision_unspecified
&& opt_state->end_revision.kind == svn_opt_revision_unspecified)
{
- /* The 'svn diff OLD_URL[@OLDREV] NEW_URL[@NEWREV]' case matches. */
+ /* A 2-target diff where one or both targets are URLs. These are
+ * shorthands for some 'svn diff --old X --new Y' invocations. */
SVN_ERR(svn_opt_parse_path(&opt_state->start_revision, &old_target,
APR_ARRAY_IDX(targets, 0, const char *),
@@ -236,10 +237,16 @@ svn_cl__diff(apr_getopt_t *os,
pool));
targets->nelts = 0;
+ /* Set default start/end revisions based on target types, in the same
+ * manner as done for the corresponding '--old X --new Y' cases,
+ * (note that we have an explicit --new target) */
if (opt_state->start_revision.kind == svn_opt_revision_unspecified)
- opt_state->start_revision.kind = svn_opt_revision_head;
+ opt_state->start_revision.kind = svn_path_is_url(old_target)
+ ? svn_opt_revision_head : svn_opt_revision_working;
+
if (opt_state->end_revision.kind == svn_opt_revision_unspecified)
- opt_state->end_revision.kind = svn_opt_revision_head;
+ opt_state->end_revision.kind = svn_path_is_url(new_target)
+ ? svn_opt_revision_head : svn_opt_revision_working;
}
else if (opt_state->old_target)
{
@@ -252,9 +259,8 @@ svn_cl__diff(apr_getopt_t *os,
tmp = apr_array_make(pool, 2, sizeof(const char *));
APR_ARRAY_PUSH(tmp, const char *) = (opt_state->old_target);
APR_ARRAY_PUSH(tmp, const char *) = (opt_state->new_target
- ? opt_state->new_target
- : APR_ARRAY_IDX(tmp, 0,
- const char *));
+ ? opt_state->new_target
+ : opt_state->old_target);
SVN_ERR(svn_cl__args_to_target_array_print_reserved(&tmp2, os, tmp,
ctx, FALSE, pool));
@@ -275,21 +281,14 @@ svn_cl__diff(apr_getopt_t *os,
if (new_rev.kind != svn_opt_revision_unspecified)
opt_state->end_revision = new_rev;
- if (opt_state->new_target
- && opt_state->start_revision.kind == svn_opt_revision_unspecified
- && opt_state->end_revision.kind == svn_opt_revision_unspecified
- && ! svn_path_is_url(old_target)
- && ! svn_path_is_url(new_target))
- {
- /* We want the arbitrary_nodes_diff instead of just working nodes */
- opt_state->start_revision.kind = svn_opt_revision_working;
- opt_state->end_revision.kind = svn_opt_revision_working;
- }
-
+ /* For URLs, default to HEAD. For WC paths, default to WORKING if
+ * new target is explicit; if new target is implicitly the same as
+ * old target, then default the old to BASE and new to WORKING. */
if (opt_state->start_revision.kind == svn_opt_revision_unspecified)
opt_state->start_revision.kind = svn_path_is_url(old_target)
- ? svn_opt_revision_head : svn_opt_revision_base;
-
+ ? svn_opt_revision_head
+ : (opt_state->new_target
+ ? svn_opt_revision_working : svn_opt_revision_base);
if (opt_state->end_revision.kind == svn_opt_revision_unspecified)
opt_state->end_revision.kind = svn_path_is_url(new_target)
? svn_opt_revision_head : svn_opt_revision_working;
@@ -314,7 +313,10 @@ svn_cl__diff(apr_getopt_t *os,
old_target = "";
new_target = "";
- SVN_ERR(svn_cl__assert_homogeneous_target_type(targets));
+ SVN_ERR_W(svn_cl__assert_homogeneous_target_type(targets),
+ _("'svn diff [-r N[:M]] [TARGET[@REV]...]' does not support mixed "
+ "target types. Try using the --old and --new options or one of "
+ "the shorthand invocations listed in 'svn help diff'."));
working_copy_present = ! svn_path_is_url(APR_ARRAY_IDX(targets, 0,
const char *));
Modified: subversion/branches/verify-keep-going/subversion/svn/info-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svn/info-cmd.c?rev=1445542&r1=1445541&r2=1445542&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svn/info-cmd.c (original)
+++ subversion/branches/verify-keep-going/subversion/svn/info-cmd.c Wed Feb 13 10:21:33 2013
@@ -105,7 +105,7 @@ print_info_xml(void *baton,
/* "<url> xx </url>" */
svn_cl__xml_tagged_cdata(&sb, pool, "url", info->URL);
- if (info->repos_root_URL)
+ if (info->repos_root_URL && info->URL)
{
/* "<relative-url> xx </relative-url>" */
svn_cl__xml_tagged_cdata(&sb, pool, "relative-url",
Modified: subversion/branches/verify-keep-going/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svn/merge-cmd.c?rev=1445542&r1=1445541&r2=1445542&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svn/merge-cmd.c (original)
+++ subversion/branches/verify-keep-going/subversion/svn/merge-cmd.c Wed Feb 13 10:21:33 2013
@@ -84,14 +84,14 @@ automatic_merge(const char *source_path_
svn_client_automatic_merge_t *merge;
if (verbose)
- SVN_ERR(svn_cmdline_printf(scratch_pool, _("checking branch relationship...\n")));
+ SVN_ERR(svn_cmdline_printf(scratch_pool, _("--- Checking branch relationship\n")));
SVN_ERR_W(svn_cl__check_related_source_and_target(
source_path_or_url, source_revision,
target_wcpath, &unspecified_revision, ctx, scratch_pool),
_("Source and target must be different but related branches"));
if (verbose)
- SVN_ERR(svn_cmdline_printf(scratch_pool, _("calculating automatic merge...\n")));
+ SVN_ERR(svn_cmdline_printf(scratch_pool, _("--- Calculating automatic merge\n")));
/* Find the 3-way merges needed (and check suitability of the WC). */
SVN_ERR(svn_client_find_automatic_merge(&merge,
@@ -128,7 +128,7 @@ automatic_merge(const char *source_path_
}
if (verbose)
- SVN_ERR(svn_cmdline_printf(scratch_pool, _("merging...\n")));
+ SVN_ERR(svn_cmdline_printf(scratch_pool, _("--- Merging\n")));
/* Perform the 3-way merges */
SVN_ERR(svn_client_do_automatic_merge(merge, target_wcpath, depth,
@@ -423,8 +423,29 @@ 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. */
+ /* Decide how to handle conflicts. If the user wants interactive
+ * conflict resolution, postpone conflict resolution during the merge
+ * and if any conflicts occur we'll run the conflict resolver later.
+ * Otherwise install the appropriate resolver now. */
+ if (opt_state->accept_which == svn_cl__accept_unspecified
+ || opt_state->accept_which == svn_cl__accept_postpone
+ || opt_state->accept_which == svn_cl__accept_edit
+ || opt_state->accept_which == svn_cl__accept_launch)
+ {
+ /* 'svn.c' has already installed the 'postpone' handler for us. */
+ }
+ else
+ {
+ svn_cl__interactive_conflict_baton_t *b;
+
+ 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, pool));
+ ctx->conflict_baton2 = b;
+ }
/* Do an automatic merge if just one source and no revisions. */
if ((! two_sources_specified)
@@ -468,7 +489,7 @@ svn_cl__merge(apr_getopt_t *os,
/* This must be a 'sync' merge so check branch relationship. */
if (opt_state->verbose)
- SVN_ERR(svn_cmdline_printf(pool, _("checking branch relationship...\n")));
+ SVN_ERR(svn_cmdline_printf(pool, _("--- Checking branch relationship\n")));
SVN_ERR_W(svn_cl__check_related_source_and_target(
sourcepath1, &peg_revision1,
targetpath, &unspecified_revision, ctx, pool),
@@ -476,7 +497,7 @@ svn_cl__merge(apr_getopt_t *os,
}
if (opt_state->verbose)
- SVN_ERR(svn_cmdline_printf(pool, _("merging...\n")));
+ SVN_ERR(svn_cmdline_printf(pool, _("--- Merging\n")));
merge_err = svn_client_merge_peg5(sourcepath1,
ranges_to_merge,
&peg_revision1,
@@ -500,7 +521,7 @@ svn_cl__merge(apr_getopt_t *os,
"either paths or URLs"));
if (opt_state->verbose)
- SVN_ERR(svn_cmdline_printf(pool, _("merging...\n")));
+ SVN_ERR(svn_cmdline_printf(pool, _("--- Merging\n")));
merge_err = svn_client_merge5(sourcepath1,
&first_range_start,
sourcepath2,
@@ -521,7 +542,9 @@ svn_cl__merge(apr_getopt_t *os,
if (! opt_state->quiet)
err = svn_cl__print_conflict_stats(ctx->notify_baton2, pool);
- if (!err)
+ /* Resolve any postponed conflicts. (Only if we've been using the
+ * default 'postpone' resolver which remembers what was postponed.) */
+ if (!err && ctx->conflict_func2 == svn_cl__conflict_func_postpone)
err = svn_cl__resolve_postponed_conflicts(ctx->conflict_baton2,
opt_state->depth,
opt_state->accept_which,
Modified: subversion/branches/verify-keep-going/subversion/svn/propedit-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svn/propedit-cmd.c?rev=1445542&r1=1445541&r2=1445542&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svn/propedit-cmd.c (original)
+++ subversion/branches/verify-keep-going/subversion/svn/propedit-cmd.c Wed Feb 13 10:21:33 2013
@@ -315,6 +315,10 @@ svn_cl__propedit(apr_getopt_t *os,
sizeof(const char *));
APR_ARRAY_PUSH(targs, const char *) = target;
+
+ SVN_ERR(svn_cl__propset_print_binary_mime_type_warning(
+ targs, pname_utf8, propval, subpool));
+
err = svn_client_propset_local(pname_utf8, edited_propval,
targs, svn_depth_empty,
opt_state->force, NULL,
Modified: subversion/branches/verify-keep-going/subversion/svn/propset-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svn/propset-cmd.c?rev=1445542&r1=1445541&r2=1445542&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svn/propset-cmd.c (original)
+++ subversion/branches/verify-keep-going/subversion/svn/propset-cmd.c Wed Feb 13 10:21:33 2013
@@ -173,6 +173,11 @@ svn_cl__propset(apr_getopt_t *os,
}
}
+ SVN_ERR(svn_cl__propset_print_binary_mime_type_warning(targets,
+ pname_utf8,
+ propval,
+ scratch_pool));
+
SVN_ERR(svn_client_propset_local(pname_utf8, propval, targets,
opt_state->depth, opt_state->force,
opt_state->changelists, ctx,
Modified: subversion/branches/verify-keep-going/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svn/svn.c?rev=1445542&r1=1445541&r2=1445542&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svn/svn.c (original)
+++ subversion/branches/verify-keep-going/subversion/svn/svn.c Wed Feb 13 10:21:33 2013
@@ -536,29 +536,41 @@ const svn_opt_subcommand_desc2_t svn_cl_
{opt_force, 'q', opt_targets, SVN_CL__LOG_MSG_OPTIONS, opt_keep_local} },
{ "diff", svn_cl__diff, {"di"}, N_
- ("Display the differences between two revisions or paths.\n"
- "usage: 1. diff [-c M | -r N[:M]] [TARGET[@REV]...]\n"
- " 2. diff [-r N[:M]] --old=OLD-TGT[@OLDREV] [--new=NEW-TGT[@NEWREV]] \\\n"
+ ("Display local changes or differences between two revisions or paths.\n"
+ "usage: 1. diff\n"
+ " 2. diff [-c M | -r N[:M]] [TARGET[@REV]...]\n"
+ " 3. diff [-r N[:M]] --old=OLD-TGT[@OLDREV] [--new=NEW-TGT[@NEWREV]] \\\n"
" [PATH...]\n"
- " 3. diff OLD-URL[@OLDREV] NEW-URL[@NEWREV]\n"
+ " 4. diff OLD-URL[@OLDREV] NEW-URL[@NEWREV]\n"
+ " 5. diff OLD-URL[@OLDREV] NEW-PATH[@NEWREV]\n"
+ " 6. diff OLD-PATH[@OLDREV] NEW-URL[@NEWREV]\n"
"\n"
- " 1. Display the changes made to TARGETs as they are seen in REV between\n"
+ " 1. Use just 'svn diff' to display local modifications in a working copy.\n"
+ "\n"
+ " 2. Display the changes made to TARGETs as they are seen in REV between\n"
" two revisions. TARGETs may be all working copy paths or all URLs.\n"
" If TARGETs are working copy paths, N defaults to BASE and M to the\n"
" working copy; if URLs, N must be specified and M defaults to HEAD.\n"
" The '-c M' option is equivalent to '-r N:M' where N = M-1.\n"
" Using '-c -M' does the reverse: '-r M:N' where N = M-1.\n"
"\n"
- " 2. Display the differences between OLD-TGT as it was seen in OLDREV and\n"
+ " 3. Display the differences between OLD-TGT as it was seen in OLDREV and\n"
" NEW-TGT as it was seen in NEWREV. PATHs, if given, are relative to\n"
" OLD-TGT and NEW-TGT and restrict the output to differences for those\n"
" paths. OLD-TGT and NEW-TGT may be working copy paths or URL[@REV].\n"
" NEW-TGT defaults to OLD-TGT if not specified. -r N makes OLDREV default\n"
" to N, -r N:M makes OLDREV default to N and NEWREV default to M.\n"
+ " If OLDREV or NEWREV are not specified, they default to WORKING for\n"
+ " working copy targets and to HEAD for URL targets.\n"
"\n"
- " 3. Shorthand for 'svn diff --old=OLD-URL[@OLDREV] --new=NEW-URL[@NEWREV]'\n"
- "\n"
- " Use just 'svn diff' to display local modifications in a working copy.\n"),
+ " Either or both OLD-TGT and NEW-TGT may also be paths to unversioned\n"
+ " targets. Revisions cannot be specified for unversioned targets.\n"
+ " Both targets must be of the same node kind (file or directory).\n"
+ " Diffing unversioned targets against URL targets is not supported.\n"
+ "\n"
+ " 4. Shorthand for 'svn diff --old=OLD-URL[@OLDREV] --new=NEW-URL[@NEWREV]'\n"
+ " 5. Shorthand for 'svn diff --old=OLD-URL[@OLDREV] --new=NEW-PATH[@NEWREV]'\n"
+ " 6. Shorthand for 'svn diff --old=OLD-PATH[@OLDREV] --new=NEW-URL[@NEWREV]'\n"),
{'r', 'c', opt_old_cmd, opt_new_cmd, 'N', opt_depth, opt_diff_cmd,
opt_internal_diff, 'x', opt_no_diff_added, opt_no_diff_deleted,
opt_ignore_properties, opt_properties_only,
@@ -1321,10 +1333,12 @@ const svn_opt_subcommand_desc2_t svn_cl_
("Resolve conflicts on working copy files or directories.\n"
"usage: resolve [PATH...]\n"
"\n"
- " If no arguments are given, perform interactive conflict resolution for\n"
- " all conflicted paths in the working copy, with default depth 'infinity'.\n"
- " The --accept=ARG option prevents prompting and forces conflicts on PATH\n"
- " to resolved in the manner specified by ARG, with default depth 'empty'.\n"),
+ " By default, perform interactive conflict resolution on PATH.\n"
+ " In this mode, the command is recursive by default (depth 'infinity').\n"
+ "\n"
+ " The --accept=ARG option prevents interactive prompting and forces\n"
+ " conflicts on PATH to be resolved in the manner specified by ARG.\n"
+ " In this mode, the command is not recursive by default (depth 'empty').\n"),
{opt_targets, 'R', opt_depth, 'q', opt_accept},
{{opt_accept, N_("specify automatic conflict resolution source\n"
" "
Modified: subversion/branches/verify-keep-going/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/svn/util.c?rev=1445542&r1=1445541&r2=1445542&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/svn/util.c (original)
+++ subversion/branches/verify-keep-going/subversion/svn/util.c Wed Feb 13 10:21:33 2013
@@ -54,8 +54,10 @@
#include "svn_utf.h"
#include "svn_subst.h"
#include "svn_config.h"
+#include "svn_wc.h"
#include "svn_xml.h"
#include "svn_time.h"
+#include "svn_props.h"
#include "svn_private_config.h"
#include "cl.h"
@@ -972,9 +974,7 @@ svn_cl__assert_homogeneous_target_type(c
err = svn_client__assert_homogeneous_target_type(targets);
if (err && err->apr_err == SVN_ERR_ILLEGAL_TARGET)
- return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, err,
- _("Cannot mix repository and working copy "
- "targets"));
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, err, NULL);
return err;
}
@@ -1053,3 +1053,59 @@ svn_cl__check_related_source_and_target(
}
return SVN_NO_ERROR;
}
+
+svn_error_t *
+svn_cl__propset_print_binary_mime_type_warning(apr_array_header_t *targets,
+ const char *propname,
+ const svn_string_t *propval,
+ apr_pool_t *scratch_pool)
+{
+ if (strcmp(propname, SVN_PROP_MIME_TYPE) == 0)
+ {
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+ int i;
+
+ for (i = 0; i < targets->nelts; i++)
+ {
+ const char *detected_mimetype;
+ const char *target = APR_ARRAY_IDX(targets, i, const char *);
+ const char *local_abspath;
+ const svn_string_t *canon_propval;
+ svn_node_kind_t node_kind;
+
+ svn_pool_clear(iterpool);
+
+ SVN_ERR(svn_dirent_get_absolute(&local_abspath, target, iterpool));
+ SVN_ERR(svn_io_check_path(local_abspath, &node_kind, iterpool));
+ if (node_kind != svn_node_file)
+ continue;
+
+ SVN_ERR(svn_wc_canonicalize_svn_prop(&canon_propval,
+ propname, propval,
+ local_abspath,
+ svn_node_file,
+ FALSE, NULL, NULL,
+ iterpool));
+
+ if (svn_mime_type_is_binary(canon_propval->data))
+ {
+ SVN_ERR(svn_io_detect_mimetype2(&detected_mimetype,
+ local_abspath, NULL,
+ iterpool));
+ if (detected_mimetype == NULL ||
+ !svn_mime_type_is_binary(detected_mimetype))
+ svn_error_clear(svn_cmdline_fprintf(stderr, iterpool,
+ _("svn: warning: '%s' is a binary mime-type but file '%s' "
+ "looks like text; diff, merge, blame, and other "
+ "operations will stop working on this file\n"),
+ canon_propval->data,
+ svn_dirent_local_style(local_abspath, iterpool)));
+
+ }
+ }
+ svn_pool_destroy(iterpool);
+ }
+
+ return SVN_NO_ERROR;
+}
+
Modified: subversion/branches/verify-keep-going/subversion/tests/cmdline/basic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/cmdline/basic_tests.py?rev=1445542&r1=1445541&r2=1445542&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/branches/verify-keep-going/subversion/tests/cmdline/basic_tests.py Wed Feb 13 10:21:33 2013
@@ -209,8 +209,8 @@ def basic_update(sbox):
exit_code, out, err = svntest.actions.run_and_verify_svn(
"update xx/xx",
["Skipped '"+xx_path+"'\n",
- "Summary of conflicts:\n",
- " Skipped paths: 1\n"], [], 'update', xx_path)
+ ] + svntest.main.summary_of_conflicts(skipped_paths=1),
+ [], 'update', xx_path)
exit_code, out, err = svntest.actions.run_and_verify_svn(
"update xx/xx", [], [],
'update', '--quiet', xx_path)
@@ -1052,6 +1052,10 @@ def basic_delete(sbox):
sbox.build()
wc_dir = sbox.wc_dir
+ # Copies of unmodified
+ sbox.simple_copy('iota', 'iota-copied')
+ sbox.simple_copy('A/B/F', 'F-copied')
+
# modify text of chi
chi_parent_path = sbox.ospath('A/D/H')
chi_path = os.path.join(chi_parent_path, 'chi')
@@ -1094,9 +1098,11 @@ def basic_delete(sbox):
expected_output.tweak('A/D/G/rho', 'A/B/F', status=' M')
# expected_output.tweak('A/C/sigma', status='? ')
expected_output.add({
- 'A/B/X' : Item(status='A ', wc_rev=0),
- 'A/B/X/xi' : Item(status='A ', wc_rev=0),
- 'A/D/Y' : Item(status='A ', wc_rev=0),
+ 'A/B/X' : Item(status='A ', wc_rev='-'),
+ 'A/B/X/xi' : Item(status='A ', wc_rev='-'),
+ 'A/D/Y' : Item(status='A ', wc_rev='-'),
+ 'F-copied' : Item(status='A ', copied='+', wc_rev='-'),
+ 'iota-copied' : Item(status='A ', copied='+', wc_rev='-'),
})
svntest.actions.run_and_verify_status(wc_dir, expected_output)
@@ -1152,6 +1158,12 @@ def basic_delete(sbox):
svntest.actions.run_and_verify_svn(None, None, [],
'rm', '--force', X_path)
+ # Deleting an unchanged copy shouldn't error.
+ sbox.simple_mkdir('Z-added')
+ svntest.main.run_svn(None, 'rm', sbox.ospath('iota-copied'),
+ sbox.ospath('F-copied'),
+ sbox.ospath('Z-added'))
+
# Deleting already removed from wc versioned item with --force
iota_path = sbox.ospath('iota')
os.remove(iota_path)
Modified: subversion/branches/verify-keep-going/subversion/tests/cmdline/blame_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/cmdline/blame_tests.py?rev=1445542&r1=1445541&r2=1445542&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/cmdline/blame_tests.py (original)
+++ subversion/branches/verify-keep-going/subversion/tests/cmdline/blame_tests.py Wed Feb 13 10:21:33 2013
@@ -31,6 +31,8 @@ import os, sys, re
import svntest
from svntest.main import server_has_mergeinfo
+from prop_tests import binary_mime_type_on_text_file_warning
+
# For some basic merge setup used by blame -g tests.
from merge_tests import set_up_branch
@@ -126,24 +128,38 @@ def blame_binary(sbox):
# Then do it again, but this time we set the mimetype to binary.
iota = os.path.join(wc_dir, 'iota')
svntest.main.file_append(iota, "More new contents for iota\n")
- svntest.main.run_svn(None, 'propset', 'svn:mime-type', 'image/jpeg', iota)
+ svntest.main.run_svn(binary_mime_type_on_text_file_warning,
+ 'propset', 'svn:mime-type', 'image/jpeg', iota)
+
+ # Blame fails when mime-type is locally modified to binary
+ exit_code, output, errput = svntest.main.run_svn(2, 'blame', iota)
+ if (len(errput) != 1) or (errput[0].find('Skipping') == -1):
+ raise svntest.Failure
+
svntest.main.run_svn(None, 'ci',
'-m', '', iota)
+ # Blame fails when mime-type is binary
+ exit_code, output, errput = svntest.main.run_svn(2, 'blame', iota)
+ if (len(errput) != 1) or (errput[0].find('Skipping') == -1):
+ raise svntest.Failure
+
# Once more, but now let's remove that mimetype.
iota = os.path.join(wc_dir, 'iota')
svntest.main.file_append(iota, "Still more new contents for iota\n")
svntest.main.run_svn(None, 'propdel', 'svn:mime-type', iota)
svntest.main.run_svn(None, 'ci',
'-m', '', iota)
-
- exit_code, output, errput = svntest.main.run_svn(2, 'blame', iota)
+
+ # Blame fails when asking about an old revision where the mime-type is binary
+ exit_code, output, errput = svntest.main.run_svn(2, 'blame', iota + '@3')
if (len(errput) != 1) or (errput[0].find('Skipping') == -1):
raise svntest.Failure
# But with --force, it should work.
- exit_code, output, errput = svntest.main.run_svn(2, 'blame', '--force', iota)
- if (len(errput) != 0 or len(output) != 4):
+ exit_code, output, errput = svntest.main.run_svn(2, 'blame', '--force',
+ iota + '@3')
+ if (len(errput) != 0 or len(output) != 3):
raise svntest.Failure
@@ -599,7 +615,7 @@ def blame_file_not_in_head(sbox):
# Check that a correct error message is printed when blaming a target that
# doesn't exist (in HEAD).
- expected_err = ".*notexisting' (is not a file.*|path not found)"
+ expected_err = ".*notexisting' (is not a file.*|path not found|does not exist)"
svntest.actions.run_and_verify_svn(None, [], expected_err,
'blame', notexisting_url)
@@ -802,20 +818,20 @@ def blame_multiple_targets(sbox):
sbox.build()
+ # First, make a new revision of iota.
+ iota = os.path.join(sbox.wc_dir, 'iota')
+ svntest.main.file_append(iota, "New contents for iota\n")
+ svntest.main.run_svn(None, 'ci', '-m', '', iota)
+
+ expected_output = [
+ " 1 jrandom This is the file 'iota'.\n",
+ " 2 jrandom New contents for iota\n",
+ ]
+
def multiple_wc_targets():
"multiple wc targets"
- # First, make a new revision of iota.
- iota = os.path.join(sbox.wc_dir, 'iota')
non_existent = os.path.join(sbox.wc_dir, 'non-existent')
- svntest.main.file_append(iota, "New contents for iota\n")
- svntest.main.run_svn(None, 'ci',
- '-m', '', iota)
-
- expected_output = [
- " 1 jrandom This is the file 'iota'.\n",
- " 2 jrandom New contents for iota\n",
- ]
expected_err = ".*W155010.*\n.*E200009.*"
expected_err_re = re.compile(expected_err, re.DOTALL)
@@ -827,24 +843,15 @@ def blame_multiple_targets(sbox):
if not expected_err_re.match("".join(error)):
raise svntest.Failure('blame failed: expected error "%s", but received '
'"%s"' % (expected_err, "".join(error)))
+ svntest.verify.verify_outputs(None, output, None, expected_output, None)
def multiple_url_targets():
"multiple url targets"
- # First, make a new revision of iota.
- iota = os.path.join(sbox.wc_dir, 'iota')
iota_url = sbox.repo_url + '/iota'
non_existent = sbox.repo_url + '/non-existent'
- svntest.main.file_append(iota, "New contents for iota\n")
- svntest.main.run_svn(None, 'ci',
- '-m', '', iota)
-
- expected_output = [
- " 1 jrandom This is the file 'iota'.\n",
- " 2 jrandom New contents for iota\n",
- ]
- expected_err = ".*(W160017|W160013).*\n.*E200009.*"
+ expected_err = ".*(W160017|W160013|W150000).*\n.*E200009.*"
expected_err_re = re.compile(expected_err, re.DOTALL)
exit_code, output, error = svntest.main.run_svn(1, 'blame',
@@ -854,6 +861,7 @@ def blame_multiple_targets(sbox):
if not expected_err_re.match("".join(error)):
raise svntest.Failure('blame failed: expected error "%s", but received '
'"%s"' % (expected_err, "".join(error)))
+ svntest.verify.verify_outputs(None, output, None, expected_output, None)
# Test one by one
multiple_wc_targets()
Modified: subversion/branches/verify-keep-going/subversion/tests/cmdline/changelist_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/cmdline/changelist_tests.py?rev=1445542&r1=1445541&r2=1445542&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/cmdline/changelist_tests.py (original)
+++ subversion/branches/verify-keep-going/subversion/tests/cmdline/changelist_tests.py Wed Feb 13 10:21:33 2013
@@ -927,24 +927,24 @@ def tree_conflicts_and_changelists_on_co
# Remove it, warp back, add a prop, update.
svntest.main.run_svn(None, 'delete', C)
- expected_output = svntest.verify.UnorderedRegexOutput(
- ["Deleting.*" + re.escape(C)],
+ expected_output = svntest.verify.RegexOutput(
+ "Deleting.*" + re.escape(C),
False)
svntest.actions.run_and_verify_svn(None, expected_output, [],
'commit', '-m', 'delete A/C', C)
- expected_output = svntest.verify.UnorderedRegexOutput(
+ expected_output = svntest.verify.RegexOutput(
"A.*" + re.escape(C), False)
svntest.actions.run_and_verify_svn(None, expected_output, [],
'update', C, "-r1")
- expected_output = svntest.verify.UnorderedRegexOutput(
+ expected_output = svntest.verify.RegexOutput(
".*'propname' set on '"
+ re.escape(C) + "'", False)
svntest.actions.run_and_verify_svn(None, expected_output, [],
'propset', 'propname', 'propval', C)
- expected_output = svntest.verify.UnorderedRegexOutput(
+ expected_output = svntest.verify.RegexOutput(
" C " + re.escape(C), False)
svntest.actions.run_and_verify_svn(None, expected_output, [],
'update', wc_dir)
Modified: subversion/branches/verify-keep-going/subversion/tests/cmdline/commit_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/cmdline/commit_tests.py?rev=1445542&r1=1445541&r2=1445542&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/cmdline/commit_tests.py (original)
+++ subversion/branches/verify-keep-going/subversion/tests/cmdline/commit_tests.py Wed Feb 13 10:21:33 2013
@@ -31,6 +31,8 @@ import sys, os, re
import svntest
from svntest import wc
+from prop_tests import binary_mime_type_on_text_file_warning
+
# (abbreviation)
Skip = svntest.testcase.Skip_deco
SkipUnless = svntest.testcase.SkipUnless_deco
@@ -213,7 +215,8 @@ def commit_one_new_binary_file(sbox):
expected_status = make_standard_slew_of_changes(wc_dir)
gloo_path = sbox.ospath('A/D/H/gloo')
- svntest.main.run_svn(None, 'propset', 'svn:mime-type',
+ svntest.main.run_svn(binary_mime_type_on_text_file_warning,
+ 'propset', 'svn:mime-type',
'application/octet-stream', gloo_path)
# Create expected state.
Modified: subversion/branches/verify-keep-going/subversion/tests/cmdline/depth_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/tests/cmdline/depth_tests.py?rev=1445542&r1=1445541&r2=1445542&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/tests/cmdline/depth_tests.py (original)
+++ subversion/branches/verify-keep-going/subversion/tests/cmdline/depth_tests.py Wed Feb 13 10:21:33 2013
@@ -1042,46 +1042,26 @@ def diff_in_depthy_wc(sbox):
svntest.actions.run_and_verify_svn(None, None, [],
'commit', '-m', '', wc)
- diff = [
- "Index: A/mu\n",
- "===================================================================\n",
- "--- A/mu\t(revision 2)\n",
- "+++ A/mu\t(working copy)\n",
+ from diff_tests import make_diff_header, make_diff_prop_header
+ from diff_tests import make_diff_prop_deleted, make_diff_prop_added
+ diff_mu = make_diff_header('A/mu', 'revision 2', 'working copy') + [
"@@ -1 +1 @@\n",
"-new text\n",
- "+This is the file 'mu'.\n",
- "Index: A\n",
- "===================================================================\n",
- "--- A\t(revision 2)\n",
- "+++ A\t(working copy)\n",
- "\n",
- "Property changes on: A\n",
- "___________________________________________________________________\n",
- "Deleted: bar\n",
- "## -1 +0,0 ##\n",
- "-bar-val\n",
- "Index: iota\n",
- "===================================================================\n",
- "--- iota\t(revision 2)\n",
- "+++ iota\t(working copy)\n",
+ "+This is the file 'mu'.\n"]
+ diff_A = make_diff_header('A', 'revision 2', 'working copy') + \
+ make_diff_prop_header('A') + \
+ make_diff_prop_deleted('bar', 'bar-val')
+ diff_iota = make_diff_header('iota', 'revision 2', 'working copy') + [
"@@ -1 +1 @@\n",
"-new text\n",
- "+This is the file 'iota'.\n",
- "Index: .\n",
- "===================================================================\n",
- "--- .\t(revision 2)\n",
- "+++ .\t(working copy)\n",
- "\n",
- "Property changes on: .\n",
- "___________________________________________________________________\n",
- "Deleted: foo\n",
- "## -1 +0,0 ##\n",
- "-foo-val\n",
- "\\ No newline at end of property\n"]
+ "+This is the file 'iota'.\n"]
+ diff_dot = make_diff_header('.', 'revision 2', 'working copy') + \
+ make_diff_prop_header('.') + \
+ make_diff_prop_deleted('foo', 'foo-val')
os.chdir(wc_empty)
- expected_output = svntest.verify.UnorderedOutput(diff[24:])
+ expected_output = svntest.verify.UnorderedOutput(diff_dot)
# The diff should contain only the propchange on '.'
svntest.actions.run_and_verify_svn(None, expected_output, [],
'diff', '-rHEAD')
@@ -1091,11 +1071,11 @@ def diff_in_depthy_wc(sbox):
'--set-depth', 'files', '-r1')
# The diff should contain only the propchange on '.' and the
# contents change on iota.
- expected_output = svntest.verify.UnorderedOutput(diff[17:])
+ expected_output = svntest.verify.UnorderedOutput(diff_iota + diff_dot)
svntest.actions.run_and_verify_svn(None, expected_output, [],
'diff', '-rHEAD')
# Do a diff at --depth empty.
- expected_output = svntest.verify.UnorderedOutput(diff[24:])
+ expected_output = svntest.verify.UnorderedOutput(diff_dot)
svntest.actions.run_and_verify_svn(None, expected_output, [],
'diff', '--depth', 'empty', '-rHEAD')
@@ -1104,11 +1084,12 @@ def diff_in_depthy_wc(sbox):
'--set-depth', 'immediates', '-r1')
# The diff should contain the propchanges on '.' and 'A' and the
# contents change on iota.
- expected_output = svntest.verify.UnorderedOutput(diff[7:])
+ expected_output = svntest.verify.UnorderedOutput(diff_A + diff_iota +
+ diff_dot)
svntest.actions.run_and_verify_svn(None, expected_output, [],
'diff', '-rHEAD')
# Do a diff at --depth files.
- expected_output = svntest.verify.UnorderedOutput(diff[17:])
+ expected_output = svntest.verify.UnorderedOutput(diff_iota + diff_dot)
svntest.actions.run_and_verify_svn(None, expected_output, [],
'diff', '--depth', 'files', '-rHEAD')
@@ -1117,11 +1098,12 @@ def diff_in_depthy_wc(sbox):
'--set-depth', 'files', '-r1', 'A')
# The diff should contain everything but the contents change on
# gamma (which does not exist in this working copy).
- expected_output = svntest.verify.UnorderedOutput(diff)
+ expected_output = svntest.verify.UnorderedOutput(diff_mu + diff_A +
+ diff_iota + diff_dot)
svntest.actions.run_and_verify_svn(None, expected_output, [],
'diff', '-rHEAD')
# Do a diff at --depth immediates.
- expected_output = svntest.verify.UnorderedOutput(diff[7:])
+ expected_output = svntest.verify.UnorderedOutput(diff_A + diff_iota + diff_dot)
svntest.actions.run_and_verify_svn(None, expected_output, [],
'diff', '--depth', 'immediates', '-rHEAD')