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