You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2013/02/19 16:25:10 UTC

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

Author: julianfoad
Date: Tue Feb 19 15:25:10 2013
New Revision: 1447764

URL: http://svn.apache.org/r1447764
Log:
Minor user-friendliness tweaks to the interactive conflict resolver.

* subversion/svn/conflict-callbacks.c
  (prompt_user): Say 'Unrecognized option' when we don't recognize the
    input.
  (handle_text_conflict): Tell the user why 'resolved' is not considered a
    valid input. Add some notes.

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=1447764&r1=1447763&r2=1447764&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/conflict-callbacks.c (original)
+++ subversion/trunk/subversion/svn/conflict-callbacks.c Tue Feb 19 15:25:10 2013
@@ -517,7 +517,12 @@ prompt_user(const resolver_option_t **op
   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)
+  if (! *opt)
+    {
+      SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+                                  _("Unrecognized option.\n\n")));
+    }
+  else if (strcmp(answer, "h") == 0 || strcmp(answer, "?") == 0)
     {
       SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, "\n%s\n",
                                   help_string(conflict_options,
@@ -690,6 +695,10 @@ handle_text_conflict(svn_wc_conflict_res
         }
       else if (strcmp(opt->code, "l") == 0 || strcmp(opt->code, ":-l") == 0)
         {
+          /* ### This check should be earlier as it's nasty to offer an option
+           *     and then when the user chooses it say 'Invalid option'. */
+          /* ### 'merged_file' shouldn't be necessary *before* we launch the
+           *     resolver: it should be the *result* of doing so. */
           if (desc->base_abspath && desc->their_abspath &&
               desc->my_abspath && desc->merged_file)
             {
@@ -720,8 +729,10 @@ handle_text_conflict(svn_wc_conflict_res
           if (result->choice == svn_wc_conflict_choose_merged
               && ! knows_something)
             {
-              SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
-                                          _("Invalid option.\n\n")));
+              SVN_ERR(svn_cmdline_fprintf(
+                        stderr, iterpool,
+                        _("Invalid option; use diff/edit/merge/launch "
+                          "before choosing 'resolved'.\n\n")));
               continue;
             }