You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/04/19 20:29:41 UTC

svn commit: r1095159 - in /subversion/trunk/subversion: include/svn_wc.h svn/notify.c svn/propset-cmd.c

Author: hwright
Date: Tue Apr 19 18:29:40 2011
New Revision: 1095159

URL: http://svn.apache.org/viewvc?rev=1095159&view=rev
Log:
Add a new notification action which allows notifiers to emit a non-fatal
warning.

* subversion/svn/propset-cmd.c
  (svn_cl__propset): Replace the use of svn_cl__try() with a manual
    construction of a warning notification.  This is intended mainly as
    a test, and will be removed in a bit.

* subversion/svn/notify.c
  (notify): Handle the new action type.

* subversion/include/svn_wc.h
  (svn_wc_notify_warning): New value.
  (svn_wc_notify_t): Update docs.

Modified:
    subversion/trunk/subversion/include/svn_wc.h
    subversion/trunk/subversion/svn/notify.c
    subversion/trunk/subversion/svn/propset-cmd.c

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1095159&r1=1095158&r2=1095159&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Tue Apr 19 18:29:40 2011
@@ -1168,7 +1168,11 @@ typedef enum svn_wc_notify_action_t
   /** The server has instructed the client to follow a URL
    * redirection.
    * @since New in 1.7. */
-  svn_wc_notify_url_redirect
+  svn_wc_notify_url_redirect,
+
+  /** A warning has been issued.
+   * @since New in 1.7. */
+  svn_wc_notify_warning
 
 } svn_wc_notify_action_t;
 
@@ -1277,7 +1281,8 @@ typedef struct svn_wc_notify_t {
 
   /** Points to an error describing the reason for the failure when @c
    * action is one of the following: #svn_wc_notify_failed_lock,
-   * #svn_wc_notify_failed_unlock, #svn_wc_notify_failed_external.
+   * #svn_wc_notify_failed_unlock, #svn_wc_notify_failed_external,
+   * #svn_wc_notify_warning.
    * Is @c NULL otherwise. */
   svn_error_t *err;
 

Modified: subversion/trunk/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/notify.c?rev=1095159&r1=1095158&r2=1095159&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/notify.c (original)
+++ subversion/trunk/subversion/svn/notify.c Tue Apr 19 18:29:40 2011
@@ -942,6 +942,10 @@ notify(void *baton, const svn_wc_notify_
         goto print_error;
       break;
 
+    case svn_wc_notify_warning:
+      svn_handle_warning2(stderr, n->err, "svn: ");
+      break;
+
     default:
       break;
     }

Modified: subversion/trunk/subversion/svn/propset-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/propset-cmd.c?rev=1095159&r1=1095158&r2=1095159&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/propset-cmd.c (original)
+++ subversion/trunk/subversion/svn/propset-cmd.c Tue Apr 19 18:29:40 2011
@@ -176,19 +176,34 @@ svn_cl__propset(apr_getopt_t *os,
       for (i = 0; i < targets->nelts; i++)
         {
           const char *target = APR_ARRAY_IDX(targets, i, const char *);
+          svn_error_t *err;
 
           svn_pool_clear(iterpool);
           SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));
-          SVN_ERR(svn_cl__try(svn_client_propset4(
+
+          err = svn_client_propset4(
                                pname_utf8, propval, target,
                                opt_state->depth, opt_state->force,
                                SVN_INVALID_REVNUM, opt_state->changelists,
                                NULL, svn_cl__print_commit_info, NULL, ctx,
-                               iterpool),
-                              NULL, opt_state->quiet,
-                              SVN_ERR_UNVERSIONED_RESOURCE,
-                              SVN_ERR_ENTRY_NOT_FOUND,
-                              SVN_NO_ERROR));
+                               iterpool);
+          if (err && (err->apr_err == SVN_ERR_UNVERSIONED_RESOURCE
+                   || err->apr_err == SVN_ERR_ENTRY_NOT_FOUND) )
+            {
+              if (! opt_state->quiet)
+                {
+                  svn_wc_notify_t *notify = svn_wc_create_notify(NULL,
+                                                         svn_wc_notify_warning,
+                                                         iterpool);
+
+                  notify->err = err;
+                  ctx->notify_func2(ctx->notify_baton, notify, iterpool);
+                }
+
+              svn_error_clear(err);
+            }
+          else if (err)
+            return err;
 
           if (! opt_state->quiet)
             svn_cl__check_boolean_prop_val(pname_utf8, propval->data, iterpool);