Main Page   Modules   Data Structures   File List   Data Fields  

svn_client.h

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

Generated on Wed Aug 31 01:47:56 2005 for Subversion by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002