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