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 /* ==================================================================== */
25 #include "svn_pools.h"
26 #include "svn_client.h"
28 #include "svn_error_codes.h"
29 #include "svn_error.h"
32 #include "svn_private_config.h"
37 /* This implements the `svn_opt_subcommand_t' interface. */
39 svn_cl__update(apr_getopt_t
*os
,
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
;
47 svn_boolean_t depth_is_sticky
;
49 SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets
, os
,
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
;
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
,