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 2013/02/25 11:48:09 UTC

svn commit: r1449655 - /subversion/trunk/subversion/svn/conflict-callbacks.c

Author: stsp
Date: Mon Feb 25 10:48:09 2013
New Revision: 1449655

URL: http://svn.apache.org/r1449655
Log:
Fix the problem where simply hitting 'enter' at the interactive conflict
prompt would postpone conflicts instead of responding with "unknown option".

* subversion/svn/conflict-callbacks.c
  (text_conflict_options): Options with code "" are special. They indicate
   where blank lines should be placed in the conflict prompt, and should not
   be used when evaluating answers given by the user. So initialise their
   choices to 'unspecified', instead of leaving them initialised to zero.
   A value of zero maps to the 'postpone' choice when passed back to the
   Subversion libraries. Passing 'unspecified' back into the library will
   raise an error instead. This doesn't actually fix the problem but makes
   the special case of "" stand out better.
  (find_option): Just like in help_strin(), we must special-case answers
   using option code "" because they do not correspond to any valid answer.
   This fixes the issue where just hitting enter didn't result in an "unknown
   option" response.

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=1449655&r1=1449654&r2=1449655&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/conflict-callbacks.c (original)
+++ subversion/trunk/subversion/svn/conflict-callbacks.c Mon Feb 25 10:48:09 2013
@@ -321,19 +321,19 @@ static const resolver_option_t text_conf
   { "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 },
-  { "" },
+  { "",   "",                 "", svn_wc_conflict_choose_unspecified },
   { "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 },
-  { "" },
+  { "",   "",                 "", svn_wc_conflict_choose_unspecified },
   { "mf", "mine-full",        N_("accept my version of entire file (even "
                                  "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 },
-  { "" },
+  { "",   "",                 "", svn_wc_conflict_choose_unspecified },
   { "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 },
@@ -417,7 +417,8 @@ find_option(const resolver_option_t *opt
 
   for (opt = options; opt->code; opt++)
     {
-      if (strcmp(opt->code, option_code) == 0)
+      /* Ignore code "" (blank lines) which is not a valid answer. */
+      if (opt->code[0] && strcmp(opt->code, option_code) == 0)
         return opt;
     }
   return NULL;