You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by vi...@collab.net on 2005/06/08 08:03:25 UTC

[PATCH] use svn_cl__try for svn add

Use svn_cl__try for skipping non-fatal errors.

* subversion/clients/cmdline/add-cmd.c
  (svn_cl__add): Removed the variable
  err, use svn_cl__try.


Re: [PATCH] use svn_cl__try for svn add

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Wed, 8 Jun 2005 vivek@collab.net wrote:

> Use svn_cl__try for skipping non-fatal errors.
>
> * subversion/clients/cmdline/add-cmd.c
>   (svn_cl__add): Removed the variable
>   err, use svn_cl__try.
>
>
Oh, nice! I sometimes have to use a 40 character display... But you can
keep this on one ine.  (I'm not kidding about my display width, but
it's not often these days...)

> Index: subversion/clients/cmdline/add-cmd.c
> ===================================================================
> --- subversion/clients/cmdline/add-cmd.c	(revision 15006)
> +++ subversion/clients/cmdline/add-cmd.c	(working copy)
> @@ -41,7 +41,6 @@
>  {
>    svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
>    svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
> -  svn_error_t *err;
>    apr_array_header_t *targets;
>    int i;
>    apr_pool_t *subpool;
> @@ -63,19 +62,14 @@
>
>        svn_pool_clear (subpool);
>        SVN_ERR (svn_cl__check_cancel (ctx->cancel_baton));
> -      err = svn_client_add3 (target, (! opt_state->nonrecursive),
> +      SVN_ERR (svn_cl__try( svn_client_add3 (target,

Put spaces before, not after the paren.

> +                             (! opt_state->nonrecursive),
>                               opt_state->force, opt_state->no_ignore,
> -                             ctx, subpool);

Indentation.

> -      if (err)
> -        {
> -          if (err->apr_err == SVN_ERR_ENTRY_EXISTS)
> -            {
> -              svn_handle_warning (stderr, err);
> -              svn_error_clear (err);
> -            }
> -          else
> -            return err;
> -        }
> +                             ctx, subpool),
> +                NULL, opt_state->quiet,
> +                SVN_ERR_ENTRY_EXISTS,
> +                SVN_ERR_WC_PATH_NOT_FOUND,
> +                SVN_NO_ERROR));

And so is this.

>      }
>
>    svn_pool_destroy (subpool);

Best Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org