2 * cleanup-cmd.c -- Subversion cleanup command
4 * ====================================================================
5 * Copyright (c) 2000-2004 CollabNet. All rights reserved.
7 * This software is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at http://subversion.tigris.org/license-1.html.
10 * If newer versions of this license are posted there, you may use a
11 * newer version instead, at your option.
13 * This software consists of voluntary contributions made by many
14 * individuals. For exact contribution history, see the revision
15 * history and logs, available at http://subversion.tigris.org/.
16 * ====================================================================
19 /* ==================================================================== */
25 #include "svn_client.h"
26 #include "svn_pools.h"
27 #include "svn_error.h"
34 /* This implements the `svn_opt_subcommand_t' interface. */
36 svn_cl__cleanup(apr_getopt_t
*os
,
40 svn_cl__opt_state_t
*opt_state
= ((svn_cl__cmd_baton_t
*) baton
)->opt_state
;
41 svn_client_ctx_t
*ctx
= ((svn_cl__cmd_baton_t
*) baton
)->ctx
;
42 apr_array_header_t
*targets
;
46 SVN_ERR(svn_opt_args_to_target_array2(&targets
, os
,
47 opt_state
->targets
, pool
));
49 /* Add "." if user passed 0 arguments */
50 svn_opt_push_implicit_dot_target(targets
, pool
);
52 subpool
= svn_pool_create(pool
);
53 for (i
= 0; i
< targets
->nelts
; i
++)
55 const char *target
= APR_ARRAY_IDX(targets
, i
, const char *);
57 svn_pool_clear(subpool
);
58 SVN_ERR(svn_cl__check_cancel(ctx
->cancel_baton
));
59 SVN_ERR(svn_client_cleanup(target
, ctx
, subpool
));
62 svn_pool_destroy(subpool
);