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 2011/02/14 15:39:08 UTC

svn commit: r1070508 - /subversion/trunk/subversion/svn/add-cmd.c

Author: stsp
Date: Mon Feb 14 14:39:08 2011
New Revision: 1070508

URL: http://svn.apache.org/viewvc?rev=1070508&view=rev
Log:
* subversion/svn/add-cmd.c
  (svn_cl__add): If one or more target fails to get processed then print
    error message at end of command execution. Also return 1 to shell.

Patch by: Noorul Islam K M <noorul{_AT_}collab.net>

Modified:
    subversion/trunk/subversion/svn/add-cmd.c

Modified: subversion/trunk/subversion/svn/add-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/add-cmd.c?rev=1070508&r1=1070507&r2=1070508&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/add-cmd.c (original)
+++ subversion/trunk/subversion/svn/add-cmd.c Mon Feb 14 14:39:08 2011
@@ -51,6 +51,7 @@ svn_cl__add(apr_getopt_t *os,
   apr_array_header_t *targets;
   int i;
   apr_pool_t *iterpool;
+  svn_boolean_t seen_nonexistent_target = FALSE;
 
   SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
                                                       opt_state->targets,
@@ -79,6 +80,7 @@ svn_cl__add(apr_getopt_t *os,
   for (i = 0; i < targets->nelts; i++)
     {
       const char *target = APR_ARRAY_IDX(targets, i, const char *);
+      svn_boolean_t success;
 
       svn_pool_clear(iterpool);
       SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));
@@ -87,12 +89,21 @@ svn_cl__add(apr_getopt_t *os,
                                opt_state->depth,
                                opt_state->force, opt_state->no_ignore,
                                opt_state->parents, ctx, iterpool),
-               NULL, opt_state->quiet,
+               &success, opt_state->quiet,
                SVN_ERR_ENTRY_EXISTS,
                SVN_ERR_WC_PATH_NOT_FOUND,
                SVN_NO_ERROR));
+
+      if (! success)
+        seen_nonexistent_target = TRUE;
     }
 
   svn_pool_destroy(iterpool);
-  return SVN_NO_ERROR;
+
+  if (seen_nonexistent_target)
+    return svn_error_create(
+      SVN_ERR_ILLEGAL_TARGET, NULL,
+      _("Could not add all targets because some targets don't exist"));
+  else
+    return SVN_NO_ERROR;
 }