You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2015/03/19 11:27:05 UTC
svn commit: r1667692 - /subversion/trunk/subversion/svn/conflict-callbacks.c
Author: stsp
Date: Thu Mar 19 10:27:05 2015
New Revision: 1667692
URL: http://svn.apache.org/r1667692
Log:
In the interactive conflict resolver, offer a reduced set of resolution
options for binary files. Not all text conflict options are valid for
binary files.
* subversion/svn/conflict-callbacks.c
(binary_conflict_options): New table of options for binary files.
(handle_text_conflict): Offer binary file options for binaries.
Don't recommend the 'mine-full' option if desc->my_abspath is NULL since
libsvn_wc will error out (or, before r1667691, assert) in this case.
Modified:
subversion/trunk/subversion/svn/conflict-callbacks.c
Modified: subversion/trunk/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/conflict-callbacks.c?rev=1667692&r1=1667691&r2=1667692&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/conflict-callbacks.c (original)
+++ subversion/trunk/subversion/svn/conflict-callbacks.c Thu Mar 19 10:27:05 2015
@@ -461,6 +461,28 @@ static const resolver_option_t text_conf
{ NULL }
};
+/* Resolver options for a binary file conflict. */
+static const resolver_option_t binary_conflict_options[] =
+{
+ /* Translators: keep long_desc below 70 characters (wrap with a left
+ margin of 9 spaces if needed); don't translate the words within square
+ brackets. */
+ { "r", N_("mark resolved"), N_("accept the working copy version of file "
+ " [working]"),
+ svn_wc_conflict_choose_merged },
+ { "tf", N_("their version"), N_("accept the incoming version of file "
+ " [theirs-full]"),
+ svn_wc_conflict_choose_theirs_full },
+ { "p", N_("postpone"), N_("mark the conflict to be resolved later "
+ " [postpone]"),
+ svn_wc_conflict_choose_postpone },
+ { "q", N_("quit resolution"), N_("postpone all remaining conflicts"),
+ svn_wc_conflict_choose_postpone },
+ { "s", N_("show all options"), N_("show this list (also 'h', '?')"),
+ svn_wc_conflict_choose_undefined },
+ { NULL }
+};
+
/* Resolver options for a property conflict */
static const resolver_option_t prop_conflict_options[] =
{
@@ -718,7 +740,10 @@ handle_text_conflict(svn_wc_conflict_res
while (TRUE)
{
- const char *options[ARRAY_LEN(text_conflict_options)];
+ const resolver_option_t *conflict_options = desc->is_binary
+ ? binary_conflict_options
+ : text_conflict_options;
+ const char *options[ARRAY_LEN(conflict_options)];
const char **next_option = options;
const resolver_option_t *opt;
@@ -747,14 +772,19 @@ handle_text_conflict(svn_wc_conflict_res
{
if (knows_something)
*next_option++ = "r";
- *next_option++ = "mf";
+
+ /* The 'mine-full' option selects the ".mine" file so only offer
+ * it if that file exists. It does not exist for binary files,
+ * for example (questionable historical behaviour since 1.0). */
+ if (desc->my_abspath)
+ *next_option++ = "mf";
+
*next_option++ = "tf";
}
*next_option++ = "s";
*next_option++ = NULL;
- SVN_ERR(prompt_user(&opt, text_conflict_options, options, b->pb,
- iterpool));
+ SVN_ERR(prompt_user(&opt, conflict_options, options, b->pb, iterpool));
if (! opt)
continue;
@@ -768,7 +798,7 @@ handle_text_conflict(svn_wc_conflict_res
else if (strcmp(opt->code, "s") == 0)
{
SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, "\n%s\n",
- help_string(text_conflict_options,
+ help_string(conflict_options,
iterpool)));
}
else if (strcmp(opt->code, "dc") == 0)