Fix compiler warning due to missing function prototype.
[svn.git] / subversion / svn / update-cmd.c
blob99110ece5f28241c038f3ef58b9c6530bbc4f887
1 /*
2 * update-cmd.c -- Bring work tree in sync with repository
4 * ====================================================================
5 * Copyright (c) 2000-2007 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. ***/
25 #include "svn_pools.h"
26 #include "svn_client.h"
27 #include "svn_path.h"
28 #include "svn_error_codes.h"
29 #include "svn_error.h"
30 #include "cl.h"
32 #include "svn_private_config.h"
35 /*** Code. ***/
37 /* This implements the `svn_opt_subcommand_t' interface. */
38 svn_error_t *
39 svn_cl__update(apr_getopt_t *os,
40 void *baton,
41 apr_pool_t *pool)
43 svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
44 svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
45 apr_array_header_t *targets;
46 svn_depth_t depth;
47 svn_boolean_t depth_is_sticky;
49 SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
50 opt_state->targets,
51 ctx, pool));
53 /* Add "." if user passed 0 arguments */
54 svn_opt_push_implicit_dot_target(targets, pool);
56 /* If using changelists, convert targets into a set of paths that
57 match the specified changelist(s). */
58 if (opt_state->changelists)
60 svn_depth_t cl_depth = opt_state->depth;
61 if (cl_depth == svn_depth_unknown)
62 cl_depth = svn_depth_infinity;
63 SVN_ERR(svn_cl__changelist_paths(&targets,
64 opt_state->changelists, targets,
65 cl_depth, ctx, pool));
68 if (! opt_state->quiet)
69 svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
70 FALSE, FALSE, FALSE, pool);
72 /* Deal with depthstuffs. */
73 if (opt_state->set_depth != svn_depth_unknown)
75 depth = opt_state->set_depth;
76 depth_is_sticky = TRUE;
78 else
80 depth = opt_state->depth;
81 depth_is_sticky = FALSE;
84 SVN_ERR(svn_client_update3(NULL, targets,
85 &(opt_state->start_revision),
86 depth, depth_is_sticky,
87 opt_state->ignore_externals,
88 opt_state->force,
89 ctx, pool));
91 return SVN_NO_ERROR;