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 00043 00044 #ifdef __cplusplus 00045 extern "C" { 00046 #endif /* __cplusplus */ 00047 00048 00049 /* ### TODO: Multiple Targets 00050 00051 - Up for debate: an update on multiple targets is *not* atomic. 00052 Right now, svn_client_update only takes one path. What's 00053 debatable is whether this should ever change. On the one hand, 00054 it's kind of losing to have the client application loop over 00055 targets and call svn_client_update() on each one; each call to 00056 update initializes a whole new repository session (network 00057 overhead, etc.) On the other hand, it's a very simple 00058 implementation, and allows for the possibility that different 00059 targets may come from different repositories. */ 00060 00061 00062 00063 /*** Authentication stuff ***/ 00064 00065 /* The new authentication system allows the RA layer to "pull" 00066 information as needed from libsvn_client. See svn_ra.h */ 00067 00068 /** Create and return @a *provider, an authentication provider of type 00069 * svn_auth_cred_simple_t that gets information by prompting the user 00070 * with @a prompt_func and @a prompt_baton. Allocate @a *provider in 00071 * @a pool. 00072 * 00073 * If either @c SVN_AUTH_PARAM_DEFAULT_USERNAME or 00074 * @c SVN_AUTH_PARAM_DEFAULT_PASSWORD is defined as a runtime 00075 * parameter in the @c auth_baton, then @a *provider will return the 00076 * default argument(s) when @c svn_auth_first_credentials is called. If 00077 * @c svn_auth_first_credentials fails, then @a *provider will 00078 * re-prompt @a retry_limit times (via @c svn_auth_next_credentials). 00079 */ 00080 void svn_client_get_simple_prompt_provider ( 00081 svn_auth_provider_object_t **provider, 00082 svn_auth_simple_prompt_func_t prompt_func, 00083 void *prompt_baton, 00084 int retry_limit, 00085 apr_pool_t *pool); 00086 00087 00088 /** Create and return @a *provider, an authentication provider of type @c 00089 * svn_auth_cred_username_t that gets information by prompting the 00090 * user with @a prompt_func and @a prompt_baton. Allocate @a *provider 00091 * in @a pool. 00092 * 00093 * If @c SVN_AUTH_PARAM_DEFAULT_USERNAME is defined as a runtime 00094 * parameter in the @c auth_baton, then @a *provider will return the 00095 * default argument when @c svn_auth_first_credentials is called. If 00096 * @c svn_auth_first_credentials fails, then @a *provider will 00097 * re-prompt @a retry_limit times (via @c svn_auth_next_credentials). 00098 */ 00099 void svn_client_get_username_prompt_provider ( 00100 svn_auth_provider_object_t **provider, 00101 svn_auth_username_prompt_func_t prompt_func, 00102 void *prompt_baton, 00103 int retry_limit, 00104 apr_pool_t *pool); 00105 00106 00107 /** Create and return @a *provider, an authentication provider of type @c 00108 * svn_auth_cred_simple_t that gets/sets information from the user's 00109 * ~/.subversion configuration directory. Allocate @a *provider in 00110 * @a pool. 00111 * 00112 * If a default username or password is available, @a *provider will 00113 * honor them as well, and return them when @c 00114 * svn_auth_first_credentials is called. (see @c 00115 * SVN_AUTH_PARAM_DEFAULT_USERNAME and @c 00116 * SVN_AUTH_PARAM_DEFAULT_PASSWORD). 00117 */ 00118 void svn_client_get_simple_provider (svn_auth_provider_object_t **provider, 00119 apr_pool_t *pool); 00120 00121 00122 /** Create and return @a *provider, an authentication provider of type @c 00123 * svn_auth_cred_username_t that gets/sets information from a user's 00124 * ~/.subversion configuration directory. Allocate @a *provider in 00125 * @a pool. 00126 * 00127 * If a default username is available, @a *provider will honor it, 00128 * and return it when @c svn_auth_first_credentials is called. (see 00129 * @c SVN_AUTH_PARAM_DEFAULT_USERNAME). 00130 */ 00131 void svn_client_get_username_provider (svn_auth_provider_object_t **provider, 00132 apr_pool_t *pool); 00133 00134 00135 /** Create and return @a *provider, an authentication provider of type @c 00136 * svn_auth_cred_ssl_server_trust_t, allocated in @a pool. 00137 * 00138 * @a *provider retrieves its credentials from the configuration 00139 * mechanism. The returned credential is used to override SSL 00140 * security on an error. 00141 */ 00142 void svn_client_get_ssl_server_trust_file_provider ( 00143 svn_auth_provider_object_t **provider, 00144 apr_pool_t *pool); 00145 00146 00147 /** Create and return @a *provider, an authentication provider of type @c 00148 * svn_auth_cred_ssl_client_cert_t, allocated in @a pool. 00149 * 00150 * @a *provider retrieves its credentials from the configuration 00151 * mechanism. The returned credential is used to load the appropriate 00152 * client certificate for authentication when requested by a server. 00153 */ 00154 void svn_client_get_ssl_client_cert_file_provider ( 00155 svn_auth_provider_object_t **provider, 00156 apr_pool_t *pool); 00157 00158 00159 /** Create and return @a *provider, an authentication provider of type @c 00160 * svn_auth_cred_ssl_client_cert_pw_t, allocated in @a pool. 00161 * 00162 * @a *provider retrieves its credentials from the configuration 00163 * mechanism. The returned credential is used when a loaded client 00164 * certificate is protected by a passphrase. 00165 */ 00166 void svn_client_get_ssl_client_cert_pw_file_provider ( 00167 svn_auth_provider_object_t **provider, 00168 apr_pool_t *pool); 00169 00170 00171 /** Create and return @a *provider, an authentication provider of type @c 00172 * svn_auth_cred_ssl_server_trust_t, allocated in @a pool. 00173 * 00174 * @a *provider retrieves its credentials by using the @a prompt_func 00175 * and @a prompt_baton. The returned credential is used to override 00176 * SSL security on an error. 00177 */ 00178 void svn_client_get_ssl_server_trust_prompt_provider ( 00179 svn_auth_provider_object_t **provider, 00180 svn_auth_ssl_server_trust_prompt_func_t prompt_func, 00181 void *prompt_baton, 00182 apr_pool_t *pool); 00183 00184 00185 /** Create and return @a *provider, an authentication provider of type @c 00186 * svn_auth_cred_ssl_client_cert_t, allocated in @a pool. 00187 * 00188 * @a *provider retrieves its credentials by using the @a prompt_func 00189 * and @a prompt_baton. The returned credential is used to load the 00190 * appropriate client certificate for authentication when requested by 00191 * a server. The prompt will be retried @a retry_limit times. 00192 */ 00193 void svn_client_get_ssl_client_cert_prompt_provider ( 00194 svn_auth_provider_object_t **provider, 00195 svn_auth_ssl_client_cert_prompt_func_t prompt_func, 00196 void *prompt_baton, 00197 int retry_limit, 00198 apr_pool_t *pool); 00199 00200 00201 /** Create and return @a *provider, an authentication provider of type @c 00202 * svn_auth_cred_ssl_client_cert_pw_t, allocated in @a pool. 00203 * 00204 * @a *provider retrieves its credentials by using the @a prompt_func 00205 * and @a prompt_baton. The returned credential is used when a loaded 00206 * client certificate is protected by a passphrase. The prompt will 00207 * be retried @a retry_limit times. 00208 */ 00209 void svn_client_get_ssl_client_cert_pw_prompt_provider ( 00210 svn_auth_provider_object_t **provider, 00211 svn_auth_ssl_client_cert_pw_prompt_func_t prompt_func, 00212 void *prompt_baton, 00213 int retry_limit, 00214 apr_pool_t *pool); 00215 00216 00217 /** This is a structure which stores a filename and a hash of property 00218 * names and values. 00219 */ 00220 typedef struct svn_client_proplist_item_t 00221 { 00222 /** The name of the node on which these properties are set. */ 00223 svn_stringbuf_t *node_name; 00224 00225 /** A hash of (const char *) property names, and (svn_string_t *) property 00226 * values. */ 00227 apr_hash_t *prop_hash; 00228 00229 } svn_client_proplist_item_t; 00230 00231 00232 /** Information about commits passed back to client from this module. */ 00233 typedef struct svn_client_commit_info_t 00234 { 00235 /** just-committed revision. */ 00236 svn_revnum_t revision; 00237 00238 /** server-side date of the commit. */ 00239 const char *date; 00240 00241 /** author of the commit. */ 00242 const char *author; 00243 00244 } svn_client_commit_info_t; 00245 00246 00247 /** State flags for use with the @c svn_client_commit_item_t structure 00248 * 00249 * (see the note about the namespace for that structure, which also 00250 * applies to these flags). 00251 * @defgroup svn_client_commit_item_flags state flags 00252 * @{ 00253 */ 00254 #define SVN_CLIENT_COMMIT_ITEM_ADD 0x01 00255 #define SVN_CLIENT_COMMIT_ITEM_DELETE 0x02 00256 #define SVN_CLIENT_COMMIT_ITEM_TEXT_MODS 0x04 00257 #define SVN_CLIENT_COMMIT_ITEM_PROP_MODS 0x08 00258 #define SVN_CLIENT_COMMIT_ITEM_IS_COPY 0x10 00259 /** @} */ 00260 00261 /** The commit candidate structure. */ 00262 typedef struct svn_client_commit_item_t 00263 { 00264 /** absolute working-copy path of item */ 00265 const char *path; 00266 00267 /** node kind (dir, file) */ 00268 svn_node_kind_t kind; 00269 00270 /** commit URL for this item */ 00271 const char *url; 00272 00273 /** revision (copyfrom-rev if _IS_COPY) */ 00274 svn_revnum_t revision; 00275 00276 /** copyfrom-url */ 00277 const char *copyfrom_url; 00278 00279 /** state flags */ 00280 apr_byte_t state_flags; 00281 00282 /** An array of `svn_prop_t *' changes to wc properties. If adding 00283 * to this array, allocate the svn_prop_t and its contents in 00284 * wcprop_changes->pool, so that it has the same lifetime as this 00285 * svn_client_commit_item_t. 00286 * 00287 * See http://subversion.tigris.org/issues/show_bug.cgi?id=806 for 00288 * what would happen if the post-commit process didn't group these 00289 * changes together with all other changes to the item :-). 00290 */ 00291 apr_array_header_t *wcprop_changes; 00292 00293 } svn_client_commit_item_t; 00294 00295 00296 /** Callback type used by commit-y operations to get a commit log message 00297 * from the caller. 00298 * 00299 * Set @a *log_msg to the log message for the commit, allocated in @a 00300 * pool, or @c NULL if wish to abort the commit process. Set @a *tmpfile 00301 * to the path of any temporary file which might be holding that log 00302 * message, or @c NULL if no such file exists (though, if @a *log_msg is 00303 * @c NULL, this value is undefined). The log message MUST be a UTF8 00304 * string with LF line separators. 00305 * 00306 * @a commit_items is an array of @c svn_client_commit_item_t structures, 00307 * which may be fully or only partially filled-in, depending on the 00308 * type of commit operation. 00309 * 00310 * @a baton is provided along with the callback for use by the handler. 00311 * 00312 * All allocations should be performed in @a pool. 00313 */ 00314 typedef svn_error_t * 00315 (*svn_client_get_commit_log_t) (const char **log_msg, 00316 const char **tmp_file, 00317 apr_array_header_t *commit_items, 00318 void *baton, 00319 apr_pool_t *pool); 00320 00321 /** Callback type used by svn_client_blame() to notify the caller 00322 * that line @a line_no of the blamed file was last changed in 00323 * @a revision by @a author on @a date, and that the contents were 00324 * @a line. 00325 * 00326 * All allocations should be performed in @a pool. 00327 */ 00328 typedef svn_error_t * 00329 (*svn_client_blame_receiver_t) (void *baton, 00330 apr_int64_t line_no, 00331 svn_revnum_t revision, 00332 const char *author, 00333 const char *date, 00334 const char *line, 00335 apr_pool_t *pool); 00336 00337 00338 /** A client context structure, which holds client specific callbacks, 00339 * batons, serves as a cache for configuration options, and other various 00340 * and sundry things. In order to avoid backwards compatability problems 00341 * clients should use @c svn_client_create_context() to allocate and 00342 * intialize this structure instead of doing so themselves. 00343 */ 00344 typedef struct svn_client_ctx_t 00345 { 00346 /** main authentication baton. */ 00347 svn_auth_baton_t *auth_baton; 00348 00349 /** notification callback function */ 00350 svn_wc_notify_func_t notify_func; 00351 00352 /** notification callback baton */ 00353 void *notify_baton; 00354 00355 /** log message callback function */ 00356 svn_client_get_commit_log_t log_msg_func; 00357 00358 /** log message callback baton */ 00359 void *log_msg_baton; 00360 00361 /** a hash mapping of <tt>const char *</tt> configuration file names to 00362 * @c svn_config_t *'s, for example, the '~/.subversion/config' file's 00363 * contents should have the key "config". 00364 */ 00365 apr_hash_t *config; 00366 00367 /** a callback to be used to see if the client wishes to cancel the running 00368 * operation. */ 00369 svn_cancel_func_t cancel_func; 00370 00371 /** a baton to pass to the cancellation callback. */ 00372 void *cancel_baton; 00373 00374 } svn_client_ctx_t; 00375 00376 00377 /** Names of files that contain authentication information. 00378 * 00379 * These filenames are decided by libsvn_client, since this library 00380 * implements all the auth-protocols; libsvn_wc does nothing but 00381 * blindly store and retrieve these files from protected areas. 00382 * 00383 * @defgroup svn_client_auth_files authentication files 00384 * @{ 00385 */ 00386 #define SVN_CLIENT_AUTH_USERNAME "username" 00387 #define SVN_CLIENT_AUTH_PASSWORD "password" 00388 /** @} */ 00389 00390 00391 /** Initialize a client context. 00392 * Return a client context in @a *ctx (allocated in @a pool) that 00393 * represents a particular instance of the svn client. 00394 * 00395 * In order to avoid backwards compatability problems, clients must 00396 * use this function to intialize and allocate the 00397 * @c svn_client_ctx_t structure rather than doing so themselves, as 00398 * the size of this structure may change in the future. 00399 */ 00400 svn_error_t * 00401 svn_client_create_context (svn_client_ctx_t **ctx, 00402 apr_pool_t *pool); 00403 00404 /** Checkout a working copy of @a URL at @a revision, using @a path as 00405 * the root directory of the newly checked out working copy, and 00406 * authenticating with the authentication baton cached in @a ctx. If 00407 * @a result_rev is not @c NULL, set @a *result_rev to the value of 00408 * the revision actually checked out from the repository. 00409 * 00410 * @a revision must be of kind @c svn_opt_revision_number, 00411 * @c svn_opt_revision_head, or @c svn_opt_revision_date. If 00412 * @c revision does not meet these requirements, return the error 00413 * @c SVN_ERR_CLIENT_BAD_REVISION. 00414 * 00415 * If @a ctx->notify_func is non-null, invoke @a ctx->notify_func with 00416 * @a ctx->notify_baton as the checkout progresses. 00417 * 00418 * Use @a pool for any temporary allocation. 00419 */ 00420 svn_error_t * 00421 svn_client_checkout (svn_revnum_t *result_rev, 00422 const char *URL, 00423 const char *path, 00424 const svn_opt_revision_t *revision, 00425 svn_boolean_t recurse, 00426 svn_client_ctx_t *ctx, 00427 apr_pool_t *pool); 00428 00429 00430 /** Update working tree @a path to @a revision, authenticating with 00431 * the authentication baton cached in @a ctx. If @a result_rev is not 00432 * @c NULL, set @a *result_rev to the value of the revision to which 00433 * the working copy was actually updated. 00434 * 00435 * @a revision must be of kind @c svn_opt_revision_number, 00436 * @c svn_opt_revision_head, or @c svn_opt_revision_date. If @a 00437 * revision does not meet these requirements, return the error 00438 * @c SVN_ERR_CLIENT_BAD_REVISION. 00439 * 00440 * If @a ctx->notify_func is non-null, invoke @a ctx->notify_func with 00441 * @a ctx->notify_baton for each item handled by the update, and also for 00442 * files restored from text-base. 00443 * 00444 * If @a path is not found, return the error @c SVN_ERR_ENTRY_NOT_FOUND. 00445 * 00446 * Use @a pool for any temporary allocation. 00447 */ 00448 svn_error_t * 00449 svn_client_update (svn_revnum_t *result_rev, 00450 const char *path, 00451 const svn_opt_revision_t *revision, 00452 svn_boolean_t recurse, 00453 svn_client_ctx_t *ctx, 00454 apr_pool_t *pool); 00455 00456 00457 /** Switch working tree @a path to @a url at @a revision, 00458 * authenticating with the authentication baton cached in @a ctx. If 00459 * @a result_rev is not @c NULL, set @a *result_rev to the value of 00460 * the revision to which the working copy was actually switched. 00461 * 00462 * Summary of purpose: this is normally used to switch a working 00463 * directory over to another line of development, such as a branch or 00464 * a tag. Switching an existing working directory is more efficient 00465 * than checking out @a url from scratch. 00466 * 00467 * @a revision must be of kind @c svn_opt_revision_number, 00468 * @c svn_opt_revision_head, or @c svn_opt_revision_date; otherwise, 00469 * return @c SVN_ERR_CLIENT_BAD_REVISION. 00470 * 00471 * If @a ctx->notify_func is non-null, invoke it with @a ctx->notify_baton 00472 * on paths affected by the switch. Also invoke it for files may be restored 00473 * from the text-base because they were removed from the working copy. 00474 * 00475 * Use @a pool for any temporary allocation. 00476 */ 00477 svn_error_t * 00478 svn_client_switch (svn_revnum_t *result_rev, 00479 const char *path, 00480 const char *url, 00481 const svn_opt_revision_t *revision, 00482 svn_boolean_t recurse, 00483 svn_client_ctx_t *ctx, 00484 apr_pool_t *pool); 00485 00486 00487 /** Schedule a working copy @a path for addition to the repository. 00488 * 00489 * @a path's parent must be under revision control already, but @a 00490 * path is not. If @a recursive is set, then assuming @a path is a 00491 * directory, all of its contents will be scheduled for addition as 00492 * well. 00493 * 00494 * If @a ctx->notify_func is non-null, then for each added item, call 00495 * @a ctx->notify_func with @a ctx->notify_baton and the path of the 00496 * added item. 00497 * 00498 * Important: this is a *scheduling* operation. No changes will 00499 * happen to the repository until a commit occurs. This scheduling 00500 * can be removed with svn_client_revert. 00501 */ 00502 svn_error_t * 00503 svn_client_add (const char *path, 00504 svn_boolean_t recursive, 00505 svn_client_ctx_t *ctx, 00506 apr_pool_t *pool); 00507 00508 /** Create a directory, either in a repository or a working copy. 00509 * 00510 * If @a paths contains URLs, use the authentication baton in @a ctx 00511 * and @a message to immediately attempt to commit the creation of the 00512 * directories in @a paths in the repository. If the commit succeeds, 00513 * allocate (in @a pool) and populate @a *commit_info. 00514 * 00515 * Else, create the directories on disk, and attempt to schedule them 00516 * for addition (using @c svn_client_add, whose docstring you should 00517 * read). 00518 * 00519 * @a ctx->log_msg_func/@a ctx->log_msg_baton are a callback/baton combo that 00520 * this function can use to query for a commit log message when one is 00521 * needed. 00522 * 00523 * If @a ctx->notify_func is non-null, when the directory has been created 00524 * (successfully) in the working copy, call @a ctx->notify_func with 00525 * @a ctx->notify_baton and the path of the new directory. Note that this is 00526 * only called for items added to the working copy. */ 00527 svn_error_t * 00528 svn_client_mkdir (svn_client_commit_info_t **commit_info, 00529 const apr_array_header_t *paths, 00530 svn_client_ctx_t *ctx, 00531 apr_pool_t *pool); 00532 00533 00534 /** Delete items from a repository or working copy. 00535 * 00536 * If the paths in @a paths are URLs, use the authentication baton in 00537 * @a ctx and @a ctx->log_msg_func/@a ctx->log_msg_baton to 00538 * immediately attempt to commit a deletion of the URLs from the 00539 * repository. If the commit succeeds, allocate (in @a pool) and 00540 * populate @a *commit_info. Every path must belong to the same 00541 * repository. 00542 * 00543 * Else, schedule the working copy paths in @a paths for removal from 00544 * the repository. Each path's parent must be under revision control. 00545 * This is just a *scheduling* operation. No changes will happen to 00546 * the repository until a commit occurs. This scheduling can be 00547 * removed with @c svn_client_revert. If a path is a file it is 00548 * immediately removed from the working copy. If the path is a 00549 * directory it will remain in the working copy but all the files, and 00550 * all unversioned items, it contains will be removed. If @a force is 00551 * not set then this operation will fail if any path contains locally 00552 * modified and/or unversioned items. If @a force is set such items 00553 * will be deleted. 00554 * 00555 * @a ctx->log_msg_func/@a ctx->log_msg_baton are a callback/baton combo that 00556 * this function can use to query for a commit log message when one is 00557 * needed. 00558 * 00559 * If @a ctx->notify_func is non-null, then for each item deleted, call 00560 * @a ctx->notify_func with @a ctx->notify_baton and the path of the deleted 00561 * item. */ 00562 svn_error_t * 00563 svn_client_delete (svn_client_commit_info_t **commit_info, 00564 const apr_array_header_t *paths, 00565 svn_boolean_t force, 00566 svn_client_ctx_t *ctx, 00567 apr_pool_t *pool); 00568 00569 00570 /** Import file or directory @a path into repository directory @a url at 00571 * head, authenticating with the authentication baton cached in @a ctx, 00572 * and using @a ctx->log_msg_func/@a ctx->log_msg_baton to get a log message 00573 * for the (implied) commit. Set @a *commit_info to the results of the 00574 * commit, allocated in @a pool. If some components of @a url do not exist 00575 * then create parent directories as necessary. 00576 * 00577 * If @a path is a directory, the contents of that directory are 00578 * imported directly into the directory identified by @a url. Note that the 00579 * directory @a path itself is not imported -- that is, the basename of 00580 * @a path is not part of the import. 00581 * 00582 * If @a path is a file, then the dirname of @a url is the directory 00583 * receiving the import. The basename of @a url is the filename in the 00584 * repository. In this case if @a url already exists, return error. 00585 * 00586 * If @a ctx->notify_func is non-null, then call @a ctx->notify_func with 00587 * @a ctx->notify_baton as the import progresses, with any of the following 00588 * actions: @c svn_wc_notify_commit_added, 00589 * @c svn_wc_notify_commit_postfix_txdelta. 00590 * 00591 * Use @a pool for any temporary allocation. 00592 * 00593 * @a ctx->log_msg_func/@a ctx->log_msg_baton are a callback/baton combo that 00594 * this function can use to query for a commit log message when one is needed. 00595 * 00596 * Use @a nonrecursive to indicate that imported directories should not 00597 * recurse into any subdirectories they may have. 00598 * 00599 * ### kff todo: This import is similar to cvs import, in that it does 00600 * not change the source tree into a working copy. However, this 00601 * behavior confuses most people, and I think eventually svn _should_ 00602 * turn the tree into a working copy, or at least should offer the 00603 * option. However, doing so is a bit involved, and we don't need it 00604 * right now. 00605 */ 00606 svn_error_t *svn_client_import (svn_client_commit_info_t **commit_info, 00607 const char *path, 00608 const char *url, 00609 svn_boolean_t nonrecursive, 00610 svn_client_ctx_t *ctx, 00611 apr_pool_t *pool); 00612 00613 00614 /** Commit file or directory @a path into repository, authenticating with 00615 * the authentication baton cached in @a ctx, and using 00616 * @a ctx->log_msg_func/@a ctx->log_msg_baton to obtain the log message. 00617 * Set @a *commit_info to the results of the commit, allocated in @a pool. 00618 * 00619 * @a targets is an array of <tt>const char *</tt> paths to commit. They 00620 * need not be canonicalized nor condensed; this function will take care of 00621 * that. If @a targets has zero elements, then do nothing and return 00622 * immediately without error. 00623 * 00624 * If @a notify_func is non-null, then call @a ctx->notify_func with 00625 * @a ctx->notify_baton as the commit progresses, with any of the following 00626 * actions: @c svn_wc_notify_commit_modified, @c svn_wc_notify_commit_added, 00627 * @c svn_wc_notify_commit_deleted, @c svn_wc_notify_commit_replaced, 00628 * @c svn_wc_notify_commit_postfix_txdelta. 00629 * 00630 * Use @a nonrecursive to indicate that subdirectories of directory 00631 * @a targets should be ignored. 00632 * 00633 * Use @a pool for any temporary allocation. 00634 * 00635 * If no error is returned and @a (*commit_info)->revision is set to 00636 * @c SVN_INVALID_REVNUM, then the commit was a no-op; nothing needed to 00637 * be committed. 00638 */ 00639 svn_error_t * 00640 svn_client_commit (svn_client_commit_info_t **commit_info, 00641 const apr_array_header_t *targets, 00642 svn_boolean_t nonrecursive, 00643 svn_client_ctx_t *ctx, 00644 apr_pool_t *pool); 00645 00646 00647 /** Given @a path to a working copy directory (or single file), call 00648 * @a status_func/status_baton with a set of @c svn_wc_status_t * 00649 * structures which describe the status of @a path and its children. 00650 * 00651 * - If @a descend is non-zero, recurse fully, else do only 00652 * immediate children. 00653 * 00654 * - If @a get_all is set, retrieve all entries; otherwise, 00655 * retrieve only "interesting" entries (local mods and/or 00656 * out-of-date). 00657 * 00658 * - If @a update is set, contact the repository and augment the 00659 * status structures with information about out-of-dateness (with 00660 * respect to @a revision). Also, if @a result_rev is not @c NULL, 00661 * set @a *result_rev to the actual revision against which the 00662 * working copy was compared (@a *result_rev is not meaningful unless 00663 * @a update is set). 00664 * 00665 * This function recurses into externals definitions ('svn:externals') 00666 * after handling the main target, if any exist. The function calls 00667 * the client notification function (in @a ctx) with the @c 00668 * svn_wc_notify_status_external action before handling each externals 00669 * definition, and with @c svn_wc_notify_status_completed after each. 00670 */ 00671 svn_error_t * 00672 svn_client_status (svn_revnum_t *result_rev, 00673 const char *path, 00674 svn_opt_revision_t *revision, 00675 svn_wc_status_func_t status_func, 00676 void *status_baton, 00677 svn_boolean_t descend, 00678 svn_boolean_t get_all, 00679 svn_boolean_t update, 00680 svn_boolean_t no_ignore, 00681 svn_client_ctx_t *ctx, 00682 apr_pool_t *pool); 00683 00684 00685 /** Invoke @a receiver with @a receiver_baton on each log message from @a 00686 * start to @a end in turn, inclusive (but never invoke @a receiver on a 00687 * given log message more than once). 00688 * 00689 * @a targets contains all the working copy paths (as <tt>const char 00690 * *</tt>'s) for which log messages are desired. The repository info is 00691 * determined by taking the common prefix of the target entries' URLs. 00692 * @a receiver is invoked only on messages 00693 * whose revisions involved a change to some path in @a targets. 00694 * 00695 * ### todo: the above paragraph is not fully implemented yet. 00696 * 00697 * If @a discover_changed_paths is set, then the `@a changed_paths' argument 00698 * to @a receiver will be passed on each invocation. 00699 * 00700 * If @a strict_node_history is set, copy history (if any exists) will 00701 * not be traversed while harvesting revision logs for each target. 00702 * 00703 * If @a start->kind or @a end->kind is @c svn_opt_revision_unspecified, 00704 * return the error @c SVN_ERR_CLIENT_BAD_REVISION. 00705 * 00706 * Use @a pool for any temporary allocation. 00707 * 00708 * Special case for repositories at revision 0: 00709 * 00710 * If @a start->kind is @c svn_opt_revision_head, and @a end->kind is 00711 * @c svn_opt_revision_number && @a end->number is @c 1, then handle an 00712 * empty (no revisions) repository specially: instead of erroring 00713 * because requested revision 1 when the highest revision is 0, just 00714 * invoke @a receiver on revision 0, passing @c NULL for changed paths and 00715 * empty strings for the author and date. This is because that 00716 * particular combination of @a start and @a end usually indicates the 00717 * common case of log invocation -- the user wants to see all log 00718 * messages from youngest to oldest, where the oldest commit is 00719 * revision 1. That works fine, except when there are no commits in 00720 * the repository, hence this special case. 00721 * 00722 * If @a ctx->notify_func is non-null, then call @a ctx->notify_func/baton 00723 * with a 'skip' signal on any unversioned targets. 00724 * 00725 */ 00726 svn_error_t * 00727 svn_client_log (const apr_array_header_t *targets, 00728 const svn_opt_revision_t *start, 00729 const svn_opt_revision_t *end, 00730 svn_boolean_t discover_changed_paths, 00731 svn_boolean_t strict_node_history, 00732 svn_log_message_receiver_t receiver, 00733 void *receiver_baton, 00734 svn_client_ctx_t *ctx, 00735 apr_pool_t *pool); 00736 00737 /** Invoke @a receiver with @a receiver_baton on each line-blame item 00738 * associated with revision @a end of @a path_or_url, using @a start 00739 * as the default source of all blame. 00740 * 00741 * If @a start->kind or @a end->kind is @c svn_opt_revision_unspecified, 00742 * return the error @c SVN_ERR_CLIENT_BAD_REVISION. If any of the 00743 * revisions of @a path_or_url have a binary mime-type, return the 00744 * error @c SVN_ERR_UNSUPPORTED_FEATURE. 00745 * 00746 * Use @a pool for any temporary allocation. 00747 */ 00748 svn_error_t * 00749 svn_client_blame (const char *path_or_url, 00750 const svn_opt_revision_t *start, 00751 const svn_opt_revision_t *end, 00752 svn_client_blame_receiver_t receiver, 00753 void *receiver_baton, 00754 svn_client_ctx_t *ctx, 00755 apr_pool_t *pool); 00756 00757 /** Produce diff output which describes the delta between 00758 * @a path1/@a revision1 and @a path2/@a revision2. Print the output 00759 * of the diff to @a outfile, and any errors to @a errfile. @a path1 00760 * and @a path2 can be either working-copy paths or URLs. 00761 * 00762 * If either @a revision1 or @a revision2 has an `unspecified' or 00763 * unrecognized `kind', return @c SVN_ERR_CLIENT_BAD_REVISION. 00764 * 00765 * @a path1 and @a path2 must both represent the same node kind -- that 00766 * is, if @a path1 is a directory, @a path2 must also be, and if @a path1 00767 * is a file, @a path2 must also be. (Currently, @a path1 and @a path2 00768 * must be the exact same path) 00769 * 00770 * If @a recurse is true (and the @a paths are directories) this will be a 00771 * recursive operation. 00772 * 00773 * Use @a ignore_ancestry to control whether or not items being 00774 * diffed will be checked for relatedness first. Unrelated items 00775 * are typically transmitted to the editor as a deletion of one thing 00776 * and the addition of another, but if this flag is @c TRUE, 00777 * unrelated items will be diffed as if they were related. 00778 * 00779 * If @a no_diff_deleted is true, then no diff output will be 00780 * generated on deleted files. 00781 * 00782 * @a diff_options (an array of <tt>const char *</tt>) is used to pass 00783 * additional command line options to the diff processes invoked to compare 00784 * files. 00785 * 00786 * the authentication baton cached in @a ctx is used to communicate with 00787 * the repository. 00788 */ 00789 svn_error_t *svn_client_diff (const apr_array_header_t *diff_options, 00790 const char *path1, 00791 const svn_opt_revision_t *revision1, 00792 const char *path2, 00793 const svn_opt_revision_t *revision2, 00794 svn_boolean_t recurse, 00795 svn_boolean_t ignore_ancestry, 00796 svn_boolean_t no_diff_deleted, 00797 apr_file_t *outfile, 00798 apr_file_t *errfile, 00799 svn_client_ctx_t *ctx, 00800 apr_pool_t *pool); 00801 00802 00803 /** Merge changes from @a source1/@a revision1 to @a source2/@a revision2 into 00804 * the working-copy path @a target_wcpath. 00805 * 00806 * @a source1 and @a source2 are either URLs that refer to entries in the 00807 * repository, or paths to entries in the working copy. 00808 * 00809 * By "merging", we mean: apply file differences using 00810 * @c svn_wc_merge, and schedule additions & deletions when appropriate. 00811 * 00812 * @a source1 and @a source2 must both represent the same node kind -- that 00813 * is, if @a source1 is a directory, @a source2 must also be, and if @a source1 00814 * is a file, @a source2 must also be. 00815 * 00816 * If either @a revision1 or @a revision2 has an `unspecified' or 00817 * unrecognized `kind', return @c SVN_ERR_CLIENT_BAD_REVISION. 00818 * 00819 * If @a recurse is true (and the URLs are directories), apply changes 00820 * recursively; otherwise, only apply changes in the current 00821 * directory. 00822 * 00823 * Use @a ignore_ancestry to control whether or not items being 00824 * diffed will be checked for relatedness first. Unrelated items 00825 * are typically transmitted to the editor as a deletion of one thing 00826 * and the addition of another, but if this flag is @c TRUE, 00827 * unrelated items will be diffed as if they were related. 00828 * 00829 * If @a force is not set and the merge involves deleting locally modified or 00830 * unversioned items the operation will fail. If @a force is set such items 00831 * will be deleted. 00832 * 00833 * If @a ctx->notify_func is non-null, then call @a ctx->notify_func with @a 00834 * ctx->notify_baton once for each merged target, passing the target's local 00835 * path. 00836 * 00837 * If @a dry_run is @a true the merge is carried out, and full notification 00838 * feedback is provided, but the working copy is not modified. 00839 * 00840 * the authentication baton cached in @a ctx is used to communicate with the 00841 * repository. 00842 */ 00843 svn_error_t * 00844 svn_client_merge (const char *source1, 00845 const svn_opt_revision_t *revision1, 00846 const char *source2, 00847 const svn_opt_revision_t *revision2, 00848 const char *target_wcpath, 00849 svn_boolean_t recurse, 00850 svn_boolean_t ignore_ancestry, 00851 svn_boolean_t force, 00852 svn_boolean_t dry_run, 00853 svn_client_ctx_t *ctx, 00854 apr_pool_t *pool); 00855 00856 00857 /** Recursively cleanup a working copy directory @a dir, finishing any 00858 * incomplete operations, removing lockfiles, etc. 00859 * 00860 * If @a ctx->cancel_func is non-null, invoke it with @a 00861 * ctx->cancel_baton at various points during the operation. If it 00862 * returns an error (typically SVN_ERR_CANCELLED), return that error 00863 * immediately. 00864 */ 00865 svn_error_t * 00866 svn_client_cleanup (const char *dir, 00867 svn_client_ctx_t *ctx, 00868 apr_pool_t *pool); 00869 00870 00871 /** 00872 * Modify a working copy directory @a dir, changing any 00873 * repository URLs that begin with @a from to begin with @a to instead, 00874 * recursing into subdirectories if @a recurse is true. 00875 * 00876 * @param dir Working copy directory 00877 * @param from Original URL 00878 * @param to New URL 00879 * @param recurse Whether to recurse 00880 * @param pool The pool from which to perform memory allocations 00881 */ 00882 svn_error_t * 00883 svn_client_relocate (const char *dir, 00884 const char *from, 00885 const char *to, 00886 svn_boolean_t recurse, 00887 svn_client_ctx_t *ctx, 00888 apr_pool_t *pool); 00889 00890 00891 /** Restore the pristine version of a working copy @a paths, 00892 * effectively undoing any local mods. For each path in @a paths, if 00893 * it is a directory, and @a recursive is @a true, this will be a 00894 * recursive operation. 00895 * 00896 * If @a ctx->notify_func is non-null, then for each item reverted, 00897 * call @a ctx->notify_func with @a ctx->notify_baton and the path of 00898 * the reverted item. 00899 */ 00900 svn_error_t * 00901 svn_client_revert (const apr_array_header_t *paths, 00902 svn_boolean_t recursive, 00903 svn_client_ctx_t *ctx, 00904 apr_pool_t *pool); 00905 00906 00907 /** Remove the 'conflicted' state on a working copy @a path. This will 00908 * not semantically resolve conflicts; it just allows @a path to be 00909 * committed in the future. The implementation details are opaque. 00910 * If @a recursive is set, recurse below @a path, looking for conflicts 00911 * to resolve. 00912 * 00913 * If @a path is not in a state of conflict to begin with, do nothing. 00914 * If @a path's conflict state is removed and @a ctx->notify_func is non-null, 00915 * call @a ctx->notify_func with @a ctx->notify_baton and @a path. 00916 */ 00917 svn_error_t * 00918 svn_client_resolved (const char *path, 00919 svn_boolean_t recursive, 00920 svn_client_ctx_t *ctx, 00921 apr_pool_t *pool); 00922 00923 00924 /** Copy @a src_path to @a dst_path. 00925 * 00926 * @a src_path must be a file or directory under version control, or the 00927 * URL of a versioned item in the repository. If @a src_path is a 00928 * URL, @a src_revision is used to choose the revision from which to copy 00929 * the @a src_path. @a dst_path must be a file or directory under version 00930 * control, or a repository URL, existent or not. 00931 * 00932 * If @a dst_path is a URL, use the authentication baton 00933 * in @a ctx and @a ctx->log_msg_func/@a ctx->log_msg_baton to immediately 00934 * attempt to commit the copy action in the repository. If the commit 00935 * succeeds, allocate (in @a pool) and populate @a *commit_info. 00936 * 00937 * If @a dst_path is not a URL, then this is just a 00938 * variant of @c svn_client_add, where the @a dst_path items are scheduled 00939 * for addition as copies. No changes will happen to the repository 00940 * until a commit occurs. This scheduling can be removed with 00941 * @c svn_client_revert. 00942 * 00943 * @a ctx->log_msg_func/@a ctx->log_msg_baton are a callback/baton combo that 00944 * this function can use to query for a commit log message when one is 00945 * needed. 00946 * 00947 * If @a ctx->notify_func is non-null, invoke it with @a ctx->notify_baton 00948 * for each item added at the new location, passing the new, relative path of 00949 * the added item. 00950 */ 00951 svn_error_t * 00952 svn_client_copy (svn_client_commit_info_t **commit_info, 00953 const char *src_path, 00954 const svn_opt_revision_t *src_revision, 00955 const char *dst_path, 00956 svn_client_ctx_t *ctx, 00957 apr_pool_t *pool); 00958 00959 00960 /** Move @a src_path to @a dst_path. 00961 * 00962 * @a src_path must be a file or directory under version control, or the 00963 * URL of a versioned item in the repository. 00964 * 00965 * If @a src_path is a repository URL: 00966 * 00967 * - @a dst_path must also be a repository URL (existent or not). 00968 * 00969 * - @a src_revision is used to choose the revision from which to copy 00970 * the @a src_path. 00971 * 00972 * - the authentication baton in @a ctx and @a ctx->log_msg_func/@a 00973 * ctx->log_msg_baton are used to commit the move. 00974 * 00975 * - The move operation will be immediately committed. If the 00976 * commit succeeds, allocate (in @a pool) and populate @a *commit_info. 00977 * 00978 * If @a src_path is a working copy path 00979 * 00980 * - @a dst_path must also be a working copy path (existent or not). 00981 * 00982 * - @a src_revision, and @a ctx->log_msg_func/@a ctx->log_msg_baton are 00983 * ignored. 00984 * 00985 * - This is a scheduling operation. No changes will happen to the 00986 * repository until a commit occurs. This scheduling can be removed 00987 * with @c svn_client_revert. If @a src_path is a file it is removed 00988 * from the working copy immediately. If @a src_path is a directory it 00989 * will remain n the working copy but all the files, and unversioned 00990 * items, it contains will be removed. 00991 * 00992 * - If @a src_path contains locally modified and/or unversioned items 00993 * and @a force is not set, the copy will fail. If @a force is set such 00994 * items will be removed. 00995 * 00996 * @a ctx->log_msg_func/@a ctx->log_msg_baton are a callback/baton combo that 00997 * this function can use to query for a commit log message when one is needed. 00998 * 00999 * If @a ctx->notify_func is non-null, then for each item moved, call 01000 * @a ctx->notify_func with the @a ctx->notify_baton twice, once to indicate 01001 * the deletion of the moved thing, and once to indicate the addition of 01002 * the new location of the thing. 01003 * 01004 * ### Is this really true? What about @c svn_wc_notify_commit_replaced? ### 01005 */ 01006 svn_error_t * 01007 svn_client_move (svn_client_commit_info_t **commit_info, 01008 const char *src_path, 01009 const svn_opt_revision_t *src_revision, 01010 const char *dst_path, 01011 svn_boolean_t force, 01012 svn_client_ctx_t *ctx, 01013 apr_pool_t *pool); 01014 01015 01016 /** Properties 01017 * 01018 * Note that certain svn-controlled properties must always have their 01019 * values set and stored in UTF8 with LF line endings. When 01020 * retrieving these properties, callers must convert the values back 01021 * to native locale and native line-endings before displaying them to 01022 * the user. For help with this task, see 01023 * @c svn_prop_needs_translation, @c svn_subst_translate_string, and @c 01024 * svn_subst_detranslate_string. 01025 * 01026 * @defgroup svn_client_prop_funcs property functions 01027 * @{ 01028 */ 01029 01030 01031 /** Set @a propname to @a propval on @a target. If @a recurse is true, 01032 * then @a propname will be set on recursively on @a target and all 01033 * children. If @a recurse is false, and @a target is a directory, @a 01034 * propname will be set on _only_ @a target. 01035 * 01036 * A @a propval of @c NULL will delete the property. 01037 * 01038 * If @a propname is an svn-controlled property (i.e. prefixed with 01039 * @c SVN_PROP_PREFIX), then the caller is responsible for ensuring that 01040 * the value is UTF8-encoded and uses LF line-endings. 01041 * 01042 * Use @a pool for all memory allocation. 01043 */ 01044 svn_error_t * 01045 svn_client_propset (const char *propname, 01046 const svn_string_t *propval, 01047 const char *target, 01048 svn_boolean_t recurse, 01049 apr_pool_t *pool); 01050 01051 /** Set @a propname to @a propval on revision @a revision in the repository 01052 * represented by @a URL. Use the authentication baton in @a ctx for 01053 * authentication, and @a pool for all memory allocation. Return the actual 01054 * rev affected in @a *set_rev. A @a propval of @c NULL will delete the 01055 * property. 01056 * 01057 * If @a force is true, allow newlines in the author property. 01058 * 01059 * If @a propname is an svn-controlled property (i.e. prefixed with 01060 * @c SVN_PROP_PREFIX), then the caller is responsible for ensuring that 01061 * the value UTF8-encoded and uses LF line-endings. 01062 * 01063 * Note that unlike its cousin @c svn_client_propset, this routine 01064 * doesn't affect the working copy at all; it's a pure network 01065 * operation that changes an *unversioned* property attached to a 01066 * revision. This can be used to tweak log messages, dates, authors, 01067 * and the like. Be careful: it's a lossy operation. 01068 * 01069 * Also note that unless the administrator creates a 01070 * pre-revprop-change hook in the repository, this feature will fail. 01071 */ 01072 svn_error_t * 01073 svn_client_revprop_set (const char *propname, 01074 const svn_string_t *propval, 01075 const char *URL, 01076 const svn_opt_revision_t *revision, 01077 svn_revnum_t *set_rev, 01078 svn_boolean_t force, 01079 svn_client_ctx_t *ctx, 01080 apr_pool_t *pool); 01081 01082 /** Set @a *props to a hash table whose keys are `<tt>char *</tt>' paths, 01083 * prefixed by @a target (a working copy path or a URL), of items on 01084 * which property @a propname is set, and whose values are `@c svn_string_t 01085 * *' representing the property value for @a propname at that path. 01086 * 01087 * Allocate @a *props, its keys, and its values in @a pool. 01088 * 01089 * Don't store any path, not even @a target, if it does not have a 01090 * property named @a propname. 01091 * 01092 * If @a revision->kind is @c svn_opt_revision_unspecified, then: get 01093 * properties from the working copy if @a target is a working copy path, 01094 * or from the repository head if @a target is a URL. Else get the 01095 * properties as of @a revision. Use the authentication baton in @a ctx 01096 * for authentication if contacting the repository. 01097 * 01098 * If @a target is a file or @a recurse is false, @a *props will have 01099 * at most one element. 01100 * 01101 * If error, don't touch @a *props, otherwise @a *props is a hash table 01102 * even if empty. 01103 */ 01104 svn_error_t * 01105 svn_client_propget (apr_hash_t **props, 01106 const char *propname, 01107 const char *target, 01108 const svn_opt_revision_t *revision, 01109 svn_boolean_t recurse, 01110 svn_client_ctx_t *ctx, 01111 apr_pool_t *pool); 01112 01113 /** Set @a *propval to the value of @a propname on revision @a revision 01114 * in the repository represented by @a URL. Use the authentication baton 01115 * in @a ctx for authentication, and @a pool for all memory allocation. 01116 * Return the actual rev queried in @a *set_rev. 01117 * 01118 * Note that unlike its cousin @c svn_client_propget, this routine 01119 * doesn't affect the working copy at all; it's a pure network 01120 * operation that queries an *unversioned* property attached to a 01121 * revision. This can be query log messages, dates, authors, and the 01122 * like. 01123 */ 01124 svn_error_t * 01125 svn_client_revprop_get (const char *propname, 01126 svn_string_t **propval, 01127 const char *URL, 01128 const svn_opt_revision_t *revision, 01129 svn_revnum_t *set_rev, 01130 svn_client_ctx_t *ctx, 01131 apr_pool_t *pool); 01132 01133 /** Set @a *props to the regular properties of @a target, a URL or working 01134 * copy path. 01135 * 01136 * Each element of the returned array is (@c svn_client_proplist_item_t *). 01137 * For each item, item->node_name contains the name relative to the 01138 * same base as @a target, and @a item->prop_hash maps (<tt>const char *</tt>) 01139 * property names to (@c svn_string_t *) values. 01140 * 01141 * Allocate @a *props and its contents in @a pool. 01142 * 01143 * If @a revision->kind is @c svn_opt_revision_unspecified, then get 01144 * properties from the working copy, if @a target is a working copy path, 01145 * or from the repository head if @a target is a URL. Else get the 01146 * properties as of @a revision. Use the authentication baton cached in @a ctx 01147 * for authentication if contacting the repository. 01148 * 01149 * If @a recurse is false, or @a target is a file, @a *props will contain 01150 * only a single element. Otherwise, it will contain one element for each 01151 * versioned entry below (and including) @a target. 01152 * 01153 * If @a target is not found, return the error @c SVN_ERR_ENTRY_NOT_FOUND. 01154 */ 01155 svn_error_t * 01156 svn_client_proplist (apr_array_header_t **props, 01157 const char *target, 01158 const svn_opt_revision_t *revision, 01159 svn_boolean_t recurse, 01160 svn_client_ctx_t *ctx, 01161 apr_pool_t *pool); 01162 01163 /** Set @a *props to a hash of the revision props attached to @a revision in 01164 * the repository represented by @a URL. Use the authentication baton cached 01165 * in @a ctx for authentication, and @a pool for all memory allocation. 01166 * Return the actual rev queried in @a *set_rev. 01167 * 01168 * The allocated hash maps (<tt>const char *</tt>) property names to 01169 * (@c svn_string_t *) property values. 01170 * 01171 * Note that unlike its cousin @c svn_client_proplist, this routine 01172 * doesn't read a working copy at all; it's a pure network operation 01173 * that reads *unversioned* properties attached to a revision. 01174 */ 01175 svn_error_t * 01176 svn_client_revprop_list (apr_hash_t **props, 01177 const char *URL, 01178 const svn_opt_revision_t *revision, 01179 svn_revnum_t *set_rev, 01180 svn_client_ctx_t *ctx, 01181 apr_pool_t *pool); 01182 /** @} */ 01183 01184 01185 /** Export the contents of either a subversion repository or a 01186 * subversion working copy into a 'clean' directory (meaning a 01187 * directory with no administrative directories). If @a result_rev 01188 * is not @c NULL and the path being exported is a repository URL, set 01189 * @a *result_rev to the value of the revision actually exported (set 01190 * it to @c SVN_INVALID_REVNUM for local exports). 01191 * 01192 * @a from is either the path the working copy on disk, or a URL to the 01193 * repository you wish to export. 01194 * 01195 * @a to is the path to the directory where you wish to create the exported 01196 * tree. 01197 * 01198 * @a revision is the revision that should be exported, which is only used 01199 * when exporting from a repository. 01200 * 01201 * @a ctx->notify_func and @a ctx->notify_baton are the notification functions 01202 * and baton which are passed to @c svn_client_checkout when exporting from a 01203 * repository. 01204 * 01205 * @a ctx is a context used for authentication in the repository case. 01206 * 01207 * All allocations are done in @a pool. 01208 */ 01209 svn_error_t * 01210 svn_client_export (svn_revnum_t *result_rev, 01211 const char *from, 01212 const char *to, 01213 svn_opt_revision_t *revision, 01214 svn_boolean_t force, 01215 svn_client_ctx_t *ctx, 01216 apr_pool_t *pool); 01217 01218 01219 /** Set @a *dirents to a newly allocated hash of entries for @a path_or_url 01220 * at @a revision. 01221 * 01222 * If @a path_or_url is a directory, return all dirents in the hash. If 01223 * @a path_or_url is a file, return only the dirent for the file. If @a 01224 * path_or_url is non-existent, return @c SVN_ERR_FS_NOT_FOUND. 01225 * 01226 * The hash maps entrynames (<tt>const char *</tt>) to @c svn_dirent_t *'s. 01227 * Do all allocation in @a pool. 01228 * 01229 * Use authentication baton cached in @a ctx to authenticate against the 01230 * repository. 01231 * 01232 * If @a recurse is true (and @a path_or_url is a directory) this will 01233 * be a recursive operation. 01234 */ 01235 svn_error_t * 01236 svn_client_ls (apr_hash_t **dirents, 01237 const char *path_or_url, 01238 svn_opt_revision_t *revision, 01239 svn_boolean_t recurse, 01240 svn_client_ctx_t *ctx, 01241 apr_pool_t *pool); 01242 01243 01244 /** Output the content of file identified by @a path_or_url and @a 01245 * revision to the stream @a out. 01246 * 01247 * If @a path_or_url is not a local path, then if @a revision is of 01248 * kind @c svn_opt_revision_previous (or some other kind that requires 01249 * a local path), an error will be returned, because the desired 01250 * revision cannot be determined. 01251 * 01252 * Use the authentication baton cached in @a ctx to authenticate against the 01253 * repository. 01254 * 01255 * Perform all allocations from @a pool. 01256 * 01257 * ### TODO: Add an expansion/translation flag? 01258 */ 01259 svn_error_t * 01260 svn_client_cat (svn_stream_t *out, 01261 const char *path_or_url, 01262 const svn_opt_revision_t *revision, 01263 svn_client_ctx_t *ctx, 01264 apr_pool_t *pool); 01265 01266 01267 01268 /* Converting paths to URLs. */ 01269 01270 /** Set @a *url to the URL for @a path_or_url. 01271 * 01272 * If @a path_or_url is already a URL, set @a *url to @a path_or_url. 01273 * 01274 * If @a path_or_url is a versioned item, set @a *url to @a 01275 * path_or_url's entry URL. If @a path_or_url is unversioned (has 01276 * no entry), set @a *url to null. 01277 */ 01278 svn_error_t * 01279 svn_client_url_from_path (const char **url, 01280 const char *path_or_url, 01281 apr_pool_t *pool); 01282 01283 01284 01285 01286 /* Fetching repository UUIDs. */ 01287 01288 /** Get repository @a uuid for @a url. 01289 * 01290 * Use a @a pool to open a temporary RA session to @a url, discover the 01291 * repository uuid, and free the session. Return the uuid in @a uuid, 01292 * allocated in @a pool. @a ctx is required for possible repository 01293 * authentication. 01294 */ 01295 svn_error_t * 01296 svn_client_uuid_from_url (const char **uuid, 01297 const char *url, 01298 svn_client_ctx_t *ctx, 01299 apr_pool_t *pool); 01300 01301 01302 /** Return the repository @a uuid for working-copy @a path, allocated 01303 * in @a pool. Use @a adm_access to retrieve the uuid from @a path's 01304 * entry; if not present in the entry, then call 01305 * svn_client_uuid_from_url() to retrieve, using the entry's URL. @a 01306 * ctx is required for possible repository authentication. 01307 * 01308 * NOTE: the only reason this function falls back on 01309 * @c svn_client_uuid_from_url is for compatibility purposes. Old 01310 * working copies may not have uuids in the entries file. 01311 */ 01312 svn_error_t * 01313 svn_client_uuid_from_path (const char **uuid, 01314 const char *path, 01315 svn_wc_adm_access_t *adm_access, 01316 svn_client_ctx_t *ctx, 01317 apr_pool_t *pool); 01318 01319 #ifdef __cplusplus 01320 } 01321 #endif /* __cplusplus */ 01322 01323 #endif /* SVN_CLIENT_H */