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_opt_args_to_target_array3(&targets
, os
,
50 opt_state
->targets
, pool
));
52 /* Add "." if user passed 0 arguments */
53 svn_opt_push_implicit_dot_target(targets
, pool
);
55 /* If using changelists, convert targets into a set of paths that
56 match the specified changelist(s). */
57 if (opt_state
->changelists
)
59 svn_depth_t cl_depth
= opt_state
->depth
;
60 if (cl_depth
== svn_depth_unknown
)
61 cl_depth
= svn_depth_infinity
;
62 SVN_ERR(svn_cl__changelist_paths(&targets
,
63 opt_state
->changelists
, targets
,
64 cl_depth
, ctx
, pool
));
67 if (! opt_state
->quiet
)
68 svn_cl__get_notifier(&ctx
->notify_func2
, &ctx
->notify_baton2
,
69 FALSE
, FALSE
, FALSE
, pool
);
71 /* Deal with depthstuffs. */
72 if (opt_state
->set_depth
!= svn_depth_unknown
)
74 depth
= opt_state
->set_depth
;
75 depth_is_sticky
= TRUE
;
79 depth
= opt_state
->depth
;
80 depth_is_sticky
= FALSE
;
83 SVN_ERR(svn_client_update3(NULL
, targets
,
84 &(opt_state
->start_revision
),
85 depth
, depth_is_sticky
,
86 opt_state
->ignore_externals
,