Skip a test when run against old servers.
[svn.git] / subversion / svn / resolve-cmd.c
blobaaf43e623085de5c42261eddbbfa4fd2a78cd334
1 /*
2 * resolve-cmd.c -- Subversion resolve subcommand
4 * ====================================================================
5 * Copyright (c) 2008 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 /* ==================================================================== */
23 /*** Includes. ***/
24 #define APR_WANT_STDIO
25 #include <apr_want.h>
27 #include "svn_client.h"
28 #include "svn_error.h"
29 #include "svn_pools.h"
30 #include "cl.h"
32 #include "svn_private_config.h"
36 /*** Code. ***/
38 /* This implements the `svn_opt_subcommand_t' interface. */
39 svn_error_t *
40 svn_cl__resolve(apr_getopt_t *os,
41 void *baton,
42 apr_pool_t *pool)
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;
47 svn_error_t *err;
48 apr_array_header_t *targets;
49 int i;
50 apr_pool_t *subpool;
52 switch (opt_state->accept_which)
54 case svn_cl__accept_working:
55 conflict_choice = svn_wc_conflict_choose_merged;
56 break;
57 case svn_cl__accept_base:
58 conflict_choice = svn_wc_conflict_choose_base;
59 break;
60 case svn_cl__accept_theirs_conflict:
61 conflict_choice = svn_wc_conflict_choose_theirs_conflict;
62 break;
63 case svn_cl__accept_mine_conflict:
64 conflict_choice = svn_wc_conflict_choose_mine_conflict;
65 break;
66 case svn_cl__accept_theirs_full:
67 conflict_choice = svn_wc_conflict_choose_theirs_full;
68 break;
69 case svn_cl__accept_mine_full:
70 conflict_choice = svn_wc_conflict_choose_mine_full;
71 break;
72 case svn_cl__accept_unspecified:
73 return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
74 _("missing --accept option"));
75 default:
76 return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
77 _("invalid 'accept' ARG"));
80 SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
81 opt_state->targets,
82 pool));
83 if (! targets->nelts)
84 return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, 0, NULL);
86 subpool = svn_pool_create(pool);
87 if (! opt_state->quiet)
88 svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2, FALSE,
89 FALSE, FALSE, pool);
91 if (opt_state->depth == svn_depth_unknown)
92 opt_state->depth = svn_depth_empty;
94 for (i = 0; i < targets->nelts; i++)
96 const char *target = APR_ARRAY_IDX(targets, i, const char *);
97 svn_pool_clear(subpool);
98 SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));
99 err = svn_client_resolve(target,
100 opt_state->depth, conflict_choice,
101 ctx,
102 subpool);
103 if (err)
105 svn_handle_warning(stderr, err);
106 svn_error_clear(err);
110 svn_pool_destroy(subpool);
111 return SVN_NO_ERROR;