You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2013/03/20 15:36:57 UTC

svn commit: r1458856 - in /subversion/trunk/subversion: svn/svn.c svnmucc/svnmucc.c

Author: philip
Date: Wed Mar 20 14:36:56 2013
New Revision: 1458856

URL: http://svn.apache.org/r1458856
Log:
Make svn and svnmucc suggest --force-interactive when authn fails in
non-interactive mode.

* subversion/svn/svn.c
  (sub_main): Suggest --force-interactive.

* subversion/svnmucc/svnmucc.c
  (usage): Update help text.
  (main): Suggest --force-interactive.

Suggest by: julianfoad

Modified:
    subversion/trunk/subversion/svn/svn.c
    subversion/trunk/subversion/svnmucc/svnmucc.c

Modified: subversion/trunk/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/svn.c?rev=1458856&r1=1458855&r2=1458856&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/svn.c (original)
+++ subversion/trunk/subversion/svn/svn.c Wed Mar 20 14:36:56 2013
@@ -2836,6 +2836,14 @@ sub_main(int argc, const char *argv[], a
                                      _("Please see the 'svn upgrade' command"));
         }
 
+      if (err->apr_err == SVN_ERR_AUTHN_FAILED && opt_state.non_interactive)
+        {
+          err = svn_error_quick_wrap(err,
+                                     _("Authentication failed and interactive"
+                                       " prompting is disabled; see the"
+                                       " --force-interactive option"));
+        }
+
       /* Tell the user about 'svn cleanup' if any error on the stack
          was about locked working copies. */
       if (svn_error_find_cause(err, SVN_ERR_WC_LOCKED))

Modified: subversion/trunk/subversion/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnmucc/svnmucc.c?rev=1458856&r1=1458855&r2=1458856&view=diff
==============================================================================
--- subversion/trunk/subversion/svnmucc/svnmucc.c (original)
+++ subversion/trunk/subversion/svnmucc/svnmucc.c Wed Mar 20 14:36:56 2013
@@ -950,7 +950,10 @@ usage(apr_pool_t *pool, int exit_val)
       "  -r [--revision] ARG    : use revision ARG as baseline for changes\n"
       "  --with-revprop ARG     : set revision property in the following format:\n"
       "                               NAME[=VALUE]\n"
-      "  -n [--non-interactive] : don't prompt the user about anything\n"
+      "  --non-interactive      : do no interactive prompting (default it to\n"
+      "                           prompt only if standard input is a terminal)\n"
+      "  --force-interactive    : do interactive propmting even if standard\n"
+      "                           input is not a terminal\n"
       "  -X [--extra-args] ARG  : append arguments from file ARG (one per line;\n"
       "                         : use \"-\" to read from standard input)\n"
       "  --config-dir ARG       : use ARG to override the config directory\n"
@@ -1423,7 +1426,14 @@ main(int argc, const char **argv)
   if ((err = execute(actions, anchor, revprops, username, password,
                      config_dir, config_options, non_interactive,
                      no_auth_cache, base_revision, pool)))
-    handle_error(err, pool);
+    {
+      if (err->apr_err == SVN_ERR_AUTHN_FAILED && non_interactive)
+        err = svn_error_quick_wrap(err,
+                                   _("Authentication failed and interactive"
+                                     " prompting is disabled; see the"
+                                     " --force-interactive option"));
+      handle_error(err, pool);
+    }
 
   /* Ensure that stdout is flushed, so the user will see all results. */
   svn_error_clear(svn_cmdline_fflush(stdout));