On 11.06.2015 15:29, Branko Čibej wrote:
> I think we're at the point where we're trying to polish the UI. It is
> rather late in the day for that. The minor tweak required in svnadmin to
> emit errors in --quiet mode can be pushed into RC3

Perhaps something along the lines of the patch below. Note that this
patch makes subcommand_verify behave differently wrt --quiet than all
the other commends; on the other hand, this is the only command that
accepts a --keep-going flag, so I guess that's fine.

-- Brane

Index: subversion/svnadmin/svnadmin.c
===================================================================
--- subversion/svnadmin/svnadmin.c      (revision 1684887)
+++ subversion/svnadmin/svnadmin.c      (working copy)
@@ -868,6 +868,9 @@ struct repos_notify_handler_baton {
   /* Stream to write progress and other non-error output to. */
   svn_stream_t *feedback_stream;
 
+  /* Suppress notifications that are neither errors nor warnings. */
+  svn_boolean_t silent_running;
+
   /* Whether errors contained in notifications should be printed along
      with the notification. If FALSE, any errors will only be
      summarized. */
@@ -891,6 +894,14 @@ repos_notify_handler(void *baton,
   struct repos_notify_handler_baton *b = baton;
   svn_stream_t *feedback_stream = b->feedback_stream;
 
+  /* Don't print anything if the feedback stream isn't provided.
+     Only print errors and warnings in silent mode. */
+  if (!feedback_stream
+      || (b->silent_running
+          && notify->action != svn_repos_notify_warning
+          && notify->action != svn_repos_notify_failure))
+    return;
+
   switch (notify->action)
   {
     case svn_repos_notify_warning:
@@ -1838,9 +1849,11 @@ subcommand_verify(apr_getopt_t *os, void *baton, a
       upper = lower;
     }
 
-  if (! opt_state->quiet)
-    notify_baton.feedback_stream = recode_stream_create(stdout, pool);
+  notify_baton.feedback_stream = recode_stream_create(stdout, pool);
 
+  if (opt_state->quiet)
+    notify_baton.silent_running = TRUE;
+
   if (opt_state->keep_going)
     notify_baton.error_summary =
       apr_array_make(pool, 0, sizeof(struct verification_error *));
@@ -1853,10 +1866,8 @@ subcommand_verify(apr_getopt_t *os, void *baton, a
                                     opt_state->keep_going,
                                     opt_state->check_normalization,
                                     opt_state->metadata_only,
-                                    !opt_state->quiet
-                                    ? repos_notify_handler : NULL,
-                                    &notify_baton, check_cancel,
-                                    NULL, pool);
+                                    repos_notify_handler, &notify_baton,
+                                    check_cancel, NULL, pool);
 
   /* Show the --keep-going error summary. */
   if (opt_state->keep_going && notify_baton.error_summary->nelts > 0)

Reply via email to