00001 /**
00002 * @copyright
00003 * ====================================================================
00004 * Copyright (c) 2000-2004 CollabNet. All rights reserved.
00005 *
00006 * This software is licensed as described in the file COPYING, which
00007 * you should have received as part of this distribution. The terms
00008 * are also available at http://subversion.tigris.org/license-1.html.
00009 * If newer versions of this license are posted there, you may use a
00010 * newer version instead, at your option.
00011 *
00012 * This software consists of voluntary contributions made by many
00013 * individuals. For exact contribution history, see the revision
00014 * history and logs, available at http://subversion.tigris.org/.
00015 * ====================================================================
00016 * @endcopyright
00017 *
00018 * @file svn_client.h
00019 * @brief Public interface for libsvn_client.
00020 */
00021
00022
00023
00024 /*** Includes ***/
00025
00026 /*
00027 * Requires: The working copy library and repository access library.
00028 * Provides: Broad wrappers around working copy library functionality.
00029 * Used By: Client programs.
00030 */
00031
00032 #ifndef SVN_CLIENT_H
00033 #define SVN_CLIENT_H
00034
00035 #include <apr_tables.h>
00036
00037 #include "svn_types.h"
00038 #include "svn_wc.h"
00039 #include "svn_string.h"
00040 #include "svn_error.h"
00041 #include "svn_opt.h"
00042 #include "svn_version.h"
00043 #include "svn_ra.h"
00044
00045
00046 #ifdef __cplusplus
00047 extern "C" {
00048 #endif /* __cplusplus */
00049
00050
00051 /* ### TODO: Multiple Targets
00052
00053 - Up for debate: an update on multiple targets is *not* atomic.
00054 Right now, svn_client_update only takes one path. What's
00055 debatable is whether this should ever change. On the one hand,
00056 it's kind of losing to have the client application loop over
00057 targets and call svn_client_update() on each one; each call to
00058 update initializes a whole new repository session (network
00059 overhead, etc.) On the other hand, it's a very simple
00060 implementation, and allows for the possibility that different
00061 targets may come from different repositories. */
00062
00063
00064 /**
00065 * Get libsvn_client version information.
00066 *
00067 * @since New in 1.1.
00068 */
00069 const svn_version_t *svn_client_version (void);
00070
00071
00072
00073 /*** Authentication stuff ***/
00074
00075 /* The new authentication system allows the RA layer to "pull"
00076 information as needed from libsvn_client. See svn_ra.h */
00077
00078 /** Create and return @a *provider, an authentication provider of type
00079 * svn_auth_cred_simple_t that gets information by prompting the user
00080 * with @a prompt_func and @a prompt_baton. Allocate @a *provider in
00081 * @a pool.
00082 *
00083 * If both @c SVN_AUTH_PARAM_DEFAULT_USERNAME and
00084 * @c SVN_AUTH_PARAM_DEFAULT_PASSWORD are defined as runtime
00085 * parameters in the @c auth_baton, then @a *provider will return the
00086 * default arguments when svn_auth_first_credentials() is called. If
00087 * svn_auth_first_credentials() fails, then @a *provider will
00088 * re-prompt @a retry_limit times (via svn_auth_next_credentials()).
00089 */
00090 void svn_client_get_simple_prompt_provider (
00091 svn_auth_provider_object_t **provider,
00092 svn_auth_simple_prompt_func_t prompt_func,
00093 void *prompt_baton,
00094 int retry_limit,
00095 apr_pool_t *pool);
00096
00097
00098 /** Create and return @a *provider, an authentication provider of type @c
00099 * svn_auth_cred_username_t that gets information by prompting the
00100 * user with @a prompt_func and @a prompt_baton. Allocate @a *provider
00101 * in @a pool.
00102 *
00103 * If @c SVN_AUTH_PARAM_DEFAULT_USERNAME is defined as a runtime
00104 * parameter in the @c auth_baton, then @a *provider will return the
00105 * default argument when svn_auth_first_credentials() is called. If
00106 * svn_auth_first_credentials() fails, then @a *provider will
00107 * re-prompt @a retry_limit times (via svn_auth_next_credentials()).
00108 */
00109 void svn_client_get_username_prompt_provider (
00110 svn_auth_provider_object_t **provider,
00111 svn_auth_username_prompt_func_t prompt_func,
00112 void *prompt_baton,
00113 int retry_limit,
00114 apr_pool_t *pool);
00115
00116
00117 /** Create and return @a *provider, an authentication provider of type @c
00118 * svn_auth_cred_simple_t that gets/sets information from the user's
00119 * ~/.subversion configuration directory. Allocate @a *provider in
00120 * @a pool.
00121 *
00122 * If a default username or password is available, @a *provider will
00123 * honor them as well, and return them when
00124 * svn_auth_first_credentials() is called. (see @c
00125 * SVN_AUTH_PARAM_DEFAULT_USERNAME and @c
00126 * SVN_AUTH_PARAM_DEFAULT_PASSWORD).
00127 */
00128 void svn_client_get_simple_provider (svn_auth_provider_object_t **provider,
00129 apr_pool_t *pool);
00130
00131
00132 #if defined(WIN32) || defined(DOXYGEN)
00133 /**
00134 * Create and return @a *provider, an authentication provider of type @c
00135 * svn_auth_cred_simple_t that gets/sets information from the user's
00136 * ~/.subversion configuration directory. Allocate @a *provider in
00137 * @a pool.
00138 *
00139 * This is like svn_client_get_simple_provider(), except that, when
00140 * running on Window 2000 or newer (or any other Windows version that
00141 * includes the CryptoAPI), the provider encrypts the password before
00142 * storing it to disk. On earlier versions of Windows, the provider
00143 * does nothing.
00144 *
00145 * @since New in 1.2.
00146 * @note This function is only available on Windows.
00147 *
00148 * @note An administrative password reset may invalidate the account's
00149 * secret key. This function will detect that situation and behave as
00150 * if the password were not cached at all.
00151 */
00152 void svn_client_get_windows_simple_provider (
00153 svn_auth_provider_object_t **provider,
00154 apr_pool_t *pool);
00155 #endif /* WIN32 || DOXYGEN */
00156
00157 /** Create and return @a *provider, an authentication provider of type @c
00158 * svn_auth_cred_username_t that gets/sets information from a user's
00159 * ~/.subversion configuration directory. Allocate @a *provider in
00160 * @a pool.
00161 *
00162 * If a default username is available, @a *provider will honor it,
00163 * and return it when svn_auth_first_credentials() is called. (see
00164 * @c SVN_AUTH_PARAM_DEFAULT_USERNAME).
00165 */
00166 void svn_client_get_username_provider (svn_auth_provider_object_t **provider,
00167 apr_pool_t *pool);
00168
00169
00170 /** Create and return @a *provider, an authentication provider of type @c
00171 * svn_auth_cred_ssl_server_trust_t, allocated in @a pool.
00172 *
00173 * @a *provider retrieves its credentials from the configuration
00174 * mechanism. The returned credential is used to override SSL
00175 * security on an error.
00176 */
00177 void svn_client_get_ssl_server_trust_file_provider (
00178 svn_auth_provider_object_t **provider,
00179 apr_pool_t *pool);
00180
00181
00182 /** Create and return @a *provider, an authentication provider of type @c
00183 * svn_auth_cred_ssl_client_cert_t, allocated in @a pool.
00184 *
00185 * @a *provider retrieves its credentials from the configuration
00186 * mechanism. The returned credential is used to load the appropriate
00187 * client certificate for authentication when requested by a server.
00188 */
00189 void svn_client_get_ssl_client_cert_file_provider (
00190 svn_auth_provider_object_t **provider,
00191 apr_pool_t *pool);
00192
00193
00194 /** Create and return @a *provider, an authentication provider of type @c
00195 * svn_auth_cred_ssl_client_cert_pw_t, allocated in @a pool.
00196 *
00197 * @a *provider retrieves its credentials from the configuration
00198 * mechanism. The returned credential is used when a loaded client
00199 * certificate is protected by a passphrase.
00200 */
00201 void svn_client_get_ssl_client_cert_pw_file_provider (
00202 svn_auth_provider_object_t **provider,
00203 apr_pool_t *pool);
00204
00205
00206 /** Create and return @a *provider, an authentication provider of type @c
00207 * svn_auth_cred_ssl_server_trust_t, allocated in @a pool.
00208 *
00209 * @a *provider retrieves its credentials by using the @a prompt_func
00210 * and @a prompt_baton. The returned credential is used to override
00211 * SSL security on an error.
00212 */
00213 void svn_client_get_ssl_server_trust_prompt_provider (
00214 svn_auth_provider_object_t **provider,
00215 svn_auth_ssl_server_trust_prompt_func_t prompt_func,
00216 void *prompt_baton,
00217 apr_pool_t *pool);
00218
00219
00220 /** Create and return @a *provider, an authentication provider of type @c
00221 * svn_auth_cred_ssl_client_cert_t, allocated in @a pool.
00222 *
00223 * @a *provider retrieves its credentials by using the @a prompt_func
00224 * and @a prompt_baton. The returned credential is used to load the
00225 * appropriate client certificate for authentication when requested by
00226 * a server. The prompt will be retried @a retry_limit times.
00227 */
00228 void svn_client_get_ssl_client_cert_prompt_provider (
00229 svn_auth_provider_object_t **provider,
00230 svn_auth_ssl_client_cert_prompt_func_t prompt_func,
00231 void *prompt_baton,
00232 int retry_limit,
00233 apr_pool_t *pool);
00234
00235
00236 /** Create and return @a *provider, an authentication provider of type @c
00237 * svn_auth_cred_ssl_client_cert_pw_t, allocated in @a pool.
00238 *
00239 * @a *provider retrieves its credentials by using the @a prompt_func
00240 * and @a prompt_baton. The returned credential is used when a loaded
00241 * client certificate is protected by a passphrase. The prompt will
00242 * be retried @a retry_limit times.
00243 */
00244 void svn_client_get_ssl_client_cert_pw_prompt_provider (
00245 svn_auth_provider_object_t **provider,
00246 svn_auth_ssl_client_cert_pw_prompt_func_t prompt_func,
00247 void *prompt_baton,
00248 int retry_limit,
00249 apr_pool_t *pool);
00250
00251
00252 /** This is a structure which stores a filename and a hash of property
00253 * names and values.
00254 */
00255 typedef struct svn_client_proplist_item_t
00256 {
00257 /** The name of the node on which these properties are set. */
00258 svn_stringbuf_t *node_name;
00259
00260 /** A hash of (const char *) property names, and (svn_string_t *) property
00261 * values. */
00262 apr_hash_t *prop_hash;
00263
00264 } svn_client_proplist_item_t;
00265
00266 /**
00267 * Return a duplicate of @a item, allocated in @a pool. No part of the new
00268 * structure will be shared with @a item.
00269 *
00270 * @since New in 1.3.
00271 */
00272 svn_client_proplist_item_t *
00273 svn_client_proplist_item_dup (const svn_client_proplist_item_t *item,
00274 apr_pool_t *pool);
00275
00276 /** Information about commits passed back to client from this module.
00277 *
00278 * @deprecated Provided for backward compatibility with the 1.2 API.
00279 */
00280 typedef struct svn_client_commit_info_t
00281 {
00282 /** just-committed revision. */
00283 svn_revnum_t revision;
00284
00285 /** server-side date of the commit. */
00286 const char *date;
00287
00288 /** author of the commit. */
00289 const char *author;
00290
00291 } svn_client_commit_info_t;
00292
00293
00294 /**
00295 * @name Commit state flags
00296 * @brief State flags for use with the @c svn_client_commit_item2_t structure
00297 * (see the note about the namespace for that structure, which also
00298 * applies to these flags).
00299 * @{
00300 */
00301 #define SVN_CLIENT_COMMIT_ITEM_ADD 0x01
00302 #define SVN_CLIENT_COMMIT_ITEM_DELETE 0x02
00303 #define SVN_CLIENT_COMMIT_ITEM_TEXT_MODS 0x04
00304 #define SVN_CLIENT_COMMIT_ITEM_PROP_MODS 0x08
00305 #define SVN_CLIENT_COMMIT_ITEM_IS_COPY 0x10
00306 /** @since New in 1.2. */
00307 #define SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN 0x20
00308 /** @} */
00309
00310 /** The commit candidate structure.
00311 *
00312 * @since New in 1.3.
00313 */
00314 typedef struct svn_client_commit_item2_t
00315 {
00316 /** absolute working-copy path of item */
00317 const char *path;
00318
00319 /** node kind (dir, file) */
00320 svn_node_kind_t kind;
00321
00322 /** commit URL for this item */
00323 const char *url;
00324
00325 /** revision of textbase */
00326 svn_revnum_t revision;
00327
00328 /** copyfrom-url or NULL if not a copied item */
00329 const char *copyfrom_url;
00330
00331 /** copyfrom-rev, valid when copyfrom_url != NULL */
00332 svn_revnum_t copyfrom_rev;
00333
00334 /** state flags */
00335 apr_byte_t state_flags;
00336
00337 /** An array of `svn_prop_t *' changes to wc properties. If adding
00338 * to this array, allocate the svn_prop_t and its contents in
00339 * wcprop_changes->pool, so that it has the same lifetime as this
00340 * svn_client_commit_item_t.
00341 *
00342 * See http://subversion.tigris.org/issues/show_bug.cgi?id=806 for
00343 * what would happen if the post-commit process didn't group these
00344 * changes together with all other changes to the item :-).
00345 */
00346 apr_array_header_t *wcprop_changes;
00347 } svn_client_commit_item2_t;
00348
00349 /**
00350 * Return a duplicate of @a item, allocated in @a pool. No part of the new
00351 * structure will be shared with @a item.
00352 *
00353 * @since New in 1.3.
00354 */
00355 svn_client_commit_item2_t *
00356 svn_client_commit_item2_dup (const svn_client_commit_item2_t *item,
00357 apr_pool_t *pool);
00358
00359 /** The commit candidate structure.
00360 *
00361 * @deprecated Provided for backward compatibility with the 1.2 API.
00362 */
00363 typedef struct svn_client_commit_item_t
00364 {
00365 /** absolute working-copy path of item */
00366 const char *path;
00367
00368 /** node kind (dir, file) */
00369 svn_node_kind_t kind;
00370
00371 /** commit URL for this item */
00372 const char *url;
00373
00374 /** revision (copyfrom-rev if _IS_COPY) */
00375 svn_revnum_t revision;
00376
00377 /** copyfrom-url */
00378 const char *copyfrom_url;
00379
00380 /** state flags */
00381 apr_byte_t state_flags;
00382
00383 /** An array of `svn_prop_t *' changes to wc properties. If adding
00384 * to this array, allocate the svn_prop_t and its contents in
00385 * wcprop_changes->pool, so that it has the same lifetime as this
00386 * svn_client_commit_item_t.
00387 *
00388 * See http://subversion.tigris.org/issues/show_bug.cgi?id=806 for
00389 * what would happen if the post-commit process didn't group these
00390 * changes together with all other changes to the item :-).
00391 */
00392 apr_array_header_t *wcprop_changes;
00393
00394 } svn_client_commit_item_t;
00395
00396
00397 /** Callback type used by commit-y operations to get a commit log message
00398 * from the caller.
00399 *
00400 * Set @a *log_msg to the log message for the commit, allocated in @a
00401 * pool, or @c NULL if wish to abort the commit process. Set @a *tmp_file
00402 * to the path of any temporary file which might be holding that log
00403 * message, or @c NULL if no such file exists (though, if @a *log_msg is
00404 * @c NULL, this value is undefined). The log message MUST be a UTF8
00405 * string with LF line separators.
00406 *
00407 * @a commit_items is a read-only array of @c svn_client_commit_item2_t
00408 * structures, which may be fully or only partially filled-in,
00409 * depending on the type of commit operation.
00410 *
00411 * @a baton is provided along with the callback for use by the handler.
00412 *
00413 * All allocations should be performed in @a pool.
00414 *
00415 * @since New in 1.3.
00416 */
00417 typedef svn_error_t *
00418 (*svn_client_get_commit_log2_t) (const char **log_msg,
00419 const char **tmp_file,
00420 const apr_array_header_t *commit_items,
00421 void *baton,
00422 apr_pool_t *pool);
00423
00424 /** Callback type used by commit-y operations to get a commit log message
00425 * from the caller.
00426 *
00427 * Set @a *log_msg to the log message for the commit, allocated in @a
00428 * pool, or @c NULL if wish to abort the commit process. Set @a *tmp_file
00429 * to the path of any temporary file which might be holding that log
00430 * message, or @c NULL if no such file exists (though, if @a *log_msg is
00431 * @c NULL, this value is undefined). The log message MUST be a UTF8
00432 * string with LF line separators.
00433 *
00434 * @a commit_items is a read-only array of @c svn_client_commit_item_t
00435 * structures, which may be fully or only partially filled-in,
00436 * depending on the type of commit operation.
00437 *
00438 * @a baton is provided along with the callback for use by the handler.
00439 *
00440 * All allocations should be performed in @a pool.
00441 *
00442 * @deprecated Provided for backward compatibility with the 1.2 API.
00443 */
00444 typedef svn_error_t *
00445 (*svn_client_get_commit_log_t) (const char **log_msg,
00446 const char **tmp_file,
00447 apr_array_header_t *commit_items,
00448 void *baton,
00449 apr_pool_t *pool);
00450
00451 /** Callback type used by svn_client_blame() to notify the caller
00452 * that line @a line_no of the blamed file was last changed in
00453 * @a revision by @a author on @a date, and that the contents were
00454 * @a line.
00455 *
00456 * All allocations should be performed in @a pool.
00457 *
00458 * @note If there is no blame information for this line, @a revision will be
00459 * invalid and @a author and @a date will be NULL.
00460 */
00461 typedef svn_error_t *
00462 (*svn_client_blame_receiver_t) (void *baton,
00463 apr_int64_t line_no,
00464 svn_revnum_t revision,
00465 const char *author,
00466 const char *date,
00467 const char *line,
00468 apr_pool_t *pool);
00469
00470
00471 /** A client context structure, which holds client specific callbacks,
00472 * batons, serves as a cache for configuration options, and other various
00473 * and sundry things. In order to avoid backwards compatibility problems
00474 * clients should use svn_client_create_context() to allocate and
00475 * intialize this structure instead of doing so themselves.
00476 */
00477 typedef struct svn_client_ctx_t
00478 {
00479 /** main authentication baton. */
00480 svn_auth_baton_t *auth_baton;
00481
00482 /** notification callback function.
00483 * This will be called by notify_func2() by default.
00484 * @deprecated Provided for backward compatibility with the 1.1 API. */
00485 svn_wc_notify_func_t notify_func;
00486
00487 /** notification callback baton for notify_func()
00488 * @deprecated Provided for backward compatibility with the 1.1 API. */
00489 void *notify_baton;
00490
00491 /** Log message callback function. NULL means that Subversion
00492 * should try not attempt to fetch a log message.
00493 * @deprecated Provided for backward compatibility with the 1.2 API. */
00494 svn_client_get_commit_log_t log_msg_func;
00495
00496 /** log message callback baton
00497 * @deprecated Provided for backward compatibility with the 1.2 API. */
00498 void *log_msg_baton;
00499
00500 /** a hash mapping of <tt>const char *</tt> configuration file names to
00501 * @c svn_config_t *'s. For example, the '~/.subversion/config' file's
00502 * contents should have the key "config". May be left unset (or set to
00503 * NULL) to use the built-in default settings and not use any configuration.
00504 */
00505 apr_hash_t *config;
00506
00507 /** a callback to be used to see if the client wishes to cancel the running
00508 * operation. */
00509 svn_cancel_func_t cancel_func;
00510
00511 /** a baton to pass to the cancellation callback. */
00512 void *cancel_baton;
00513
00514 /** notification function, defaulting to a function that forwards
00515 * to notify_func().
00516 * @since New in 1.2. */
00517 svn_wc_notify_func2_t notify_func2;
00518
00519 /** notification baton for notify_func2().
00520 * @since New in 1.2. */
00521 void *notify_baton2;
00522
00523 /** Log message callback function. NULL means that Subversion
00524 * should try log_msg_func.
00525 * @since New in 1.3. */
00526 svn_client_get_commit_log2_t log_msg_func2;
00527
00528 /** callback baton for log_msg_func2
00529 * @since New in 1.3. */
00530 void *log_msg_baton2;
00531
00532 /** Notification callback for network progress information.
00533 * May be NULL if not used.
00534 * @since New in 1.3. */
00535 svn_ra_progress_notify_func_t progress_func;
00536
00537 /** Callback baton for progress_func.
00538 * @since New in 1.3. */
00539 void *progress_baton;
00540 } svn_client_ctx_t;
00541
00542
00543 /**
00544 * @name Authentication information file names
00545 *
00546 * Names of files that contain authentication information.
00547 *
00548 * These filenames are decided by libsvn_client, since this library
00549 * implements all the auth-protocols; libsvn_wc does nothing but
00550 * blindly store and retrieve these files from protected areas.
00551 * @{
00552 */
00553 #define SVN_CLIENT_AUTH_USERNAME "username"
00554 #define SVN_CLIENT_AUTH_PASSWORD "password"
00555 /** @} */
00556
00557
00558 /** Initialize a client context.
00559 * Set @a *ctx to a client context object, allocated in @a pool, that
00560 * represents a particular instance of an svn client.
00561 *
00562 * In order to avoid backwards compatibility problems, clients must
00563 * use this function to intialize and allocate the
00564 * @c svn_client_ctx_t structure rather than doing so themselves, as
00565 * the size of this structure may change in the future.
00566 *
00567 * The current implementation never returns error, but callers should
00568 * still check for error, for compatibility with future versions.
00569 */
00570 svn_error_t *
00571 svn_client_create_context (svn_client_ctx_t **ctx,
00572 apr_pool_t *pool);
00573
00574 /**
00575 * Checkout a working copy of @a URL at @a revision, looked up at @a
00576 * peg_revision, using @a path as the root directory of the newly
00577 * checked out working copy, and authenticating with the
00578 * authentication baton cached in @a ctx. If @a result_rev is not @c
00579 * NULL, set @a *result_rev to the value of the revision actually
00580 * checked out from the repository.
00581 *
00582 * If @a peg_revision->kind is @c svn_opt_revision_unspecified, then it
00583 * defaults to @c svn_opt_revision_head.
00584 *
00585 * @a revision must be of kind @c svn_opt_revision_number,
00586 * @c svn_opt_revision_head, or @c svn_opt_revision_date. If
00587 * @a revision does not meet these requirements, return the error
00588 * @c SVN_ERR_CLIENT_BAD_REVISION.
00589 *
00590 * If @a ignore_externals is set, don't process externals definitions
00591 * as part of this operation.
00592 *
00593 * If @a ctx->notify_func2 is non-null, invoke @a ctx->notify_func2 with
00594 * @a ctx->notify_baton2 as the checkout progresses.
00595 *
00596 * If @a recurse is true, check out recursively. Otherwise, check out
00597 * just the directory represented by @a URL and its immediate
00598 * non-directory children, but none of its child directories (if any).
00599 *
00600 * If @a URL refers to a file rather than a directory, return the
00601 * error SVN_ERR_UNSUPPORTED_FEATURE. If @a URL does not exist,
00602 * return the error SVN_ERR_RA_ILLEGAL_URL.
00603 *
00604 * Use @a pool for any temporary allocation.
00605 *
00606 * @since New in 1.2.
00607 */
00608 svn_error_t *
00609 svn_client_checkout2 (svn_revnum_t *result_rev,
00610 const char *URL,
00611 const char *path,
00612 const svn_opt_revision_t *peg_revision,
00613 const svn_opt_revision_t *revision,
00614 svn_boolean_t recurse,
00615 svn_boolean_t ignore_externals,
00616 svn_client_ctx_t *ctx,
00617 apr_pool_t *pool);
00618
00619
00620 /**
00621 * Similar to svn_client_checkout2(), but with the @a peg_revision
00622 * parameter always set to @c svn_opt_revision_unspecified and
00623 * ignore_externals always set to @c FALSE.
00624 *
00625 * @deprecated Provided for backward compatibility with the 1.1 API.
00626 */
00627 svn_error_t *
00628 svn_client_checkout (svn_revnum_t *result_rev,
00629 const char *URL,
00630 const char *path,
00631 const svn_opt_revision_t *revision,
00632 svn_boolean_t recurse,
00633 svn_client_ctx_t *ctx,
00634 apr_pool_t *pool);
00635
00636
00637 /**
00638 * Update working trees @a paths to @a revision, authenticating with the
00639 * authentication baton cached in @a ctx. @a paths is an array of const
00640 * char * paths to be updated. Unversioned paths that are direct children
00641 * of a versioned path will cause an update that attempts to add that path,
00642 * other unversioned paths are skipped. If @a result_revs is not
00643 * @c NULL an array of svn_revnum_t will be returned with each element set
00644 * to the revision to which @a revision was resolved.
00645 *
00646 * @a revision must be of kind @c svn_opt_revision_number,
00647 * @c svn_opt_revision_head, or @c svn_opt_revision_date. If @a
00648 * revision does not meet these requirements, return the error
00649 * @c SVN_ERR_CLIENT_BAD_REVISION.
00650 *
00651 * The paths in @a paths can be from multiple working copies from multiple
00652 * repositories, but even if they all come from the same repository there
00653 * is no guarantee that revision represented by @c svn_opt_revision_head
00654 * will remain the same as each path is updated.
00655 *
00656 * If @a ignore_externals is set, don't process externals definitions
00657 * as part of this operation.
00658 *
00659 * If @a recurse is true, update directories recursively; otherwise,
00660 * update just their immediate entries, but not their child
00661 * directories (if any).
00662 *
00663 * If @a ctx->notify_func2 is non-null, invoke @a ctx->notify_func2 with
00664 * @a ctx->notify_baton2 for each item handled by the update, and also for
00665 * files restored from text-base. If @a ctx->cancel_func is non-null, invoke
00666 * it passing @a ctx->cancel_baton at various places during the update.
00667 *
00668 * Use @a pool for any temporary allocation.
00669 *
00670 * @since New in 1.2.
00671 */
00672 svn_error_t *
00673 svn_client_update2 (apr_array_header_t **result_revs,
00674 const apr_array_header_t *paths,
00675 const svn_opt_revision_t *revision,
00676 svn_boolean_t recurse,
00677 svn_boolean_t ignore_externals,
00678 svn_client_ctx_t *ctx,
00679 apr_pool_t *pool);
00680
00681 /**
00682 * Similar to svn_client_update2() except that it accepts only a single
00683 * target in @a path, returns a single revision if @a result_rev is
00684 * not NULL, and ignore_externals is always set to @c FALSE.
00685 *
00686 * @deprecated Provided for backward compatibility with the 1.1 API.
00687 */
00688 svn_error_t *
00689 svn_client_update (svn_revnum_t *result_rev,
00690 const char *path,
00691 const svn_opt_revision_t *revision,
00692 svn_boolean_t recurse,
00693 svn_client_ctx_t *ctx,
00694 apr_pool_t *pool);
00695
00696
00697 /** Switch working tree @a path to @a url at @a revision,
00698 * authenticating with the authentication baton cached in @a ctx. If
00699 * @a result_rev is not @c NULL, set @a *result_rev to the value of
00700 * the revision to which the working copy was actually switched.
00701 *
00702 * Summary of purpose: this is normally used to switch a working
00703 * directory over to another line of development, such as a branch or
00704 * a tag. Switching an existing working directory is more efficient
00705 * than checking out @a url from scratch.
00706 *
00707 * @a revision must be of kind @c svn_opt_revision_number,
00708 * @c svn_opt_revision_head, or @c svn_opt_revision_date; otherwise,
00709 * return @c SVN_ERR_CLIENT_BAD_REVISION.
00710 *
00711 * If @a recurse is true, and @a path is a directory, switch it
00712 * recursively; otherwise, switch just @a path and its immediate
00713 * entries, but not its child directories (if any).
00714 *
00715 * If @a ctx->notify_func2 is non-null, invoke it with @a ctx->notify_baton2
00716 * on paths affected by the switch. Also invoke it for files may be restored
00717 * from the text-base because they were removed from the working copy.
00718 *
00719 * Use @a pool for any temporary allocation.
00720 */
00721 svn_error_t *
00722 svn_client_switch (svn_revnum_t *result_rev,
00723 const char *path,
00724 const char *url,
00725 const svn_opt_revision_t *revision,
00726 svn_boolean_t recurse,
00727 svn_client_ctx_t *ctx,
00728 apr_pool_t *pool);
00729
00730
00731 /**
00732 * Schedule a working copy @a path for addition to the repository.
00733 *
00734 * @a path's parent must be under revision control already, but @a
00735 * path is not. If @a recursive is set, then assuming @a path is a
00736 * directory, all of its contents will be scheduled for addition as
00737 * well.
00738 *
00739 * If @a force is not set and @a path is already under version
00740 * control, return the error @c SVN_ERR_ENTRY_EXISTS. If @a force is
00741 * set, do not error on already-versioned items. When used on a
00742 * directory in conjunction with the @a recursive flag, this has the
00743 * effect of scheduling for addition unversioned files and directories
00744 * scattered deep within a versioned tree.
00745 *
00746 * If @a ctx->notify_func2 is non-null, then for each added item, call
00747 * @a ctx->notify_func2 with @a ctx->notify_baton2 and the path of the
00748 * added item.
00749 *
00750 * If @a no_ignore is FALSE, don't add files or directories that match
00751 * ignore patterns.
00752 *
00753 * Important: this is a *scheduling* operation. No changes will
00754 * happen to the repository until a commit occurs. This scheduling
00755 * can be removed with svn_client_revert().
00756 *
00757 * @since New in 1.3.
00758 */
00759 svn_error_t *
00760 svn_client_add3 (const char *path,
00761 svn_boolean_t recursive,
00762 svn_boolean_t force,
00763 svn_boolean_t no_ignore,
00764 svn_client_ctx_t *ctx,
00765 apr_pool_t *pool);
00766
00767 /**
00768 * Similar to svn_client_add3(), but with the @a no_ignore parameter
00769 * always set to @c FALSE.
00770 *
00771 * @deprecated Provided for backward compatibility with the 1.2 API.
00772 */
00773 svn_error_t *
00774 svn_client_add2 (const char *path,
00775 svn_boolean_t recursive,
00776 svn_boolean_t force,
00777 svn_client_ctx_t *ctx,
00778 apr_pool_t *pool);
00779
00780 /**
00781 * Similar to svn_client_add2(), but with the @a force parameter
00782 * always set to @c FALSE.
00783 *
00784 * @deprecated Provided for backward compatibility with the 1.0 API.
00785 */
00786 svn_error_t *
00787 svn_client_add (const char *path,
00788 svn_boolean_t recursive,
00789 svn_client_ctx_t *ctx,
00790 apr_pool_t *pool);
00791
00792 /** Create a directory, either in a repository or a working copy.
00793 *
00794 * If @a paths contains URLs, use the authentication baton in @a ctx
00795 * and @a message to immediately attempt to commit the creation of the
00796 * directories in @a paths in the repository. If the commit succeeds,
00797 * allocate (in @a pool) and populate @a *commit_info_p.
00798 *
00799 * Else, create the directories on disk, and attempt to schedule them
00800 * for addition (using svn_client_add(), whose docstring you should
00801 * read).
00802 *
00803 * @a ctx->log_msg_func/@a ctx->log_msg_baton are a callback/baton combo that
00804 * this function can use to query for a commit log message when one is
00805 * needed.
00806 *
00807 * If @a ctx->notify_func2 is non-null, when the directory has been created
00808 * (successfully) in the working copy, call @a ctx->notify_func2 with
00809 * @a ctx->notify_baton2 and the path of the new directory. Note that this is
00810 * only called for items added to the working copy.
00811 *
00812 * @since New in 1.3.
00813 */
00814 svn_error_t *
00815 svn_client_mkdir2 (svn_commit_info_t **commit_info_p,
00816 const apr_array_header_t *paths,
00817 svn_client_ctx_t *ctx,
00818 apr_pool_t *pool);
00819
00820
00821 /** Same as svn_client_mkdir2(), but takes the @c svn_client_commit_info_t
00822 * for @a commit_info_p.
00823 *
00824 * @deprecated Provided for backward compatibility with the 1.2 API.
00825 */
00826 svn_error_t *
00827 svn_client_mkdir (svn_client_commit_info_t **commit_info_p,
00828 const apr_array_header_t *paths,
00829 svn_client_ctx_t *ctx,
00830 apr_pool_t *pool);
00831
00832
00833 /** Delete items from a repository or working copy.
00834 *
00835 * If the paths in @a paths are URLs, use the authentication baton in
00836 * @a ctx and @a ctx->log_msg_func/@a ctx->log_msg_baton to
00837 * immediately attempt to commit a deletion of the URLs from the
00838 * repository. If the commit succeeds, allocate (in @a pool) and
00839 * populate @a *commit_info_p. Every path must belong to the same
00840 * repository.
00841 *
00842 * Else, schedule the working copy paths in @a paths for removal from
00843 * the repository. Each path's parent must be under revision control.
00844 * This is just a *scheduling* operation. No changes will happen to
00845 * the repository until a commit occurs. This scheduling can be
00846 * removed with svn_client_revert(). If a path is a file it is
00847 * immediately removed from the working copy. If the path is a
00848 * directory it will remain in the working copy but all the files, and
00849 * all unversioned items, it contains will be removed. If @a force is
00850 * not set then this operation will fail if any path contains locally
00851 * modified and/or unversioned items. If @a force is set such items
00852 * will be deleted.
00853 *
00854 * @a ctx->log_msg_func/@a ctx->log_msg_baton are a callback/baton combo that
00855 * this function can use to query for a commit log message when one is
00856 * needed.
00857 *
00858 * If @a ctx->notify_func2 is non-null, then for each item deleted, call
00859 * @a ctx->notify_func2 with @a ctx->notify_baton2 and the path of the deleted
00860 * item.
00861 *
00862 * @since New in 1.3.
00863 */
00864 svn_error_t *
00865 svn_client_delete2 (svn_commit_info_t **commit_info_p,
00866 const apr_array_header_t *paths,
00867 svn_boolean_t force,
00868 svn_client_ctx_t *ctx,
00869 apr_pool_t *pool);
00870
00871
00872 /** Similar to svn_client_delete2(), but takes @c svn_client_commit_info_t
00873 * for @a commit_info_p.
00874 *
00875 * @deprecated Provided for backward compatibility with the 1.2 API.
00876 */
00877 svn_error_t *
00878 svn_client_delete (svn_client_commit_info_t **commit_info_p,
00879 const apr_array_header_t *paths,
00880 svn_boolean_t force,
00881 svn_client_ctx_t *ctx,
00882 apr_pool_t *pool);
00883
00884
00885
00886 /** Import file or directory @a path into repository directory @a url at
00887 * head, authenticating with the authentication baton cached in @a ctx,
00888 * and using @a ctx->log_msg_func/@a ctx->log_msg_baton to get a log message
00889 * for the (implied) commit. Set @a *commit_info_p to the results of the
00890 * commit, allocated in @a pool. If some components of @a url do not exist
00891 * then create parent directories as necessary.
00892 *
00893 * If @a path is a directory, the contents of that directory are
00894 * imported directly into the directory identified by @a url. Note that the
00895 * directory @a path itself is not imported -- that is, the basename of
00896 * @a path is not part of the import.
00897 *
00898 * If @a path is a file, then the dirname of @a url is the directory
00899 * receiving the import. The basename of @a url is the filename in the
00900 * repository. In this case if @a url already exists, return error.
00901 *
00902 * If @a ctx->notify_func2 is non-null, then call @a ctx->notify_func2 with
00903 * @a ctx->notify_baton2 as the import progresses, with any of the following
00904 * actions: @c svn_wc_notify_commit_added,
00905 * @c svn_wc_notify_commit_postfix_txdelta.
00906 *
00907 * Use @a pool for any temporary allocation.
00908 *
00909 * @a ctx->log_msg_func/@a ctx->log_msg_baton are a callback/baton combo that
00910 * this function can use to query for a commit log message when one is needed.
00911 *
00912 * Use @a nonrecursive to indicate that imported directories should not
00913 * recurse into any subdirectories they may have.
00914 *
00915 * If @a no_ignore is FALSE, don't add files or directories that match
00916 * ignore patterns.
00917 *
00918 * ### kff todo: This import is similar to cvs import, in that it does
00919 * not change the source tree into a working copy. However, this
00920 * behavior confuses most people, and I think eventually svn _should_
00921 * turn the tree into a working copy, or at least should offer the
00922 * option. However, doing so is a bit involved, and we don't need it
00923 * right now.
00924 *
00925 * @since New in 1.3.
00926 */
00927 svn_error_t *svn_client_import2 (svn_commit_info_t **commit_info_p,
00928 const char *path,
00929 const char *url,
00930 svn_boolean_t nonrecursive,
00931 svn_boolean_t no_ignore,
00932 svn_client_ctx_t *ctx,
00933 apr_pool_t *pool);
00934
00935 /**
00936 * Similar to svn_client_import2(), but with the @a no_ignore parameter
00937 * always set to @c FALSE and using @c svn_client_commit_info_t for
00938 * @a commit_info_p.
00939 *
00940 * @deprecated Provided for backward compatibility with the 1.2 API.
00941 */
00942 svn_error_t *svn_client_import (svn_client_commit_info_t **commit_info_p,
00943 const char *path,
00944 const char *url,
00945 svn_boolean_t nonrecursive,
00946 svn_client_ctx_t *ctx,
00947 apr_pool_t *pool);
00948
00949
00950 /**
00951 * Commit files or directories into repository, authenticating with
00952 * the authentication baton cached in @a ctx, and using
00953 * @a ctx->log_msg_func/@a ctx->log_msg_baton to obtain the log message.
00954 * Set @a *commit_info_p to the results of the commit, allocated in @a pool.
00955 *
00956 * @a targets is an array of <tt>const char *</tt> paths to commit. They
00957 * need not be canonicalized nor condensed; this function will take care of
00958 * that. If @a targets has zero elements, then do nothing and return
00959 * immediately without error.
00960 *
00961 * If @a ctx->notify_func2 is non-null, then call @a ctx->notify_func2 with
00962 * @a ctx->notify_baton2 as the commit progresses, with any of the following
00963 * actions: @c svn_wc_notify_commit_modified, @c svn_wc_notify_commit_added,
00964 * @c svn_wc_notify_commit_deleted, @c svn_wc_notify_commit_replaced,
00965 * @c svn_wc_notify_commit_postfix_txdelta.
00966 *
00967 * If @a recurse is false, subdirectories of directories in @a targets
00968 * will be ignored.
00969 *
00970 * Unlock paths in the repository, unless @a keep_locks is true.
00971 *
00972 * Use @a pool for any temporary allocations.
00973 *
00974 * If no error is returned and @a (*commit_info_p)->revision is set to
00975 * @c SVN_INVALID_REVNUM, then the commit was a no-op; nothing needed to
00976 * be committed.
00977 *
00978 * @since New in 1.3.
00979 */
00980 svn_error_t *
00981 svn_client_commit3 (svn_commit_info_t **commit_info_p,
00982 const apr_array_header_t *targets,
00983 svn_boolean_t recurse,
00984 svn_boolean_t keep_locks,
00985 svn_client_ctx_t *ctx,
00986 apr_pool_t *pool);
00987
00988 /** Similar to svn_client_commit3(), but uses @c svn_client_commit_info_t
00989 * for @a commit_info_p.
00990 *
00991 * @deprecated Provided for backward compatibility with the 1.2 API.
00992 *
00993 * @since New in 1.2.
00994 */
00995 svn_error_t *
00996 svn_client_commit2 (svn_client_commit_info_t **commit_info_p,
00997 const apr_array_header_t *targets,
00998 svn_boolean_t recurse,
00999 svn_boolean_t keep_locks,
01000 svn_client_ctx_t *ctx,
01001 apr_pool_t *pool);
01002
01003 /**
01004 * Similar to svn_client_commit2(), but with @a keep_locks set to
01005 * true and a @a nonrecursive argument instead of "recurse".
01006 *
01007 * @deprecated Provided for backward compatibility with the 1.1 API.
01008 */
01009 svn_error_t *
01010 svn_client_commit (svn_client_commit_info_t **commit_info_p,
01011 const apr_array_header_t *targets,
01012 svn_boolean_t nonrecursive,
01013 svn_client_ctx_t *ctx,
01014 apr_pool_t *pool);
01015
01016 /**
01017 * Given @a path to a working copy directory (or single file), call
01018 * @a status_func/status_baton with a set of @c svn_wc_status_t *
01019 * structures which describe the status of @a path and its children.
01020 *
01021 * - If @a recurse is non-zero, recurse fully, else do only
01022 * immediate children.
01023 *
01024 * - If @a get_all is set, retrieve all entries; otherwise,
01025 * retrieve only "interesting" entries (local mods and/or
01026 * out-of-date).
01027 *
01028 * - If @a update is set, contact the repository and augment the
01029 * status structures with information about out-of-dateness (with
01030 * respect to @a revision). Also, if @a result_rev is not @c NULL,
01031 * set @a *result_rev to the actual revision against which the
01032 * working copy was compared (@a *result_rev is not meaningful unless
01033 * @a update is set).
01034 *
01035 * If @a ignore_externals is not set, then recurse into externals
01036 * definitions (if any exist) after handling the main target. This
01037 * calls the client notification function (in @a ctx) with the @c
01038 * svn_wc_notify_status_external action before handling each externals
01039 * definition, and with @c svn_wc_notify_status_completed
01040 * after each.
01041 *
01042 * @since New in 1.2.
01043 */
01044 svn_error_t *
01045 svn_client_status2 (svn_revnum_t *result_rev,
01046 const char *path,
01047 const svn_opt_revision_t *revision,
01048 svn_wc_status_func2_t status_func,
01049 void *status_baton,
01050 svn_boolean_t recurse,
01051 svn_boolean_t get_all,
01052 svn_boolean_t update,
01053 svn_boolean_t no_ignore,
01054 svn_boolean_t ignore_externals,
01055 svn_client_ctx_t *ctx,
01056 apr_pool_t *pool);
01057
01058
01059 /**
01060 * Similar to svn_client_status2(), but with the @a ignore_externals
01061 * parameter always set to @c FALSE, and taking a deprecated
01062 * svn_wc_status_func_t argument, and requiring @a *revision to be
01063 * non-const even though it is treated as constant.
01064 *
01065 * @deprecated Provided for backward compatibility with the 1.1 API.
01066 */
01067 svn_error_t *
01068 svn_client_status (svn_revnum_t *result_rev,
01069 const char *path,
01070 svn_opt_revision_t *revision,
01071 svn_wc_status_func_t status_func,
01072 void *status_baton,
01073 svn_boolean_t recurse,
01074 svn_boolean_t get_all,
01075 svn_boolean_t update,
01076 svn_boolean_t no_ignore,
01077 svn_client_ctx_t *ctx,
01078 apr_pool_t *pool);
01079
01080 /**
01081 * Invoke @a receiver with @a receiver_baton on each log message from @a
01082 * start to @a end in turn, inclusive (but never invoke @a receiver on a
01083 * given log message more than once).
01084 *
01085 * @a targets contains either a URL followed by zero or more relative
01086 * paths, or a list of working copy paths, as <tt>const char *</tt>,
01087 * for which log messages are desired. The repository info is
01088 * determined by taking the common prefix of the target entries' URLs.
01089 * @a receiver is invoked only on messages whose revisions involved a
01090 * change to some path in @a targets.
01091 *
01092 * If @a limit is non-zero only invoke @a receiver on the first @a limit
01093 * logs.
01094 *
01095 * If @a discover_changed_paths is set, then the `@a changed_paths' argument
01096 * to @a receiver will be passed on each invocation.
01097 *
01098 * If @a strict_node_history is set, copy history (if any exists) will
01099 * not be traversed while harvesting revision logs for each target.
01100 *
01101 * If @a start->kind or @a end->kind is @c svn_opt_revision_unspecified,
01102 * return the error @c SVN_ERR_CLIENT_BAD_REVISION.
01103 *
01104 * Use @a pool for any temporary allocation.
01105 *
01106 * IMPORTANT: A special case for the revision range HEAD:1, which was present
01107 * in svn_client_log(), has been removed from svn_client_log2(). Instead, it
01108 * is expected that callers will specify the range HEAD:0, to avoid a
01109 * SVN_ERR_FS_NO_SUCH_REVISION error when invoked against an empty repository
01110 * (i.e. one not containing a revision 1).
01111 *
01112 * If @a ctx->notify_func2 is non-null, then call @a ctx->notify_func2/baton2
01113 * with a 'skip' signal on any unversioned targets.
01114 *
01115 * @since New in 1.2.
01116 */
01117 svn_error_t *
01118 svn_client_log2 (const apr_array_header_t *targets,
01119 const svn_opt_revision_t *start,
01120 const svn_opt_revision_t *end,
01121 int limit,
01122 svn_boolean_t discover_changed_paths,
01123 svn_boolean_t strict_node_history,
01124 svn_log_message_receiver_t receiver,
01125 void *receiver_baton,
01126 svn_client_ctx_t *ctx,
01127 apr_pool_t *pool);
01128
01129
01130 /**
01131 * Similar to svn_client_log2(), but with the @a limit parameter set to 0,
01132 * and the following special case:
01133 *
01134 * Special case for repositories at revision 0:
01135 *
01136 * If @a start->kind is @c svn_opt_revision_head, and @a end->kind is
01137 * @c svn_opt_revision_number && @a end->number is @c 1, then handle an
01138 * empty (no revisions) repository specially: instead of erroring
01139 * because requested revision 1 when the highest revision is 0, just
01140 * invoke @a receiver on revision 0, passing @c NULL for changed paths and
01141 * empty strings for the author and date. This is because that
01142 * particular combination of @a start and @a end usually indicates the
01143 * common case of log invocation -- the user wants to see all log
01144 * messages from youngest to oldest, where the oldest commit is
01145 * revision 1. That works fine, except when there are no commits in
01146 * the repository, hence this special case.
01147 *
01148 * @deprecated Provided for backward compatibility with the 1.0 API.
01149 */
01150 svn_error_t *
01151 svn_client_log (const apr_array_header_t *targets,
01152 const svn_opt_revision_t *start,
01153 const svn_opt_revision_t *end,
01154 svn_boolean_t discover_changed_paths,
01155 svn_boolean_t strict_node_history,
01156 svn_log_message_receiver_t receiver,
01157 void *receiver_baton,
01158 svn_client_ctx_t *ctx,
01159 apr_pool_t *pool);
01160
01161 /**
01162 * Invoke @a receiver with @a receiver_baton on each line-blame item
01163 * associated with revision @a end of @a path_or_url, using @a start
01164 * as the default source of all blame. @a peg_revision indicates in
01165 * which revision @a path_or_url is valid. If @a peg_revision->kind
01166 * is @c svn_opt_revision_unspecified, then it defaults to @c
01167 * svn_opt_revision_head for URLs or @c svn_opt_revision_working for
01168 * WC targets.
01169 *
01170 * If @a start->kind or @a end->kind is @c svn_opt_revision_unspecified,
01171 * return the error @c SVN_ERR_CLIENT_BAD_REVISION. If any of the
01172 * revisions of @a path_or_url have a binary mime-type, return the
01173 * error @c SVN_ERR_CLIENT_IS_BINARY_FILE.
01174 *
01175 * Use @a pool for any temporary allocation.
01176 *
01177 * @since New in 1.2.
01178 */
01179 svn_error_t *
01180 svn_client_blame2 (const char *path_or_url,
01181 const svn_opt_revision_t *peg_revision,
01182 const svn_opt_revision_t *start,
01183 const svn_opt_revision_t *end,
01184 svn_client_blame_receiver_t receiver,
01185 void *receiver_baton,
01186 svn_client_ctx_t *ctx,
01187 apr_pool_t *pool);
01188
01189 /**
01190 * Similar to svn_client_blame() except that @a peg_revision is always
01191 * the same as @a end.
01192 *
01193 * @deprecated Provided for backward compatibility with the 1.1 API.
01194 */
01195 svn_error_t *
01196 svn_client_blame (const char *path_or_url,
01197 const svn_opt_revision_t *start,
01198 const svn_opt_revision_t *end,
01199 svn_client_blame_receiver_t receiver,
01200 void *receiver_baton,
01201 svn_client_ctx_t *ctx,
01202 apr_pool_t *pool);
01203
01204 /**
01205 * Produce diff output which describes the delta between
01206 * @a path1/@a revision1 and @a path2/@a revision2. Print the output
01207 * of the diff to @a outfile, and any errors to @a errfile. @a path1
01208 * and @a path2 can be either working-copy paths or URLs.
01209 *
01210 * If either @a revision1 or @a revision2 has an `unspecified' or
01211 * unrecognized `kind', return @c SVN_ERR_CLIENT_BAD_REVISION.
01212 *
01213 * @a path1 and @a path2 must both represent the same node kind -- that
01214 * is, if @a path1 is a directory, @a path2 must also be, and if @a path1
01215 * is a file, @a path2 must also be. (Currently, @a path1 and @a path2
01216 * must be the exact same path)
01217 *
01218 * If @a recurse is true (and the @a paths are directories) this will be a
01219 * recursive operation.
01220 *
01221 * Use @a ignore_ancestry to control whether or not items being
01222 * diffed will be checked for relatedness first. Unrelated items
01223 * are typically transmitted to the editor as a deletion of one thing
01224 * and the addition of another, but if this flag is @c TRUE,
01225 * unrelated items will be diffed as if they were related.
01226 *
01227 * If @a no_diff_deleted is true, then no diff output will be
01228 * generated on deleted files.
01229 *
01230 * Generated headers are encoded using @a header_encoding.
01231 *
01232 * Diff output will not be generated for binary files, unless @a
01233 * ignore_content_type is true, in which case diffs will be shown
01234 * regardless of the content types.
01235 *
01236 * @a diff_options (an array of <tt>const char *</tt>) is used to pass
01237 * additional command line options to the diff processes invoked to compare
01238 * files.
01239 *
01240 * The authentication baton cached in @a ctx is used to communicate with
01241 * the repository.
01242 *
01243 * @note @a header_encoding doesn't affect headers generated by external
01244 * diff programs.
01245 *
01246 * @since New in 1.3.
01247 */
01248 svn_error_t *svn_client_diff3 (const apr_array_header_t *diff_options,
01249 const char *path1,
01250 const svn_opt_revision_t *revision1,
01251 const char *path2,
01252 const svn_opt_revision_t *revision2,
01253 svn_boolean_t recurse,
01254 svn_boolean_t ignore_ancestry,
01255 svn_boolean_t no_diff_deleted,
01256 svn_boolean_t ignore_content_type,
01257 const char *header_encoding,
01258 apr_file_t *outfile,
01259 apr_file_t *errfile,
01260 svn_client_ctx_t *ctx,
01261 apr_pool_t *pool);
01262
01263 /**
01264 * Similar to svn_client_diff3(), but with @a header_encoding set to
01265 * @c APR_LOCALE_CHARSET.
01266 *
01267 * @deprecated Provided for backward compatibility with the 1.2 API.
01268 *
01269 * @since New in 1.2.
01270 */
01271 svn_error_t *svn_client_diff2 (const apr_array_header_t *diff_options,
01272 const char *path1,
01273 const svn_opt_revision_t *revision1,
01274 const char *path2,
01275 const svn_opt_revision_t *revision2,
01276 svn_boolean_t recurse,
01277 svn_boolean_t ignore_ancestry,
01278 svn_boolean_t no_diff_deleted,
01279 svn_boolean_t ignore_content_type,
01280 apr_file_t *outfile,
01281 apr_file_t *errfile,
01282 svn_client_ctx_t *ctx,
01283 apr_pool_t *pool);
01284
01285 /**
01286 * Similar to svn_client_diff2(), but with the @a ignore_content_type
01287 * parameter always set to @c FALSE.
01288 *
01289 * @deprecated Provided for backward compatibility with the 1.0 API.
01290 */
01291 svn_error_t *svn_client_diff (const apr_array_header_t *diff_options,
01292 const char *path1,
01293 const svn_opt_revision_t *revision1,
01294 const char *path2,
01295 const svn_opt_revision_t *revision2,
01296 svn_boolean_t recurse,
01297 svn_boolean_t ignore_ancestry,
01298 svn_boolean_t no_diff_deleted,
01299 apr_file_t *outfile,
01300 apr_file_t *errfile,
01301 svn_client_ctx_t *ctx,
01302 apr_pool_t *pool);
01303
01304 /**
01305 * Produce diff output which describes the delta between the
01306 * filesystem object @a path in peg revision @a peg_revision, as it
01307 * changed between @a start_revision and @a end_revision. @a path can
01308 * be either a working-copy path or URL.
01309 *
01310 * All other options are handled identically to svn_client_diff3().
01311 *
01312 * @since New in 1.3.
01313 */
01314 svn_error_t *svn_client_diff_peg3 (const apr_array_header_t *diff_options,
01315 const char *path,
01316 const svn_opt_revision_t *peg_revision,
01317 const svn_opt_revision_t *start_revision,
01318 const svn_opt_revision_t *end_revision,
01319 svn_boolean_t recurse,
01320 svn_boolean_t ignore_ancestry,
01321 svn_boolean_t no_diff_deleted,
01322 svn_boolean_t ignore_content_type,
01323 const char *header_encoding,
01324 apr_file_t *outfile,
01325 apr_file_t *errfile,
01326 svn_client_ctx_t *ctx,
01327 apr_pool_t *pool);
01328
01329 /**
01330 * Similar to svn_client_diff_peg3(), but with @a header_encoding set to
01331 * @c APR_LOCALE_CHARSET.
01332 *
01333 * @deprecated Provided for backward compatibility with the 1.2 API.
01334 *
01335 * @since New in 1.2.
01336 */
01337 svn_error_t *svn_client_diff_peg2 (const apr_array_header_t *diff_options,
01338 const char *path,
01339 const svn_opt_revision_t *peg_revision,
01340 const svn_opt_revision_t *start_revision,
01341 const svn_opt_revision_t *end_revision,
01342 svn_boolean_t recurse,
01343 svn_boolean_t ignore_ancestry,
01344 svn_boolean_t no_diff_deleted,
01345 svn_boolean_t ignore_content_type,
01346 apr_file_t *outfile,
01347 apr_file_t *errfile,
01348 svn_client_ctx_t *ctx,
01349 apr_pool_t *pool);
01350
01351 /**
01352 * Similar to svn_client_diff_peg2(), but with the @a ignore_content_type
01353 * parameter always set to @c FALSE.
01354 *
01355 * @since New in 1.1.
01356 * @deprecated Provided for backward compatibility with the 1.1 API.
01357 */
01358 svn_error_t *svn_client_diff_peg (const apr_array_header_t *diff_options,
01359 const char *path,
01360 const svn_opt_revision_t *peg_revision,
01361 const svn_opt_revision_t *start_revision,
01362 const svn_opt_revision_t *end_revision,
01363 svn_boolean_t recurse,
01364 svn_boolean_t ignore_ancestry,
01365 svn_boolean_t no_diff_deleted,
01366 apr_file_t *outfile,
01367 apr_file_t *errfile,
01368 svn_client_ctx_t *ctx,
01369 apr_pool_t *pool);
01370
01371 /** Merge changes from @a source1/@a revision1 to @a source2/@a revision2 into
01372 * the working-copy path @a target_wcpath.
01373 *
01374 * @a source1 and @a source2 are either URLs that refer to entries in the
01375 * repository, or paths to entries in the working copy.
01376 *
01377 * By "merging", we mean: apply file differences using
01378 * svn_wc_merge(), and schedule additions & deletions when appropriate.
01379 *
01380 * @a source1 and @a source2 must both represent the same node kind -- that
01381 * is, if @a source1 is a directory, @a source2 must also be, and if @a source1
01382 * is a file, @a source2 must also be.
01383 *
01384 * If either @a revision1 or @a revision2 has an `unspecified' or
01385 * unrecognized `kind', return @c SVN_ERR_CLIENT_BAD_REVISION.
01386 *
01387 * If @a recurse is true (and the URLs are directories), apply changes
01388 * recursively; otherwise, only apply changes in the current
01389 * directory.
01390 *
01391 * Use @a ignore_ancestry to control whether or not items being
01392 * diffed will be checked for relatedness first. Unrelated items
01393 * are typically transmitted to the editor as a deletion of one thing
01394 * and the addition of another, but if this flag is @c TRUE,
01395 * unrelated items will be diffed as if they were related.
01396 *
01397 * If @a force is not set and the merge involves deleting locally modified or
01398 * unversioned items the operation will fail. If @a force is set such items
01399 * will be deleted.
01400 *
01401 * If @a ctx->notify_func2 is non-null, then call @a ctx->notify_func2 with @a
01402 * ctx->notify_baton2 once for each merged target, passing the target's local
01403 * path.
01404 *
01405 * If @a dry_run is @a true the merge is carried out, and full notification
01406 * feedback is provided, but the working copy is not modified.
01407 *
01408 * The authentication baton cached in @a ctx is used to communicate with the
01409 * repository.
01410 */
01411 svn_error_t *
01412 svn_client_merge (const char *source1,
01413 const svn_opt_revision_t *revision1,
01414 const char *source2,
01415 const svn_opt_revision_t *revision2,
01416 const char *target_wcpath,
01417 svn_boolean_t recurse,
01418 svn_boolean_t ignore_ancestry,
01419 svn_boolean_t force,
01420 svn_boolean_t dry_run,
01421 svn_client_ctx_t *ctx,
01422 apr_pool_t *pool);
01423
01424
01425 /**
01426 * Merge the changes between the filesystem object @a source in peg
01427 * revision @a peg_revision, as it changed between @a revision1 and @a
01428 * revision2.
01429 *
01430 * All other options are handled identically to svn_client_merge().
01431 *
01432 * @since New in 1.1.
01433 */
01434 svn_error_t *
01435 svn_client_merge_peg (const char *source,
01436 const svn_opt_revision_t *revision1,
01437 const svn_opt_revision_t *revision2,
01438 const svn_opt_revision_t *peg_revision,
01439 const char *target_wcpath,
01440 svn_boolean_t recurse,
01441 svn_boolean_t ignore_ancestry,
01442 svn_boolean_t force,
01443 svn_boolean_t dry_run,
01444 svn_client_ctx_t *ctx,
01445 apr_pool_t *pool);
01446
01447
01448 /** Recursively cleanup a working copy directory @a dir, finishing any
01449 * incomplete operations, removing lockfiles, etc.
01450 *
01451 * If @a ctx->cancel_func is non-null, invoke it with @a
01452 * ctx->cancel_baton at various points during the operation. If it
01453 * returns an error (typically SVN_ERR_CANCELLED), return that error
01454 * immediately.
01455 */
01456 svn_error_t *
01457 svn_client_cleanup (const char *dir,
01458 svn_client_ctx_t *ctx,
01459 apr_pool_t *pool);
01460
01461
01462 /**
01463 * Modify a working copy directory @a dir, changing any
01464 * repository URLs that begin with @a from to begin with @a to instead,
01465 * recursing into subdirectories if @a recurse is true.
01466 *
01467 * @param dir Working copy directory
01468 * @param from Original URL
01469 * @param to New URL
01470 * @param recurse Whether to recurse
01471 * @param ctx svn_client_ctx_t
01472 * @param pool The pool from which to perform memory allocations
01473 */
01474 svn_error_t *
01475 svn_client_relocate (const char *dir,
01476 const char *from,
01477 const char *to,
01478 svn_boolean_t recurse,
01479 svn_client_ctx_t *ctx,
01480 apr_pool_t *pool);
01481
01482
01483 /** Restore the pristine version of a working copy @a paths,
01484 * effectively undoing any local mods. For each path in @a paths, if
01485 * it is a directory, and @a recursive is @a true, this will be a
01486 * recursive operation.
01487 *
01488 * If @a ctx->notify_func2 is non-null, then for each item reverted,
01489 * call @a ctx->notify_func2 with @a ctx->notify_baton2 and the path of
01490 * the reverted item.
01491 *
01492 * If an item specified for reversion is not under version control,
01493 * then do not error, just invoke @a ctx->notify_func2 with @a
01494 * ctx->notify_baton2, using notification code @c svn_wc_notify_skip.
01495 */
01496 svn_error_t *
01497 svn_client_revert (const apr_array_header_t *paths,
01498 svn_boolean_t recursive,
01499 svn_client_ctx_t *ctx,
01500 apr_pool_t *pool);
01501
01502
01503 /** Remove the 'conflicted' state on a working copy @a path. This will
01504 * not semantically resolve conflicts; it just allows @a path to be
01505 * committed in the future. The implementation details are opaque.
01506 * If @a recursive is set, recurse below @a path, looking for conflicts
01507 * to resolve.
01508 *
01509 * If @a path is not in a state of conflict to begin with, do nothing.
01510 * If @a path's conflict state is removed and @a ctx->notify_func2 is non-null,
01511 * call @a ctx->notify_func2 with @a ctx->notify_baton2 and @a path.
01512 */
01513 svn_error_t *
01514 svn_client_resolved (const char *path,
01515 svn_boolean_t recursive,
01516 svn_client_ctx_t *ctx,
01517 apr_pool_t *pool);
01518
01519
01520 /** Copy @a src_path to @a dst_path.
01521 *
01522 * @a src_path must be a file or directory under version control, or the
01523 * URL of a versioned item in the repository. If @a src_path is a
01524 * URL, @a src_revision is used to choose the revision from which to copy
01525 * the @a src_path. @a dst_path must be a file or directory under version
01526 * control, or a repository URL, existent or not.
01527 *
01528 * If @a dst_path is a URL, use the authentication baton
01529 * in @a ctx and @a ctx->log_msg_func/@a ctx->log_msg_baton to immediately
01530 * attempt to commit the copy action in the repository. If the commit
01531 * succeeds, allocate (in @a pool) and populate @a *commit_info_p.
01532 *
01533 * If @a dst_path is not a URL, then this is just a
01534 * variant of svn_client_add(), where the @a dst_path items are scheduled
01535 * for addition as copies. No changes will happen to the repository
01536 * until a commit occurs. This scheduling can be removed with
01537 * svn_client_revert().
01538 *
01539 * @a ctx->log_msg_func/@a ctx->log_msg_baton are a callback/baton combo that
01540 * this function can use to query for a commit log message when one is
01541 * needed.
01542 *
01543 * If @a ctx->notify_func2 is non-null, invoke it with @a ctx->notify_baton2
01544 * for each item added at the new location, passing the new, relative path of
01545 * the added item.
01546 *
01547 * @since New in 1.3.
01548 */
01549 svn_error_t *
01550 svn_client_copy2 (svn_commit_info_t **commit_info_p,
01551 const char *src_path,
01552 const svn_opt_revision_t *src_revision,
01553 const char *dst_path,
01554 svn_client_ctx_t *ctx,
01555 apr_pool_t *pool);
01556
01557
01558 /** Similar to svn_client_copy2(), but uses @c svn_client_commit_info_t
01559 * for @a commit_info_p.
01560 *
01561 * @deprecated Provided for backward compatibility with the 1.2 API.
01562 */
01563 svn_error_t *
01564 svn_client_copy (svn_client_commit_info_t **commit_info_p,
01565 const char *src_path,
01566 const svn_opt_revision_t *src_revision,
01567 const char *dst_path,
01568 svn_client_ctx_t *ctx,
01569 apr_pool_t *pool);
01570
01571
01572 /**
01573 * Move @a src_path to @a dst_path.
01574 *
01575 * @a src_path must be a file or directory under version control, or the
01576 * URL of a versioned item in the repository.
01577 *
01578 * If @a src_path is a repository URL:
01579 *
01580 * - @a dst_path must also be a repository URL (existent or not).
01581 *
01582 * - the authentication baton in @a ctx and @a ctx->log_msg_func/@a
01583 * ctx->log_msg_baton are used to commit the move.
01584 *
01585 * - The move operation will be immediately committed. If the
01586 * commit succeeds, allocate (in @a pool) and populate @a *commit_info_p.
01587 *
01588 * If @a src_path is a working copy path:
01589 *
01590 * - @a dst_path must also be a working copy path (existent or not).
01591 *
01592 * - @a ctx->log_msg_func and @a ctx->log_msg_baton are ignored.
01593 *
01594 * - This is a scheduling operation. No changes will happen to the
01595 * repository until a commit occurs. This scheduling can be removed
01596 * with svn_client_revert(). If @a src_path is a file it is removed
01597 * from the working copy immediately. If @a src_path is a directory it
01598 * will remain n the working copy but all the files, and unversioned
01599 * items, it contains will be removed.
01600 *
01601 * - If @a src_path contains locally modified and/or unversioned items
01602 * and @a force is not set, the copy will fail. If @a force is set such
01603 * items will be removed.
01604 *
01605 * @a ctx->log_msg_func/@a ctx->log_msg_baton are a callback/baton combo that
01606 * this function can use to query for a commit log message when one is needed.
01607 *
01608 * If @a ctx->notify_func2 is non-null, then for each item moved, call
01609 * @a ctx->notify_func2 with the @a ctx->notify_baton2 twice, once to indicate
01610 * the deletion of the moved thing, and once to indicate the addition of
01611 * the new location of the thing.
01612 *
01613 * ### Is this really true? What about svn_wc_notify_commit_replaced()? ###
01614 *
01615 * @since New in 1.3.
01616 */
01617 svn_error_t *
01618 svn_client_move3 (svn_commit_info_t **commit_info_p,
01619 const char *src_path,
01620 const char *dst_path,
01621 svn_boolean_t force,
01622 svn_client_ctx_t *ctx,
01623 apr_pool_t *pool);
01624
01625 /** Similar to svn_client_move3(), but uses @c svn_client_commit_info_t
01626 * for @a commit_info_p.
01627 *
01628 * @deprecated Provided for backward compatibility with the 1.2 API.
01629 *
01630 * @since New in 1.2.
01631 */
01632 svn_error_t *
01633 svn_client_move2 (svn_client_commit_info_t **commit_info_p,
01634 const char *src_path,
01635 const char *dst_path,
01636 svn_boolean_t force,
01637 svn_client_ctx_t *ctx,
01638 apr_pool_t *pool);
01639
01640 /**
01641 * Similar to svn_client_move2(), but an extra argument @a src_revision
01642 * must be passed. This has no effect, but must be of kind
01643 * @c svn_opt_revision_unspecified or @c svn_opt_revision_head,
01644 * otherwise error @c SVN_ERR_UNSUPPORTED_FEATURE is returned.
01645 *
01646 * @deprecated Provided for backward compatibility with the 1.1 API.
01647 */
01648 svn_error_t *
01649 svn_client_move (svn_client_commit_info_t **commit_info_p,
01650 const char *src_path,
01651 const svn_opt_revision_t *src_revision,
01652 const char *dst_path,
01653 svn_boolean_t force,
01654 svn_client_ctx_t *ctx,
01655 apr_pool_t *pool);
01656
01657
01658 /** Properties
01659 *
01660 * Note that certain svn-controlled properties must always have their
01661 * values set and stored in UTF8 with LF line endings. When
01662 * retrieving these properties, callers must convert the values back
01663 * to native locale and native line-endings before displaying them to
01664 * the user. For help with this task, see
01665 * svn_prop_needs_translation(), svn_subst_translate_string(), and
01666 * svn_subst_detranslate_string().
01667 *
01668 * @defgroup svn_client_prop_funcs property functions
01669 * @{
01670 */
01671
01672
01673 /**
01674 * Set @a propname to @a propval on @a target. If @a recurse is true,
01675 * then @a propname will be set on recursively on @a target and all
01676 * children. If @a recurse is false, and @a target is a directory, @a
01677 * propname will be set on _only_ @a target.
01678 *
01679 * A @a propval of @c NULL will delete the property.
01680 *
01681 * If @a propname is an svn-controlled property (i.e. prefixed with
01682 * @c SVN_PROP_PREFIX), then the caller is responsible for ensuring that
01683 * the value is UTF8-encoded and uses LF line-endings.
01684 *
01685 * If @a skip_checks is true, do no validity checking. But if @a
01686 * skip_checks is false, and @a propname is not a valid property for @a
01687 * target, return an error, either @c SVN_ERR_ILLEGAL_TARGET (if the
01688 * property is not appropriate for @a target), or @c
01689 * SVN_ERR_BAD_MIME_TYPE (if @a propname is "svn:mime-type", but @a
01690 * propval is not a valid mime-type).
01691 *
01692 * If @a ctx->cancel_func is non-null, invoke it passing @a
01693 * ctx->cancel_baton at various places during the operation.
01694 *
01695 * Use @a pool for all memory allocation.
01696 *
01697 * @since New in 1.2.
01698 */
01699 svn_error_t *
01700 svn_client_propset2 (const char *propname,
01701 const svn_string_t *propval,
01702 const char *target,
01703 svn_boolean_t recurse,
01704 svn_boolean_t skip_checks,
01705 svn_client_ctx_t *ctx,
01706 apr_pool_t *pool);
01707
01708 /**
01709 * Like svn_client_propset2(), but with @a skip_checks always false and a
01710 * newly created @a ctx.
01711 *
01712 * @deprecated Provided for backward compatibility with the 1.1 API.
01713 */
01714 svn_error_t *
01715 svn_client_propset (const char *propname,
01716 const svn_string_t *propval,
01717 const char *target,
01718 svn_boolean_t recurse,
01719 apr_pool_t *pool);
01720
01721 /** Set @a propname to @a propval on revision @a revision in the repository
01722 * represented by @a URL. Use the authentication baton in @a ctx for
01723 * authentication, and @a pool for all memory allocation. Return the actual
01724 * rev affected in @a *set_rev. A @a propval of @c NULL will delete the
01725 * property.
01726 *
01727 * If @a force is true, allow newlines in the author property.
01728 *
01729 * If @a propname is an svn-controlled property (i.e. prefixed with
01730 * @c SVN_PROP_PREFIX), then the caller is responsible for ensuring that
01731 * the value UTF8-encoded and uses LF line-endings.
01732 *
01733 * Note that unlike its cousin svn_client_propset2(), this routine
01734 * doesn't affect the working copy at all; it's a pure network
01735 * operation that changes an *unversioned* property attached to a
01736 * revision. This can be used to tweak log messages, dates, authors,
01737 * and the like. Be careful: it's a lossy operation.
01738 *
01739 * Also note that unless the administrator creates a
01740 * pre-revprop-change hook in the repository, this feature will fail.
01741 */
01742 svn_error_t *
01743 svn_client_revprop_set (const char *propname,
01744 const svn_string_t *propval,
01745 const char *URL,
01746 const svn_opt_revision_t *revision,
01747 svn_revnum_t *set_rev,
01748 svn_boolean_t force,
01749 svn_client_ctx_t *ctx,
01750 apr_pool_t *pool);
01751
01752 /**
01753 * Set @a *props to a hash table whose keys are `<tt>char *</tt>' paths,
01754 * prefixed by @a target (a working copy path or a URL), of items on
01755 * which property @a propname is set, and whose values are `@c svn_string_t
01756 * *' representing the property value for @a propname at that path.
01757 *
01758 * Allocate @a *props, its keys, and its values in @a pool.
01759 *
01760 * Don't store any path, not even @a target, if it does not have a
01761 * property named @a propname.
01762 *
01763 * If @a revision->kind is @c svn_opt_revision_unspecified, then: get
01764 * properties from the working copy if @a target is a working copy
01765 * path, or from the repository head if @a target is a URL. Else get
01766 * the properties as of @a revision. The actual node revision
01767 * selected is determined by the path as it exists in @a peg_revision.
01768 * If @a peg_revision->kind is @c svn_opt_revision_unspecified, then
01769 * it defaults to @c svn_opt_revision_head for URLs or @c
01770 * svn_opt_revision_working for WC targets. Use the authentication
01771 * baton in @a ctx for authentication if contacting the repository.
01772 *
01773 * If @a target is a file or @a recurse is false, @a *props will have
01774 * at most one element.
01775 *
01776 * If error, don't touch @a *props, otherwise @a *props is a hash table
01777 * even if empty.
01778 *
01779 * @since New in 1.2.
01780 */
01781 svn_error_t *
01782 svn_client_propget2 (apr_hash_t **props,
01783 const char *propname,
01784 const char *target,
01785 const svn_opt_revision_t *peg_revision,
01786 const svn_opt_revision_t *revision,
01787 svn_boolean_t recurse,
01788 svn_client_ctx_t *ctx,
01789 apr_pool_t *pool);
01790
01791 /**
01792 * Similar to svn_client_propget2(), except that the peg revision is
01793 * always the same as @a revision.
01794 *
01795 * @deprecated Provided for backward compatibility with the 1.1 API.
01796 */
01797 svn_error_t *
01798 svn_client_propget (apr_hash_t **props,
01799 const char *propname,
01800 const char *target,
01801 const svn_opt_revision_t *revision,
01802 svn_boolean_t recurse,
01803 svn_client_ctx_t *ctx,
01804 apr_pool_t *pool);
01805
01806 /** Set @a *propval to the value of @a propname on revision @a revision
01807 * in the repository represented by @a URL. Use the authentication baton
01808 * in @a ctx for authentication, and @a pool for all memory allocation.
01809 * Return the actual rev queried in @a *set_rev.
01810 *
01811 * Note that unlike its cousin svn_client_propget(), this routine
01812 * doesn't affect the working copy at all; it's a pure network
01813 * operation that queries an *unversioned* property attached to a
01814 * revision. This can query log messages, dates, authors, and the
01815 * like.
01816 */
01817 svn_error_t *
01818 svn_client_revprop_get (const char *propname,
01819 svn_string_t **propval,
01820 const char *URL,
01821 const svn_opt_revision_t *revision,
01822 svn_revnum_t *set_rev,
01823 svn_client_ctx_t *ctx,
01824 apr_pool_t *pool);
01825
01826 /**
01827 * Set @a *props to the regular properties of @a target, a URL or working
01828 * copy path.
01829 *
01830 * Each element of the returned array is (@c svn_client_proplist_item_t *).
01831 * For each item, item->node_name contains the name relative to the
01832 * same base as @a target, and @a item->prop_hash maps (<tt>const char *</tt>)
01833 * property names to (@c svn_string_t *) values.
01834 *
01835 * Allocate @a *props and its contents in @a pool.
01836 *
01837 * If @a revision->kind is @c svn_opt_revision_unspecified, then get
01838 * properties from the working copy, if @a target is a working copy
01839 * path, or from the repository head if @a target is a URL. Else get
01840 * the properties as of @a revision. The actual node revision
01841 * selected is determined by the path as it exists in @a peg_revision.
01842 * If @a peg_revision->kind is @c svn_opt_revision_unspecified, then it
01843 * defaults to @c svn_opt_revision_head for URLs or @c
01844 * svn_opt_revision_working for WC targets. Use the authentication
01845 * baton cached in @a ctx for authentication if contacting the
01846 * repository.
01847 *
01848 * If @a recurse is false, or @a target is a file, @a *props will contain
01849 * only a single element. Otherwise, it will contain one element for each
01850 * versioned entry below (and including) @a target.
01851 *
01852 * If @a target is not found, return the error @c SVN_ERR_ENTRY_NOT_FOUND.
01853 *
01854 * @since New in 1.2.
01855 */
01856 svn_error_t *
01857 svn_client_proplist2 (apr_array_header_t **props,
01858 const char *target,
01859 const svn_opt_revision_t *peg_revision,
01860 const svn_opt_revision_t *revision,
01861 svn_boolean_t recurse,
01862 svn_client_ctx_t *ctx,
01863 apr_pool_t *pool);
01864
01865 /**
01866 * Similar to svn_client_proplist2(), except that the peg revision is
01867 * always the same as @a revision.
01868 *
01869 * @deprecated Provided for backward compatibility with the 1.1 API.
01870 */
01871 svn_error_t *
01872 svn_client_proplist (apr_array_header_t **props,
01873 const char *target,
01874 const svn_opt_revision_t *revision,
01875 svn_boolean_t recurse,
01876 svn_client_ctx_t *ctx,
01877 apr_pool_t *pool);
01878
01879 /** Set @a *props to a hash of the revision props attached to @a revision in
01880 * the repository represented by @a URL. Use the authentication baton cached
01881 * in @a ctx for authentication, and @a pool for all memory allocation.
01882 * Return the actual rev queried in @a *set_rev.
01883 *
01884 * The allocated hash maps (<tt>const char *</tt>) property names to
01885 * (@c svn_string_t *) property values.
01886 *
01887 * Note that unlike its cousin svn_client_proplist(), this routine
01888 * doesn't read a working copy at all; it's a pure network operation
01889 * that reads *unversioned* properties attached to a revision.
01890 */
01891 svn_error_t *
01892 svn_client_revprop_list (apr_hash_t **props,
01893 const char *URL,
01894 const svn_opt_revision_t *revision,
01895 svn_revnum_t *set_rev,
01896 svn_client_ctx_t *ctx,
01897 apr_pool_t *pool);
01898 /** @} */
01899
01900
01901 /**
01902 * Export the contents of either a subversion repository or a
01903 * subversion working copy into a 'clean' directory (meaning a
01904 * directory with no administrative directories). If @a result_rev
01905 * is not @c NULL and the path being exported is a repository URL, set
01906 * @a *result_rev to the value of the revision actually exported (set
01907 * it to @c SVN_INVALID_REVNUM for local exports).
01908 *
01909 * @a from is either the path the working copy on disk, or a URL to the
01910 * repository you wish to export.
01911 *
01912 * @a to is the path to the directory where you wish to create the exported
01913 * tree.
01914 *
01915 * @a peg_revision is the revision where the path is first looked up
01916 * when exporting from a repository. If @a peg_revision->kind is @c
01917 * svn_opt_revision_unspecified, then it defaults to @c svn_opt_revision_head
01918 * for URLs or @c svn_opt_revision_working for WC targets.
01919 *
01920 * @a revision is the revision that should be exported, which is only used
01921 * when exporting from a repository.
01922 *
01923 * @a ctx->notify_func2 and @a ctx->notify_baton2 are the notification
01924 * functions and baton which are passed to svn_client_checkout() when
01925 * exporting from a repository.
01926 *
01927 * @a ctx is a context used for authentication in the repository case.
01928 *
01929 * @a overwrite if true will cause the export to overwrite files or directories.
01930 *
01931 * If @a ignore_externals is set, don't process externals definitions
01932 * as part of this operation.
01933 *
01934 * @a native_eol allows you to override the standard eol marker on the platform
01935 * you are running on. Can be either "LF", "CR" or "CRLF" or NULL. If NULL
01936 * will use the standard eol marker. Any other value will cause the
01937 * SVN_ERR_IO_UNKNOWN_EOL error to be returned.
01938 *
01939 * If @a recurse is TRUE, export recursively. Otherwise, export
01940 * just the directory represented by @a from and its immediate
01941 * non-directory children, but none of its child directories (if any).
01942 * Also, if @a recurse is FALSE, the export will behave as if
01943 * @a ignore_externals is TRUE.
01944 *
01945 * All allocations are done in @a pool.
01946 *
01947 * @since New in 1.2.
01948 */
01949 svn_error_t *
01950 svn_client_export3 (svn_revnum_t *result_rev,
01951 const char *from,
01952 const char *to,
01953 const svn_opt_revision_t *peg_revision,
01954 const svn_opt_revision_t *revision,
01955 svn_boolean_t overwrite,
01956 svn_boolean_t ignore_externals,
01957 svn_boolean_t recurse,
01958 const char *native_eol,
01959 svn_client_ctx_t *ctx,
01960 apr_pool_t *pool);
01961
01962
01963 /**
01964 * Similar to svn_client_export3(), but with the @a peg_revision
01965 * parameter always set to @c svn_opt_revision_unspecified, @a
01966 * overwrite set to the value of @a force, @a ignore_externals
01967 * always false, and @a recurse always true.
01968 *
01969 * @since New in 1.1.
01970 * @deprecated Provided for backward compatibility with the 1.1 API.
01971 */
01972 svn_error_t *
01973 svn_client_export2 (svn_revnum_t *result_rev,
01974 const char *from,
01975 const char *to,
01976 svn_opt_revision_t *revision,
01977 svn_boolean_t force,
01978 const char *native_eol,
01979 svn_client_ctx_t *ctx,
01980 apr_pool_t *pool);
01981
01982
01983 /**
01984 * Similar to svn_client_export2(), but with the @a native_eol parameter
01985 * always set to @c NULL.
01986 *
01987 * @deprecated Provided for backward compatibility with the 1.0 API.
01988 */
01989 svn_error_t *
01990 svn_client_export (svn_revnum_t *result_rev,
01991 const char *from,
01992 const char *to,
01993 svn_opt_revision_t *revision,
01994 svn_boolean_t force,
01995 svn_client_ctx_t *ctx,
01996 apr_pool_t *pool);
01997
01998
01999 /**
02000 * Set @a *dirents to a newly allocated hash of entries for @a
02001 * path_or_url at @a revision. The actual node revision selected is
02002 * determined by the path as it exists in @a peg_revision. If @a
02003 * peg_revision->kind is @c svn_opt_revision_unspecified, then it defaults
02004 * to @c svn_opt_revision_head for URLs or @c svn_opt_revision_working
02005 * for WC targets.
02006 *
02007 * If @a path_or_url is a directory, return all dirents in the hash. If
02008 * @a path_or_url is a file, return only the dirent for the file. If @a
02009 * path_or_url is non-existent, return @c SVN_ERR_FS_NOT_FOUND.
02010 *
02011 * The @a dirents hash maps entry names (<tt>const char *</tt>) to
02012 * @c svn_dirent_t *'s. Do all allocation in @a pool.
02013 *
02014 * If @a locks is not @c NULL, set @a *locks to a hash table mapping
02015 * entry names (<tt>const char *</tt>) to @c svn_lock_t *'s,
02016 * allocating both @a *locks and everything inside it in @a pool.
02017 * This hash represents any existing repository locks on entries.
02018 *
02019 * Use authentication baton cached in @a ctx to authenticate against the
02020 * repository.
02021 *
02022 * If @a recurse is true (and @a path_or_url is a directory) this will
02023 * be a recursive operation.
02024 *
02025 * @since New in 1.3.
02026 */
02027 svn_error_t *
02028 svn_client_ls3 (apr_hash_t **dirents,
02029 apr_hash_t **locks,
02030 const char *path_or_url,
02031 const svn_opt_revision_t *peg_revision,
02032 const svn_opt_revision_t *revision,
02033 svn_boolean_t recurse,
02034 svn_client_ctx_t *ctx,
02035 apr_pool_t *pool);
02036
02037 /**
02038 * Same as svn_client_ls3(), but always passes a NULL lock hash.
02039 *
02040 * @since New in 1.2.
02041 *
02042 * @deprecated Provided for backward compatibility with the 1.2 API.
02043 */
02044 svn_error_t *
02045 svn_client_ls2 (apr_hash_t **dirents,
02046 const char *path_or_url,
02047 const svn_opt_revision_t *peg_revision,
02048 const svn_opt_revision_t *revision,
02049 svn_boolean_t recurse,
02050 svn_client_ctx_t *ctx,
02051 apr_pool_t *pool);
02052
02053 /**
02054 * Similar to svn_client_ls2() except that the peg revision is always
02055 * the same as @a revision.
02056 *
02057 * @deprecated Provided for backward compatibility with the 1.1 API.
02058 */
02059 svn_error_t *
02060 svn_client_ls (apr_hash_t **dirents,
02061 const char *path_or_url,
02062 svn_opt_revision_t *revision,
02063 svn_boolean_t recurse,
02064 svn_client_ctx_t *ctx,
02065 apr_pool_t *pool);
02066
02067
02068 /**
02069 * Output the content of file identified by @a path_or_url and @a
02070 * revision to the stream @a out. The actual node revision selected
02071 * is determined by the path as it exists in @a peg_revision. If @a
02072 * peg_revision->kind is @c svn_opt_revision_unspecified, then it defaults
02073 * to @c svn_opt_revision_head for URLs or @c svn_opt_revision_working
02074 * for WC targets.
02075 *
02076 * If @a path_or_url is not a local path, then if @a revision is of
02077 * kind @c svn_opt_revision_previous (or some other kind that requires
02078 * a local path), an error will be returned, because the desired
02079 * revision cannot be determined.
02080 *
02081 * Use the authentication baton cached in @a ctx to authenticate against the
02082 * repository.
02083 *
02084 * Perform all allocations from @a pool.
02085 *
02086 * ### TODO: Add an expansion/translation flag?
02087 *
02088 * @since New in 1.2.
02089 */
02090 svn_error_t *
02091 svn_client_cat2 (svn_stream_t *out,
02092 const char *path_or_url,
02093 const svn_opt_revision_t *peg_revision,
02094 const svn_opt_revision_t *revision,
02095 svn_client_ctx_t *ctx,
02096 apr_pool_t *pool);
02097
02098
02099 /**
02100 * Similar to svn_client_cat2() except that the peg revision is always
02101 * the same as @a revision.
02102 *
02103 * @deprecated Provided for backward compatibility with the 1.1 API.
02104 */
02105 svn_error_t *
02106 svn_client_cat (svn_stream_t *out,
02107 const char *path_or_url,
02108 const svn_opt_revision_t *revision,
02109 svn_client_ctx_t *ctx,
02110 apr_pool_t *pool);
02111
02112
02113 /** Locking commands
02114 *
02115 * @defgroup svn_client_locking_funcs Client Locking Functions
02116 * @{
02117 */
02118
02119 /**
02120 * Lock @a targets in the repository. @a targets is an array of
02121 * <tt>const char *</tt> paths - either all working copy paths or URLs. All
02122 * @a targets must be in the same repository.
02123 *
02124 * If a target is already locked in the repository, no lock will be
02125 * acquired unless @a steal_lock is TRUE, in which case the locks are
02126 * stolen. @a comment, if non-null, is an xml-escapable description
02127 * stored with each lock in the repository. Each acquired lock will
02128 * be stored in the working copy if the targets are WC paths.
02129 *
02130 * For each target @a ctx->notify_func2/notify_baton2 will be used to indicate
02131 * whether it was locked. An action of @c svn_wc_notify_state_locked
02132 * means that the path was locked. If the path was not locked because
02133 * it was out-of-date or there was already a lock in the repository,
02134 * the notification function will be called with @c
02135 * svn_wc_notify_failed_lock, and the error passed in the notification
02136 * structure.
02137 *
02138 * Use @a pool for temporary allocations.
02139 *
02140 * @since New in 1.2.
02141 */
02142 svn_error_t *
02143 svn_client_lock (const apr_array_header_t *targets,
02144 const char *comment,
02145 svn_boolean_t steal_lock,
02146 svn_client_ctx_t *ctx,
02147 apr_pool_t *pool);
02148
02149 /**
02150 * Unlock @a targets in the repository. @a targets is an array of
02151 * <tt>const char *</tt> paths - either all working copy paths or all URLs.
02152 * All @a targets must be in the same repository.
02153 *
02154 * If the targets are WC paths, and @a break_lock is false, the working
02155 * copy must contain a locks for each target.
02156 * If this is not the case, or the working copy lock doesn't match the
02157 * lock token in the repository, an error will be signaled.
02158 *
02159 * If the targets are URLs, the locks may be broken even if @a break_lock
02160 * is false, but only if the lock owner is the same as the
02161 * authenticated user.
02162 *
02163 * If @a break_lock is true, the locks will be broken in the
02164 * repository. In both cases, the locks, if any, will be removed from
02165 * the working copy if the targets are WC paths.
02166 *
02167 * The notification functions in @a ctx will be called for each
02168 * target. If the target was successfully unlocked, @c
02169 * svn_wc_notify_unlocked will be used. Else, if the error is
02170 * directly related to unlocking the path (see @c
02171 * SVN_ERR_IS_UNLOCK_ERROR), @c svn_wc_notify_failed_unlock will be
02172 * used and the error will be passed in the notification structure.
02173
02174 * Use @a pool for temporary allocations.
02175 *
02176 * @since New in 1.2.
02177 */
02178 svn_error_t *
02179 svn_client_unlock (const apr_array_header_t *targets,
02180 svn_boolean_t break_lock,
02181 svn_client_ctx_t *ctx,
02182 apr_pool_t *pool);
02183
02184 /** @} */
02185
02186 /**
02187 * A structure which describes various system-generated metadata about
02188 * a working-copy path or URL.
02189 *
02190 * @note Fields may be added to the end of this structure in future
02191 * versions. Therefore, users shouldn't allocate structures of this
02192 * type, to preserve binary compatibility.
02193 *
02194 * @since New in 1.2.
02195 */
02196 typedef struct svn_info_t
02197 {
02198 /** Where the item lives in the repository. */
02199 const char *URL;
02200
02201 /** The revision of the object. If path_or_url is a working-copy
02202 * path, then this is its current working revnum. If path_or_url
02203 * is a URL, then this is the repos revision that path_or_url lives in. */
02204 svn_revnum_t rev;
02205
02206 /** The node's kind. */
02207 svn_node_kind_t kind;
02208
02209 /** The root URL of the repository. */
02210 const char *repos_root_URL;
02211
02212 /** The repository's UUID. */
02213 const char *repos_UUID;
02214
02215 /** The last revision in which this object changed. */
02216 svn_revnum_t last_changed_rev;
02217
02218 /** The date of the last_changed_rev. */
02219 apr_time_t last_changed_date;
02220
02221 /** The author of the last_changed_rev. */
02222 const char *last_changed_author;
02223
02224 /** An exclusive lock, if present. Could be either local or remote. */
02225 svn_lock_t *lock;
02226
02227 /** Whether or not to ignore the next 10 wc-specific fields. */
02228 svn_boolean_t has_wc_info;
02229
02230 /**
02231 * @name Working-copy path fields
02232 * These things only apply to a working-copy path.
02233 * See svn_wc_entry_t for explanations.
02234 * @{
02235 */
02236 svn_wc_schedule_t schedule;
02237 const char *copyfrom_url;
02238 svn_revnum_t copyfrom_rev;
02239 apr_time_t text_time;
02240 apr_time_t prop_time;
02241 const char *checksum;
02242 const char *conflict_old;
02243 const char *conflict_new;
02244 const char *conflict_wrk;
02245 const char *prejfile;
02246 /** @} */
02247
02248 } svn_info_t;
02249
02250
02251 /**
02252 * The callback invoked by svn_client_info(). Each invocation
02253 * describes @a path with the information present in @a info. Note
02254 * that any fields within @a info may be NULL if information is
02255 * unavailable. Use @a pool for all temporary allocation.
02256 *
02257 * @since New in 1.2.
02258 */
02259 typedef svn_error_t *(*svn_info_receiver_t)
02260 (void *baton,
02261 const char *path,
02262 const svn_info_t *info,
02263 apr_pool_t *pool);
02264
02265 /**
02266 * Return a duplicate of @a info, allocated in @a pool. No part of the new
02267 * structure will be shared with @a info.
02268 *
02269 * @since New in 1.3.
02270 */
02271 svn_info_t *
02272 svn_info_dup(const svn_info_t *info, apr_pool_t *pool);
02273
02274 /**
02275 * Invoke @a receiver with @a receiver_baton to return information
02276 * about @a path_or_url in @a revision. The information returned is
02277 * system-generated metadata, not the sort of "property" metadata
02278 * created by users. See @c svn_info_t.
02279 *
02280 * If both revision arguments are either @c
02281 * svn_opt_revision_unspecified or NULL, then information will be
02282 * pulled solely from the working copy; no network connections will be
02283 * made.
02284 *
02285 * Otherwise, information will be pulled from a repository. The
02286 * actual node revision selected is determined by the @a path_or_url
02287 * as it exists in @a peg_revision. If @a peg_revision->kind is @c
02288 * svn_opt_revision_unspecified, then it defaults to @c
02289 * svn_opt_revision_head for URLs or @c svn_opt_revision_working for
02290 * WC targets.
02291 *
02292 * If @a path_or_url is not a local path, then if @a revision is of
02293 * kind @c svn_opt_revision_previous (or some other kind that requires
02294 * a local path), an error will be returned, because the desired
02295 * revision cannot be determined.
02296 *
02297 * Use the authentication baton cached in @a ctx to authenticate
02298 * against the repository.
02299 *
02300 * If @a recurse is true (and @a path_or_url is a directory) this will
02301 * be a recursive operation, invoking @a receiver on each child.
02302 *
02303 *
02304 * @since New in 1.2.
02305 */
02306 svn_error_t *
02307 svn_client_info (const char *path_or_url,
02308 const svn_opt_revision_t *peg_revision,
02309 const svn_opt_revision_t *revision,
02310 svn_info_receiver_t receiver,
02311 void *receiver_baton,
02312 svn_boolean_t recurse,
02313 svn_client_ctx_t *ctx,
02314 apr_pool_t *pool);
02315
02316
02317
02318
02319 /* Converting paths to URLs. */
02320
02321 /** Set @a *url to the URL for @a path_or_url.
02322 *
02323 * If @a path_or_url is already a URL, set @a *url to @a path_or_url.
02324 *
02325 * If @a path_or_url is a versioned item, set @a *url to @a
02326 * path_or_url's entry URL. If @a path_or_url is unversioned (has
02327 * no entry), set @a *url to null.
02328 */
02329 svn_error_t *
02330 svn_client_url_from_path (const char **url,
02331 const char *path_or_url,
02332 apr_pool_t *pool);
02333
02334
02335
02336
02337 /* Fetching repository UUIDs. */
02338
02339 /** Get repository @a uuid for @a url.
02340 *
02341 * Use a @a pool to open a temporary RA session to @a url, discover the
02342 * repository uuid, and free the session. Return the uuid in @a uuid,
02343 * allocated in @a pool. @a ctx is required for possible repository
02344 * authentication.
02345 */
02346 svn_error_t *
02347 svn_client_uuid_from_url (const char **uuid,
02348 const char *url,
02349 svn_client_ctx_t *ctx,
02350 apr_pool_t *pool);
02351
02352
02353 /** Return the repository @a uuid for working-copy @a path, allocated
02354 * in @a pool. Use @a adm_access to retrieve the uuid from @a path's
02355 * entry; if not present in the entry, then call
02356 * svn_client_uuid_from_url() to retrieve, using the entry's URL. @a
02357 * ctx is required for possible repository authentication.
02358 *
02359 * @note The only reason this function falls back on
02360 * svn_client_uuid_from_url() is for compatibility purposes. Old
02361 * working copies may not have uuids in the entries file.
02362 */
02363 svn_error_t *
02364 svn_client_uuid_from_path (const char **uuid,
02365 const char *path,
02366 svn_wc_adm_access_t *adm_access,
02367 svn_client_ctx_t *ctx,
02368 apr_pool_t *pool);
02369
02370
02371 /* Opening RA sessions. */
02372
02373 /** Open an RA session rooted at @a url, and return it in @a *session.
02374 *
02375 * Use the authentication baton stored in @a ctx for authentication.
02376 * @a *session is allocated in @a pool.
02377 *
02378 * @since New in 1.3.
02379 *
02380 * @note This function is similar to svn_ra_open2(), but the caller avoids
02381 * having to providing its own callback functions.
02382 */
02383 svn_error_t *
02384 svn_client_open_ra_session (svn_ra_session_t **session,
02385 const char *url,
02386 svn_client_ctx_t *ctx,
02387 apr_pool_t *pool);
02388
02389 #ifdef __cplusplus
02390 }
02391 #endif /* __cplusplus */
02392
02393 #endif /* SVN_CLIENT_H */
1.2.14 written by Dimitri van Heesch,
© 1997-2002