2 * resolved-cmd.c -- Subversion resolved subcommand
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 /* ==================================================================== */
24 #define APR_WANT_STDIO
27 #include "svn_client.h"
28 #include "svn_error.h"
29 #include "svn_pools.h"
32 #include "svn_private_config.h"
38 /* This implements the `svn_opt_subcommand_t' interface. */
40 svn_cl__resolved(apr_getopt_t
*os
,
44 svn_cl__opt_state_t
*opt_state
= ((svn_cl__cmd_baton_t
*) baton
)->opt_state
;
45 svn_client_ctx_t
*ctx
= ((svn_cl__cmd_baton_t
*) baton
)->ctx
;
46 svn_wc_conflict_choice_t conflict_choice
;
48 apr_array_header_t
*targets
;
52 switch (opt_state
->accept_which
)
54 case svn_cl__accept_invalid
:
55 conflict_choice
= svn_wc_conflict_choose_merged
;
57 case svn_cl__accept_base
:
58 conflict_choice
= svn_wc_conflict_choose_base
;
60 case svn_cl__accept_theirs_conflict
:
61 conflict_choice
= svn_wc_conflict_choose_theirs_conflict
;
63 case svn_cl__accept_mine_conflict
:
64 conflict_choice
= svn_wc_conflict_choose_mine_conflict
;
66 case svn_cl__accept_theirs_full
:
67 conflict_choice
= svn_wc_conflict_choose_theirs_full
;
69 case svn_cl__accept_mine_full
:
70 conflict_choice
= svn_wc_conflict_choose_mine_full
;
73 return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR
, NULL
,
74 _("invalid 'accept' ARG"));
77 SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets
, os
,
81 return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS
, 0, NULL
);
83 subpool
= svn_pool_create(pool
);
84 if (! opt_state
->quiet
)
85 svn_cl__get_notifier(&ctx
->notify_func2
, &ctx
->notify_baton2
, FALSE
,
88 if (opt_state
->depth
== svn_depth_unknown
)
89 opt_state
->depth
= svn_depth_empty
;
91 for (i
= 0; i
< targets
->nelts
; i
++)
93 const char *target
= APR_ARRAY_IDX(targets
, i
, const char *);
94 svn_pool_clear(subpool
);
95 SVN_ERR(svn_cl__check_cancel(ctx
->cancel_baton
));
96 err
= svn_client_resolved2(target
,
97 opt_state
->depth
, conflict_choice
,
102 svn_handle_warning(stderr
, err
);
103 svn_error_clear(err
);
107 svn_pool_destroy(subpool
);