svn_ra.h

Go to the documentation of this file.
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_ra.h
00019  * @brief Repository Access
00020  */
00021 
00022 
00023 
00024 
00025 #ifndef SVN_RA_H
00026 #define SVN_RA_H
00027 
00028 #include <apr_pools.h>
00029 #include <apr_tables.h>
00030 
00031 #include "svn_error.h"
00032 #include "svn_delta.h"
00033 #include "svn_auth.h"
00034 
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif /* __cplusplus */
00038 
00039 
00040 
00041 /* Misc. declarations */
00042 
00043 /**
00044  * Get libsvn_ra version information.
00045  *
00046  * @since New in 1.1.
00047  */
00048 const svn_version_t *svn_ra_version(void);
00049 
00050 
00051 /** This is a function type which allows the RA layer to fetch working
00052  * copy (WC) properties.
00053  *
00054  * The @a baton is provided along with the function pointer and should
00055  * be passed back in. This will be the @a callback_baton or the 
00056  * @a close_baton as appropriate.
00057  *
00058  * @a path is relative to the "root" of the session, defined by the 
00059  * @a repos_url passed to the @c RA->open() vtable call.
00060  *
00061  * @a name is the name of the property to fetch. If the property is present,
00062  * then it is returned in @a value. Otherwise, @a *value is set to @c NULL.
00063  */
00064 typedef svn_error_t *(*svn_ra_get_wc_prop_func_t)(void *baton,
00065                                                   const char *relpath,
00066                                                   const char *name,
00067                                                   const svn_string_t **value,
00068                                                   apr_pool_t *pool);
00069 
00070 /** This is a function type which allows the RA layer to store new
00071  * working copy properties during update-like operations.  See the
00072  * comments for @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and 
00073  * @a name. The @a value is the value that will be stored for the property; 
00074  * a null @a value means the property will be deleted.
00075  */
00076 typedef svn_error_t *(*svn_ra_set_wc_prop_func_t)(void *baton,
00077                                                   const char *path,
00078                                                   const char *name,
00079                                                   const svn_string_t *value,
00080                                                   apr_pool_t *pool);
00081 
00082 /** This is a function type which allows the RA layer to store new
00083  * working copy properties as part of a commit.  See the comments for
00084  * @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and @a name.  
00085  * The @a value is the value that will be stored for the property; a 
00086  * @c NULL @a value means the property will be deleted.
00087  *
00088  * Note that this might not actually store the new property before
00089  * returning, but instead schedule it to be changed as part of
00090  * post-commit processing (in which case a successful commit means the
00091  * properties got written).  Thus, during the commit, it is possible
00092  * to invoke this function to set a new value for a wc prop, then read
00093  * the wc prop back from the working copy and get the *old* value.
00094  * Callers beware.
00095  */
00096 typedef svn_error_t *(*svn_ra_push_wc_prop_func_t)(void *baton,
00097                                                    const char *path,
00098                                                    const char *name,
00099                                                    const svn_string_t *value,
00100                                                    apr_pool_t *pool);
00101 
00102 /** This is a function type which allows the RA layer to invalidate
00103  * (i.e., remove) wcprops.  See the documentation for
00104  * @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and @a name.
00105  *
00106  * Unlike @c svn_ra_push_wc_prop_func_t, this has immediate effect.  If
00107  * it returns success, the wcprops have been removed.
00108  */
00109 typedef svn_error_t *(*svn_ra_invalidate_wc_props_func_t)(void *baton,
00110                                                           const char *path,
00111                                                           const char *name,
00112                                                           apr_pool_t *pool);
00113 
00114 
00115 /** A function type for retrieving the youngest revision from a repos. */
00116 typedef svn_error_t *(*svn_ra_get_latest_revnum_func_t)
00117   (void *session_baton,
00118    svn_revnum_t *latest_revnum);
00119 
00120 /**
00121  * A callback function type for use in @c get_file_revs.
00122  * @a baton is provided by the caller, @a path is the pathname of the file
00123  * in revision @a rev and @a rev_props are the revision properties.
00124  * If @a delta_handler and @a delta_baton are non-NULL, they may be set to a
00125  * handler/baton which will be called with the delta between the previous
00126  * revision and this one after the return of this callback.  They may be
00127  * left as NULL/NULL.
00128  * @a prop_diffs is an array of svn_prop_t elements indicating the property
00129  * delta for this and the previous revision.
00130  * @a pool may be used for temporary allocations, but you can't rely
00131  * on objects allocated to live outside of this particular call and the
00132  * immediately following calls to @a *delta_handler, if any.
00133  *
00134  * @since New in 1.1.
00135  */
00136 typedef svn_error_t *(*svn_ra_file_rev_handler_t)
00137   (void *baton,
00138    const char *path,
00139    svn_revnum_t rev,
00140    apr_hash_t *rev_props,
00141    svn_txdelta_window_handler_t *delta_handler,
00142    void **delta_baton,
00143    apr_array_header_t *prop_diffs,
00144    apr_pool_t *pool);
00145 
00146 /** 
00147  * Callback function type for locking and unlocking actions.
00148  * 
00149  * @since New in 1.2.
00150  *
00151  * @a do_lock is TRUE when locking @a path, and FALSE
00152  * otherwise.
00153  * 
00154  * @a lock is a lock for @a path or null if @a do_lock is false or @a ra_err is
00155  * non-null.
00156  *
00157  * @a ra_err is NULL unless the ra layer encounters a locking related
00158  * error which it passes back for notification purposes.  The caller
00159  * is responsible for clearing @a ra_err after the callback is run.
00160  *
00161  * @a baton is a closure object; it should be provided by the
00162  * implementation, and passed by the caller.  @a pool may be used for
00163  * temporary allocation.
00164  */
00165 typedef svn_error_t *(*svn_ra_lock_callback_t)(void *baton,
00166                                                const char *path,
00167                                                svn_boolean_t do_lock,
00168                                                const svn_lock_t *lock,
00169                                                svn_error_t *ra_err,
00170                                                apr_pool_t *pool);
00171 
00172 /**
00173  * Callback function type for progress notification.
00174  *
00175  * @a progress is the number of bytes already transferred, @a total is
00176  * the total number of bytes to transfer or -1 if it's not known, @a
00177  * baton is the callback baton.
00178  *
00179  * @since New in 1.3.
00180  */
00181 typedef void (*svn_ra_progress_notify_func_t)(apr_off_t progress,
00182                                               apr_off_t total,
00183                                               void *baton,
00184                                               apr_pool_t *pool);
00185 
00186 
00187 /**
00188  * The update Reporter.
00189  *
00190  * A vtable structure which allows a working copy to describe a subset
00191  * (or possibly all) of its working-copy to an RA layer, for the
00192  * purposes of an update, switch, status, or diff operation.
00193  *
00194  * Paths for report calls are relative to the target (not the anchor)
00195  * of the operation.  Report calls must be made in depth-first order:
00196  * parents before children, all children of a parent before any
00197  * siblings of the parent.  The first report call must be a set_path
00198  * with a @a path argument of "" and a valid revision.  (If the target
00199  * of the operation is locally deleted or missing, use the anchor's
00200  * revision.)  If the target of the operation is deleted or switched
00201  * relative to the anchor, follow up the initial set_path call with a
00202  * link_path or delete_path call with a @a path argument of "" to
00203  * indicate that.  In no other case may there be two report
00204  * descriptions for the same path.  If the target of the operation is
00205  * a locally added file or directory (which previously did not exist),
00206  * it may be reported as having revision 0 or as having the parent
00207  * directory's revision.
00208  *
00209  * @since New in 1.2.
00210  */
00211 typedef struct svn_ra_reporter2_t
00212 {
00213   /** Describe a working copy @a path as being at a particular @a revision.  
00214    *
00215    * If @a start_empty is set and @a path is a directory, the
00216    * implementor should assume the directory has no entries or props.
00217    *
00218    * This will *override* any previous set_path() calls made on parent
00219    * paths.  @a path is relative to the URL specified in @c RA->open().
00220    *
00221    * If @a lock_token is non-NULL, it is the lock token for @a path in the WC.
00222    * 
00223    * All temporary allocations are done in @a pool.
00224    */
00225   svn_error_t *(*set_path)(void *report_baton,
00226                            const char *path,
00227                            svn_revnum_t revision,
00228                            svn_boolean_t start_empty,
00229                            const char *lock_token,
00230                            apr_pool_t *pool);
00231 
00232   /** Describing a working copy @a path as missing.
00233    *
00234    * All temporary allocations are done in @a pool.
00235    */
00236   svn_error_t *(*delete_path)(void *report_baton,
00237                               const char *path,
00238                               apr_pool_t *pool);
00239     
00240   /** Like set_path(), but differs in that @a path in the working copy
00241    * (relative to the root of the report driver) isn't a reflection of
00242    * @a path in the repository (relative to the URL specified when
00243    * opening the RA layer), but is instead a reflection of a different
00244    * repository @a url at @a revision.
00245    *
00246    * If @a start_empty is set and @a path is a directory,
00247    * the implementor should assume the directory has no entries or props.
00248    *
00249    * If @a lock_token is non-NULL, it is the lock token for @a path in the WC.
00250    * 
00251    * All temporary allocations are done in @a pool.
00252    */
00253   svn_error_t *(*link_path)(void *report_baton,
00254                             const char *path,
00255                             const char *url,
00256                             svn_revnum_t revision,
00257                             svn_boolean_t start_empty,
00258                             const char *lock_token,
00259                             apr_pool_t *pool);
00260 
00261   /** WC calls this when the state report is finished; any directories
00262    * or files not explicitly `set' are assumed to be at the
00263    * baseline revision originally passed into do_update().  No other
00264    * reporting functions, including abort_report, should be called after
00265    * calling this function.
00266    */
00267   svn_error_t *(*finish_report)(void *report_baton,
00268                                 apr_pool_t *pool);
00269 
00270   /** If an error occurs during a report, this routine should cause the
00271    * filesystem transaction to be aborted & cleaned up.  No other reporting
00272    * functions should be called after calling this function.
00273    */
00274   svn_error_t *(*abort_report)(void *report_baton,
00275                                apr_pool_t *pool);
00276 
00277 } svn_ra_reporter2_t;
00278 
00279 /**
00280  * Similar to @c svn_ra_reporter2_t, but without support for lock tokens.
00281  *
00282  * @deprecated Provided for backward compatibility with the 1.1 API.
00283  */
00284 typedef struct svn_ra_reporter_t
00285 {
00286   /** Similar to the corresponding field in @c svn_ra_reporter2_t, but
00287    * with @a lock_token always set to NULL. */
00288   svn_error_t *(*set_path)(void *report_baton,
00289                            const char *path,
00290                            svn_revnum_t revision,
00291                            svn_boolean_t start_empty,
00292                            apr_pool_t *pool);
00293 
00294   /** Same as the corresponding field in @c svn_ra_reporter2_t. */
00295   svn_error_t *(*delete_path)(void *report_baton,
00296                               const char *path,
00297                               apr_pool_t *pool);
00298     
00299   /** Similar to the corresponding field in @c svn_ra_reporter2_t, but
00300    * with @a lock_token always set to NULL. */
00301   svn_error_t *(*link_path)(void *report_baton,
00302                             const char *path,
00303                             const char *url,
00304                             svn_revnum_t revision,
00305                             svn_boolean_t start_empty,
00306                             apr_pool_t *pool);
00307 
00308   /** Same as the corresponding field in @c svn_ra_reporter2_t. */
00309   svn_error_t *(*finish_report)(void *report_baton,
00310                                 apr_pool_t *pool);
00311 
00312   /** Same as the corresponding field in @c svn_ra_reporter2_t. */
00313   svn_error_t *(*abort_report)(void *report_baton,
00314                                apr_pool_t *pool);
00315 } svn_ra_reporter_t;
00316 
00317 
00318 /** A collection of callbacks implemented by libsvn_client which allows
00319  * an RA layer to "pull" information from the client application, or
00320  * possibly store information.  libsvn_client passes this vtable to
00321  * @c RA->open().  
00322  *
00323  * Each routine takes a @a callback_baton originally provided with the
00324  * vtable.
00325  *
00326  * Clients must use svn_ra_create_callbacks() to allocate and
00327  * initialize this structure.
00328  *
00329  * @since New in 1.3.
00330  */
00331 typedef struct svn_ra_callbacks2_t
00332 {
00333   /** Open a unique temporary file for writing in the working copy.
00334    * This file will be automatically deleted when @a fp is closed.
00335    */
00336   svn_error_t *(*open_tmp_file)(apr_file_t **fp,
00337                                 void *callback_baton,
00338                                 apr_pool_t *pool);
00339 
00340   /** An authentication baton, created by the application, which is
00341    * capable of retrieving all known types of credentials.
00342    */
00343   svn_auth_baton_t *auth_baton;
00344 
00345   /*** The following items may be set to NULL to disallow the RA layer
00346        to perform the respective operations of the vtable functions.
00347        Perhaps WC props are not defined or are in invalid for this
00348        session, or perhaps the commit operation this RA session will
00349        perform is a server-side only one that shouldn't do post-commit
00350        processing on a working copy path.  ***/
00351 
00352   /** Fetch working copy properties.
00353    *
00354    *<pre> ### we might have a problem if the RA layer ever wants a property
00355    * ### that corresponds to a different revision of the file than
00356    * ### what is in the WC. we'll cross that bridge one day...</pre>
00357    */
00358   svn_ra_get_wc_prop_func_t get_wc_prop;
00359 
00360   /** Immediately set new values for working copy properties. */
00361   svn_ra_set_wc_prop_func_t set_wc_prop;
00362 
00363   /** Schedule new values for working copy properties. */
00364   svn_ra_push_wc_prop_func_t push_wc_prop;
00365 
00366   /** Invalidate working copy properties. */
00367   svn_ra_invalidate_wc_props_func_t invalidate_wc_props;
00368 
00369   /** Notification callback used for progress information.
00370    * May be NULL if not used.
00371    */
00372   svn_ra_progress_notify_func_t progress_func;
00373 
00374   /** Notification callback baton, used with progress_func. */
00375   void *progress_baton;
00376 } svn_ra_callbacks2_t;
00377 
00378 /** Similar to svn_ra_callbacks2_t, except that the progress
00379  * notification function and baton is missing.
00380  *
00381  * @deprecated Provided for backward compatibility with the 1.2 API.
00382  */
00383 typedef struct svn_ra_callbacks_t
00384 {
00385   svn_error_t *(*open_tmp_file)(apr_file_t **fp,
00386                                 void *callback_baton,
00387                                 apr_pool_t *pool);
00388   
00389   svn_auth_baton_t *auth_baton;
00390 
00391   svn_ra_get_wc_prop_func_t get_wc_prop;
00392 
00393   svn_ra_set_wc_prop_func_t set_wc_prop;
00394 
00395   svn_ra_push_wc_prop_func_t push_wc_prop;
00396 
00397   svn_ra_invalidate_wc_props_func_t invalidate_wc_props;
00398 
00399 } svn_ra_callbacks_t;
00400 
00401 
00402 
00403 /*----------------------------------------------------------------------*/
00404 
00405 /* Public Interfaces. */
00406 
00407 /**
00408  * Initialize the RA library.  This function must be called before using
00409  * any function in this header, except the deprecated APIs based on
00410  * @c svn_ra_plugin_t, or svn_ra_version().  This function must not be called
00411  * simultaneously in multiple threads.  @a pool must live
00412  * longer than any open RA sessions.
00413  *
00414  * @since New in 1.2.
00415  */
00416 svn_error_t *
00417 svn_ra_initialize(apr_pool_t *pool);
00418 
00419 /** Initialize a callback structure.
00420 * Set @a *callbacks to a ra callbacks object, allocated in @a pool.
00421 *
00422 * Clients must use this function to allocate and initialize @c
00423 * svn_ra_callbacks2_t structures.
00424 *
00425 * @since New in 1.3.
00426 */
00427 svn_error_t *
00428 svn_ra_create_callbacks(svn_ra_callbacks2_t **callbacks,
00429                         apr_pool_t *pool);
00430 
00431 /**
00432  * A repository access session.  This object is used to perform requests
00433  * to a repository, identified by an URL.
00434  *
00435  * @since New in 1.2.
00436  */
00437 typedef struct svn_ra_session_t svn_ra_session_t;
00438 
00439 /**
00440  * Open a repository session to @a repos_URL.  Return an opaque object
00441  * representing this session in @a *session_p, allocated in @a pool.
00442  *
00443  * @a callbacks/@a callback_baton is a table of callbacks provided by the
00444  * client; see @c svn_ra_callbacks2_t.
00445  *
00446  * @a config is a hash mapping <tt>const char *</tt> keys to 
00447  * @c svn_config_t * values.  For example, the @c svn_config_t for the 
00448  * "~/.subversion/config" file is under the key "config".
00449  *
00450  * All RA requests require a session; they will continue to
00451  * use @a pool for memory allocation.
00452  *
00453  * @see svn_client_open_ra_session().
00454  *
00455  * @since New in 1.3.
00456  */
00457 svn_error_t *svn_ra_open2(svn_ra_session_t **session_p,
00458                           const char *repos_URL,
00459                           const svn_ra_callbacks2_t *callbacks,
00460                           void *callback_baton,
00461                           apr_hash_t *config,
00462                           apr_pool_t *pool);
00463 
00464 /**
00465  * @see svn_ra_open2().
00466  * @since New in 1.2.
00467  * @deprecated Provided for backward compatibility with the 1.2 API.
00468  */
00469 svn_error_t *svn_ra_open(svn_ra_session_t **session_p,
00470                          const char *repos_URL,
00471                          const svn_ra_callbacks_t *callbacks,
00472                          void *callback_baton,
00473                          apr_hash_t *config,
00474                          apr_pool_t *pool);
00475 
00476 /** Change the root URL of an open @a ra_session to point to a new path in the
00477  * same repository.  @a url is the new root URL.  Use @a pool for
00478  * temporary allocations.
00479  *
00480  * If @a url has a different repository root than the current session
00481  * URL, return @c SVN_ERR_RA_ILLEGAL_URL.
00482  *
00483  * @since New in 1.4.
00484  */
00485 svn_error_t *svn_ra_reparent(svn_ra_session_t *ra_session,
00486                              const char *url,
00487                              apr_pool_t *pool);
00488 
00489 /**
00490  * Get the latest revision number from the repository of @a session.
00491  *
00492  * Use @a pool for memory allocation.
00493  *
00494  * @since New in 1.2.
00495  */
00496 svn_error_t *svn_ra_get_latest_revnum(svn_ra_session_t *session,
00497                                       svn_revnum_t *latest_revnum,
00498                                       apr_pool_t *pool);
00499 
00500 /**
00501  * Get the latest revision number at time @a tm in the repository of
00502  * @a session.
00503  *
00504  * Use @a pool for memory allocation.
00505  *
00506  * @since New in 1.2.
00507  */
00508 svn_error_t *svn_ra_get_dated_revision(svn_ra_session_t *session,
00509                                        svn_revnum_t *revision,
00510                                        apr_time_t tm,
00511                                        apr_pool_t *pool);
00512 
00513 /**
00514  * Set the property @a name to @a value on revision @a rev in the repository
00515  * of @a session.
00516  *
00517  * If @a value is @c NULL, delete the named revision property.
00518  *
00519  * Please note that properties attached to revisions are @em unversioned.
00520  *
00521  * Use @a pool for memory allocation.
00522  *
00523  * @since New in 1.2.
00524  */
00525 svn_error_t *svn_ra_change_rev_prop(svn_ra_session_t *session,
00526                                     svn_revnum_t rev,
00527                                     const char *name,
00528                                     const svn_string_t *value,
00529                                     apr_pool_t *pool);
00530 
00531 /**
00532  * Set @a *props to the list of unversioned properties attached to revision
00533  * @a rev in the repository of @a session.  The hash maps
00534  * (<tt>const char *</tt>) names to (<tt>@c svn_string_t *</tt>) values.
00535  *
00536  * Use @a pool for memory allocation.
00537  *
00538  * @since New in 1.2.
00539  */
00540 svn_error_t *svn_ra_rev_proplist(svn_ra_session_t *session,
00541                                  svn_revnum_t rev,
00542                                  apr_hash_t **props,
00543                                  apr_pool_t *pool);
00544 
00545 /**
00546  * Set @a *value to the value of unversioned property @a name attached to
00547  * revision @a rev in the repository of @a session.  If @a rev has no
00548  * property by that name, set @a *value to @c NULL.
00549  *
00550  * Use @a pool for memory allocation.
00551  *
00552  * @since New in 1.2.
00553  */
00554 svn_error_t *svn_ra_rev_prop(svn_ra_session_t *session,
00555                              svn_revnum_t rev,
00556                              const char *name,
00557                              svn_string_t **value,
00558                              apr_pool_t *pool);
00559 
00560 /**
00561  * Set @a *editor and @a *edit_baton to an editor for committing changes
00562  * to the repository of @a session, using @a log_msg as the log message.  The
00563  * revisions being committed against are passed to the editor
00564  * functions, starting with the rev argument to @c open_root.  The path
00565  * root of the commit is in the @a session's URL.
00566  *
00567  * Before @c close_edit returns, but after the commit has succeeded,
00568  * it will invoke @a callback with the new revision number, the
00569  * commit date (as a <tt>const char *</tt>), commit author (as a
00570  * <tt>const char *</tt>), and @a callback_baton as arguments.  If
00571  * @a callback returns an error, that error will be returned from @c
00572  * close_edit, otherwise @c close_edit will return successfully
00573  * (unless it encountered an error before invoking @a callback).
00574  *
00575  * The callback will not be called if the commit was a no-op
00576  * (i.e. nothing was committed);
00577  *
00578  * @a lock_tokens, if non-NULL, is a hash mapping <tt>const char
00579  * *</tt> paths (relative to the URL of @a session_baton) to <tt>
00580  * const char *</tt> lock tokens.  The server checks that the
00581  * correct token is provided for each committed, locked path.  @a lock_tokens
00582  * must live during the whole commit operation.
00583  *
00584  * If @a keep_locks is @c TRUE, then do not release locks on
00585  * committed objects.  Else, automatically release such locks.
00586  *
00587  * The caller may not perform any RA operations using @a session before
00588  * finishing the edit.
00589  * 
00590  * Use @a pool for memory allocation.
00591  *
00592  * @since New in 1.4.
00593  */
00594 svn_error_t *svn_ra_get_commit_editor2(svn_ra_session_t *session,
00595                                        const svn_delta_editor_t **editor,
00596                                        void **edit_baton,
00597                                        const char *log_msg,
00598                                        svn_commit_callback2_t callback,
00599                                        void *callback_baton,
00600                                        apr_hash_t *lock_tokens,
00601                                        svn_boolean_t keep_locks,
00602                                        apr_pool_t *pool);
00603 
00604 /**
00605  * Same as svn_ra_get_commit_editor2(), but uses @c svn_commit_callback_t.
00606  *
00607  * @since New in 1.2.
00608  *
00609  * @deprecated Provided for backward compatibility with the 1.3 API.
00610  */ 
00611 svn_error_t *svn_ra_get_commit_editor(svn_ra_session_t *session,
00612                                       const svn_delta_editor_t **editor,
00613                                       void **edit_baton,
00614                                       const char *log_msg,
00615                                       svn_commit_callback_t callback,
00616                                       void *callback_baton,
00617                                       apr_hash_t *lock_tokens,
00618                                       svn_boolean_t keep_locks,
00619                                       apr_pool_t *pool);
00620 
00621 /**
00622  * Fetch the contents and properties of file @a path at @a revision.
00623  * Interpret @a path relative to the URL in @a session.  Use
00624  * @a pool for all allocations.
00625  *
00626  * If @a revision is @c SVN_INVALID_REVNUM (meaning 'head') and
00627  * @a *fetched_rev is not @c NULL, then this function will set
00628  * @a *fetched_rev to the actual revision that was retrieved.  (Some
00629  * callers want to know, and some don't.) 
00630  *
00631  * If @a stream is non @c NULL, push the contents of the file at @a
00632  * stream, do not call svn_stream_close() when finished.
00633  *
00634  * If @a props is non @c NULL, set @a *props to contain the properties of 
00635  * the file.  This means @em all properties: not just ones controlled by
00636  * the user and stored in the repository fs, but non-tweakable ones
00637  * generated by the SCM system itself (e.g. 'wcprops', 'entryprops',
00638  * etc.)  The keys are <tt>const char *</tt>, values are 
00639  * <tt>@c svn_string_t *</tt>.
00640  *
00641  * The stream handlers for @a stream may not perform any RA
00642  * operations using @a session.
00643  *
00644  * @since New in 1.2.
00645  */
00646 svn_error_t *svn_ra_get_file(svn_ra_session_t *session,
00647                              const char *path,
00648                              svn_revnum_t revision,
00649                              svn_stream_t *stream,
00650                              svn_revnum_t *fetched_rev,
00651                              apr_hash_t **props,
00652                              apr_pool_t *pool);
00653 
00654 /**
00655  * If @a dirents is non @c NULL, set @a *dirents to contain all the entries
00656  * of directory @a path at @a revision.  The keys of @a dirents will be 
00657  * entry names (<tt>const char *</tt>), and the values dirents 
00658  * (<tt>@c svn_dirent_t *</tt>).  Use @a pool for all allocations.
00659  *
00660  * @a dirent_fields controls which portions of the <tt>@c svn_dirent_t</tt>
00661  * objects are filled in.  To have them completely filled in just pass
00662  * @c SVN_DIRENT_ALL, otherwise pass the bitwise OR of all the @c SVN_DIRENT_
00663  * fields you would like to have returned to you.
00664  *
00665  * @a path is interpreted relative to the URL in @a session.
00666  *
00667  * If @a revision is @c SVN_INVALID_REVNUM (meaning 'head') and
00668  * @a *fetched_rev is not @c NULL, then this function will set
00669  * @a *fetched_rev to the actual revision that was retrieved.  (Some
00670  * callers want to know, and some don't.) 
00671  *
00672  * If @a props is non @c NULL, set @a *props to contain the properties of 
00673  * the directory.  This means @em all properties: not just ones controlled by
00674  * the user and stored in the repository fs, but non-tweakable ones
00675  * generated by the SCM system itself (e.g. 'wcprops', 'entryprops',
00676  * etc.)  The keys are <tt>const char *</tt>, values are 
00677  * <tt>@c svn_string_t *</tt>.
00678  *
00679  * @since New in 1.4.
00680  */
00681 svn_error_t *svn_ra_get_dir2(svn_ra_session_t *session,
00682                              apr_hash_t **dirents,
00683                              svn_revnum_t *fetched_rev,
00684                              apr_hash_t **props,
00685                              const char *path,
00686                              svn_revnum_t revision,
00687                              apr_uint32_t dirent_fields,
00688                              apr_pool_t *pool);
00689 
00690 /**
00691  * Similar to @c svn_ra_get_dir2, but with @c SVN_DIRENT_ALL for the
00692  * @a dirent_fields parameter.
00693  *
00694  * @since New in 1.2.
00695  *
00696  * @deprecated Provided for compatibility with the 1.3 API.
00697  */
00698 svn_error_t *svn_ra_get_dir(svn_ra_session_t *session,
00699                             const char *path,
00700                             svn_revnum_t revision,
00701                             apr_hash_t **dirents,
00702                             svn_revnum_t *fetched_rev,
00703                             apr_hash_t **props,
00704                             apr_pool_t *pool);
00705 
00706 /**
00707  * Ask the RA layer to update a working copy.
00708  *
00709  * The client initially provides an @a update_editor/@a baton to the 
00710  * RA layer; this editor contains knowledge of where the change will
00711  * begin in the working copy (when @c open_root() is called).
00712  *
00713  * In return, the client receives a @a reporter/@a report_baton.  The
00714  * client then describes its working-copy revision numbers by making
00715  * calls into the @a reporter structure; the RA layer assumes that all
00716  * paths are relative to the URL used to open @a session.
00717  *
00718  * When finished, the client calls @a reporter->finish_report().  The
00719  * RA layer then does a complete drive of @a update_editor, ending with
00720  * close_edit(), to update the working copy.
00721  *
00722  * @a update_target is an optional single path component to restrict
00723  * the scope of the update to just that entry (in the directory
00724  * represented by the @a session's URL).  If @a update_target is the
00725  * empty string, the entire directory is updated.
00726  *
00727  * If @a recurse is true and the target is a directory, update
00728  * recursively; otherwise, update just the target and its immediate
00729  * entries, but not its child directories (if any).
00730  *
00731  * The working copy will be updated to @a revision_to_update_to, or the
00732  * "latest" revision if this arg is invalid.
00733  *
00734  * The caller may not perform any RA operations using @a session before
00735  * finishing the report, and may not perform any RA operations using
00736  * @a session from within the editing operations of @a update_editor.
00737  *
00738  * Use @a pool for memory allocation.
00739  *
00740  * @note The reporter provided by this function does NOT supply copy-
00741  * from information to the diff editor callbacks.
00742  *
00743  * @since New in 1.2.
00744  */
00745 svn_error_t *svn_ra_do_update(svn_ra_session_t *session,
00746                               const svn_ra_reporter2_t **reporter,
00747                               void **report_baton,
00748                               svn_revnum_t revision_to_update_to,
00749                               const char *update_target,
00750                               svn_boolean_t recurse,
00751                               const svn_delta_editor_t *update_editor,
00752                               void *update_baton,
00753                               apr_pool_t *pool);
00754 
00755 /**
00756  * Ask the RA layer to 'switch' a working copy to a new
00757  * @a switch_url;  it's another form of svn_ra_do_update().
00758  *
00759  * The client initially provides a @a switch_editor/@a baton to the RA
00760  * layer; this editor contains knowledge of where the change will
00761  * begin in the working copy (when open_root() is called). 
00762  *
00763  * In return, the client receives a @a reporter/@a report_baton.  The
00764  * client then describes its working-copy revision numbers by making
00765  * calls into the @a reporter structure; the RA layer assumes that all
00766  * paths are relative to the URL used to create @a session_baton.
00767  *
00768  * When finished, the client calls @a reporter->finish_report().  The
00769  * RA layer then does a complete drive of @a switch_editor, ending with
00770  * close_edit(), to switch the working copy.
00771  *
00772  * @a switch_target is an optional single path component will restrict
00773  * the scope of things affected by the switch to an entry in the
00774  * directory represented by the @a session's URL, or empty if the
00775  * entire directory is meant to be switched.
00776  *
00777  * If @a recurse is true and the target is a directory, switch
00778  * recursively; otherwise, switch just the target and its immediate
00779  * entries, but not its child directories (if any).
00780  *
00781  * The working copy will be switched to @a revision_to_switch_to, or the
00782  * "latest" revision if this arg is invalid.
00783  *
00784  * The caller may not perform any RA operations using
00785  * @a session before finishing the report, and may not perform
00786  * any RA operations using @a session_baton from within the editing
00787  * operations of @a switch_editor.
00788  *
00789  * Use @a pool for memory allocation.
00790  *
00791  * @note The reporter provided by this function does NOT supply copy-
00792  * from information to the diff editor callbacks.
00793  *
00794  * @since New in 1.2.
00795  */
00796 svn_error_t *svn_ra_do_switch(svn_ra_session_t *session,
00797                               const svn_ra_reporter2_t **reporter,
00798                               void **report_baton,
00799                               svn_revnum_t revision_to_switch_to,
00800                               const char *switch_target,
00801                               svn_boolean_t recurse,
00802                               const char *switch_url,
00803                               const svn_delta_editor_t *switch_editor,
00804                               void *switch_baton,
00805                               apr_pool_t *pool);
00806 
00807 /**
00808  * Ask the RA layer to describe the status of a working copy with respect
00809  * to @a revision of the repository (or HEAD, if @a revision is invalid).
00810  *
00811  * The client initially provides a @a status_editor/@a baton to the RA
00812  * layer; this editor contains knowledge of where the change will
00813  * begin in the working copy (when open_root() is called).
00814  *
00815  * In return, the client receives a @a reporter/@a report_baton. The
00816  * client then describes its working-copy revision numbers by making
00817  * calls into the @a reporter structure; the RA layer assumes that all
00818  * paths are relative to the URL used to open @a session.
00819  *
00820  * When finished, the client calls @a reporter->finish_report(). The RA
00821  * layer then does a complete drive of @a status_editor, ending with
00822  * close_edit(), to report, essentially, what would be modified in
00823  * the working copy were the client to call do_update().
00824  * @a status_target is an optional single path component will restrict
00825  * the scope of the status report to an entry in the directory
00826  * represented by the @a session_baton's URL, or empty if the entire
00827  * directory is meant to be examined.
00828  *
00829  * If @a recurse is true and the target is a directory, get status
00830  * recursively; otherwise, get status for just the target and its
00831  * immediate entries, but not its child directories (if any).
00832  *
00833  * The caller may not perform any RA operations using @a session
00834  * before finishing the report, and may not perform any RA operations
00835  * using @a session from within the editing operations of @a status_editor.
00836  *
00837  * Use @a pool for memory allocation.
00838  *
00839  * @note The reporter provided by this function does NOT supply copy-
00840  * from information to the diff editor callbacks.
00841  *
00842  * @since New in 1.2.
00843  */
00844 svn_error_t *svn_ra_do_status(svn_ra_session_t *session,
00845                               const svn_ra_reporter2_t **reporter,
00846                               void **report_baton,
00847                               const char *status_target,
00848                               svn_revnum_t revision,
00849                               svn_boolean_t recurse,
00850                               const svn_delta_editor_t *status_editor,
00851                               void *status_baton,
00852                               apr_pool_t *pool);
00853 
00854 /**
00855  * Ask the RA layer to 'diff' a working copy against @a versus_url;
00856  * it's another form of svn_ra_do_update().
00857  *
00858  * @note This function cannot be used to diff a single file, only a
00859  * working copy directory.  See the svn_ra_do_switch() function 
00860  * for more details.
00861  *
00862  * The client initially provides a @a diff_editor/@a baton to the RA
00863  * layer; this editor contains knowledge of where the common diff
00864  * root is in the working copy (when open_root() is called). 
00865  *
00866  * In return, the client receives a @a reporter/@a report_baton. The
00867  * client then describes its working-copy revision numbers by making
00868  * calls into the @a reporter structure; the RA layer assumes that all
00869  * paths are relative to the URL used to open @a session.
00870  *
00871  * When finished, the client calls @a reporter->finish_report().  The
00872  * RA layer then does a complete drive of @a diff_editor, ending with
00873  * close_edit(), to transmit the diff.
00874  *
00875  * @a diff_target is an optional single path component will restrict
00876  * the scope of the diff to an entry in the directory represented by
00877  * the @a session's URL, or empty if the entire directory is meant to be
00878  * one of the diff paths.
00879  *
00880  * The working copy will be diffed against @a versus_url as it exists
00881  * in revision @a revision, or as it is in head if @a revision is
00882  * @c SVN_INVALID_REVNUM.
00883  *
00884  * Use @a ignore_ancestry to control whether or not items being
00885  * diffed will be checked for relatedness first.  Unrelated items
00886  * are typically transmitted to the editor as a deletion of one thing
00887  * and the addition of another, but if this flag is @c TRUE,
00888  * unrelated items will be diffed as if they were related.
00889  *
00890  * If @a recurse is true and the target is a directory, diff
00891  * recursively; otherwise, diff just target and its immediate entries,
00892  * but not its child directories (if any).
00893  *
00894  * The caller may not perform any RA operations using @a session before
00895  * finishing the report, and may not perform any RA operations using
00896  * @a session from within the editing operations of @a diff_editor.
00897  *
00898  * @a text_deltas instructs the driver of the @a diff_editor to enable
00899  * the generation of text deltas. If @a text_deltas is FALSE the window
00900  * handler returned by apply_textdelta will be called once with a NULL
00901  * @c svn_txdelta_window_t pointer.
00902  *
00903  * Use @a pool for memory allocation.
00904  *
00905  * @note The reporter provided by this function does NOT supply copy-
00906  * from information to the diff editor callbacks.
00907  *
00908  * @since New in 1.4.
00909  */
00910 svn_error_t *svn_ra_do_diff2(svn_ra_session_t *session,
00911                              const svn_ra_reporter2_t **reporter,
00912                              void **report_baton,
00913                              svn_revnum_t revision,
00914                              const char *diff_target,
00915                              svn_boolean_t recurse,
00916                              svn_boolean_t ignore_ancestry,
00917                              svn_boolean_t text_deltas,
00918                              const char *versus_url,
00919                              const svn_delta_editor_t *diff_editor,
00920                              void *diff_baton,
00921                              apr_pool_t *pool);
00922 
00923 /**
00924  * Similar to svn_ra_do_diff2(), but with @a text_deltas set to @c TRUE.
00925  *
00926  * @deprecated Provided for backward compatibility with the 1.3 API.
00927  */
00928 svn_error_t *svn_ra_do_diff(svn_ra_session_t *session,
00929                             const svn_ra_reporter2_t **reporter,
00930                             void **report_baton,
00931                             svn_revnum_t revision,
00932                             const char *diff_target,
00933                             svn_boolean_t recurse,
00934                             svn_boolean_t ignore_ancestry,
00935                             const char *versus_url,
00936                             const svn_delta_editor_t *diff_editor,
00937                             void *diff_baton,
00938                             apr_pool_t *pool);
00939 
00940 /**
00941  * Invoke @a receiver with @a receiver_baton on each log message from
00942  * @a start to @a end.  @a start may be greater or less than @a end; 
00943  * this just controls whether the log messages are processed in descending 
00944  * or ascending revision number order.
00945  *
00946  * If @a start or @a end is @c SVN_INVALID_REVNUM, it defaults to youngest.
00947  *
00948  * If @a paths is non-null and has one or more elements, then only show
00949  * revisions in which at least one of @a paths was changed (i.e., if
00950  * file, text or props changed; if dir, props changed or an entry
00951  * was added or deleted).  Each path is an <tt>const char *</tt>, relative 
00952  * to the @a session's common parent.
00953  *
00954  * If @a limit is non-zero only invoke @a receiver on the first @a limit
00955  * logs.
00956  *
00957  * If @a discover_changed_paths, then each call to receiver passes a
00958  * <tt>const apr_hash_t *</tt> for the receiver's @a changed_paths argument;
00959  * the hash's keys are all the paths committed in that revision.
00960  * Otherwise, each call to receiver passes null for @a changed_paths.
00961  *
00962  * If @a strict_node_history is set, copy history will not be traversed
00963  * (if any exists) when harvesting the revision logs for each path.
00964  *
00965  * If any invocation of @a receiver returns error, return that error
00966  * immediately and without wrapping it.
00967  *
00968  * If @a start or @a end is a non-existent revision, return the error
00969  * @c SVN_ERR_FS_NO_SUCH_REVISION, without ever invoking @a receiver.
00970  *
00971  * See also the documentation for @c svn_log_message_receiver_t.
00972  *
00973  * The caller may not invoke any RA operations using @a session from
00974  * within @a receiver.
00975  *
00976  * Use @a pool for memory allocation.
00977  *
00978  * @since New in 1.2.
00979  */
00980 svn_error_t *svn_ra_get_log(svn_ra_session_t *session,
00981                             const apr_array_header_t *paths,
00982                             svn_revnum_t start,
00983                             svn_revnum_t end,
00984                             int limit,
00985                             svn_boolean_t discover_changed_paths,
00986                             svn_boolean_t strict_node_history,
00987                             svn_log_message_receiver_t receiver,
00988                             void *receiver_baton,
00989                             apr_pool_t *pool);
00990 
00991 /**
00992  * Set @a *kind to the node kind associated with @a path at @a revision.  
00993  * If @a path does not exist under @a revision, set @a *kind to 
00994  * @c svn_node_none.  @a path is relative to the @a session's parent URL.
00995  *
00996  * Use @a pool for memory allocation.
00997  *
00998  * @since New in 1.2.
00999  */
01000 svn_error_t *svn_ra_check_path(svn_ra_session_t *session,
01001                                const char *path,
01002                                svn_revnum_t revision,
01003                                svn_node_kind_t *kind,
01004                                apr_pool_t *pool);
01005 
01006 /**
01007  * Set @a *dirent to an @c svn_dirent_t associated with @a path at @a
01008  * revision.  @a path is relative to the @a session's parent's URL.
01009  * If @a path does not exist in @a revision, set @a *dirent to NULL.
01010  *
01011  * Use @a pool for memory allocation.
01012  *
01013  * @since New in 1.2.
01014  */
01015 svn_error_t *svn_ra_stat(svn_ra_session_t *session,
01016                          const char *path,
01017                          svn_revnum_t revision,
01018                          svn_dirent_t **dirent,
01019                          apr_pool_t *pool);
01020 
01021 
01022 /**
01023  * Set @a *uuid to the repository's UUID.
01024  *
01025  * @note The UUID has the same lifetime as the @a session.
01026  *
01027  * Use @a pool for temporary memory allocation.
01028  *
01029  * @since New in 1.2.
01030  */
01031 svn_error_t *svn_ra_get_uuid(svn_ra_session_t *session,
01032                              const char **uuid,
01033                              apr_pool_t *pool);
01034 
01035 /**
01036  * Set @a *url to the repository's root URL.  The value will not include
01037  * a trailing '/'.  The returned URL is guaranteed to be a prefix of the
01038  * @a session's URL.
01039  *
01040  * @note The URL has the same lifetime as the @a session.
01041  *
01042  * Use @a pool for temporary memory allocation.
01043  *
01044  * @since New in 1.2.
01045  */
01046 svn_error_t *svn_ra_get_repos_root(svn_ra_session_t *session,
01047                                    const char **url,
01048                                    apr_pool_t *pool);
01049 
01050 /**
01051  * Set @a *locations to the locations (at the repository revisions
01052  * @a location_revisions) of the file identified by @a path in
01053  * @a peg_revision.  @a path is relative to the URL to which
01054  * @a session was opened.  @a location_revisions is an array of
01055  * @c svn_revnum_t's.  @a *locations will be a mapping from the revisions to
01056  * their appropriate absolute paths.  If the file doesn't exist in a
01057  * location_revision, that revision will be ignored.
01058  *
01059  * Use @a pool for all allocations.
01060  *
01061  * @note This functionality is not available in pre-1.1 servers.  If the
01062  * server doesn't implement it, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is
01063  * returned.
01064  *
01065  * @since New in 1.2.
01066  */
01067 svn_error_t *svn_ra_get_locations(svn_ra_session_t *session,
01068                                   apr_hash_t **locations,
01069                                   const char *path,
01070                                   svn_revnum_t peg_revision,
01071                                   apr_array_header_t *location_revisions,
01072                                   apr_pool_t *pool);
01073 
01074 /**
01075  * Retrieve a subset of the interesting revisions of a file @a path
01076  * as seen in revision @a end (see svn_fs_history_prev() for a
01077  * definition of "interesting revisions").  Invoke @a handler with
01078  * @a handler_baton as its first argument for each such revision.
01079  * @a session is an open RA session.  Use @a pool for all allocations.
01080  *
01081  * If there is an interesting revision of the file that is less than or
01082  * equal to @a start, the iteration will begin at that revision.
01083  * Else, the iteration will begin at the first revision of the file in
01084  * the repository, which has to be less than or equal to @a end.  Note
01085  * that if the function succeeds, @a handler will have been called at
01086  * least once.
01087  *
01088  * In a series of calls to @a handler, the file contents for the first
01089  * interesting revision will be provided as a text delta against the
01090  * empty file.  In the following calls, the delta will be against the
01091  * fulltext contents for the previous call.
01092  *
01093  * @note This functionality is not available in pre-1.1 servers.  If the
01094  * server doesn't implement it, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is
01095  * returned.
01096  *
01097  * @since New in 1.2.
01098  */
01099 svn_error_t *svn_ra_get_file_revs(svn_ra_session_t *session,
01100                                   const char *path,
01101                                   svn_revnum_t start,
01102                                   svn_revnum_t end,
01103                                   svn_ra_file_rev_handler_t handler,
01104                                   void *handler_baton,
01105                                   apr_pool_t *pool);
01106 
01107 /**
01108  * Lock each path in @a path_revs, which is a hash whose keys are the
01109  * paths to be locked, and whose values are the corresponding bas
01110  * revisions for each path.
01111  *
01112  * Note that locking is never anonymous, so any server implementing
01113  * this function will have to "pull" a username from the client, if
01114  * it hasn't done so already.
01115  *
01116  * @a comment is optional: it's either an xml-escapable string
01117  * which describes the lock, or it is NULL.
01118  *
01119  * If any path is already locked by a different user, then call @a
01120  * lock_func/@a lock_baton with an error.  If @a steal_lock is true,
01121  * then "steal" the existing lock(s) anyway, even if the RA username
01122  * does not match the current lock's owner.  Delete any lock on the
01123  * path, and unconditionally create a new lock.
01124  *
01125  * For each path, if its base revision (in @a path_revs) is a valid
01126  * revnum, then do an out-of-dateness check.  If the revnum is less
01127  * than the last-changed-revision of any path (or if a path doesn't
01128  * exist in HEAD), call @a lock_func/@a lock_baton with an
01129  * SVN_ERR_RA_OUT_OF_DATE error.
01130  *
01131  * After successfully locking a file, @a lock_func is called with the
01132  * @a lock_baton.
01133  *
01134  * Use @a pool for temporary allocations.
01135  *
01136  * @since New in 1.2.
01137  */
01138 svn_error_t *svn_ra_lock(svn_ra_session_t *session,
01139                          apr_hash_t *path_revs,
01140                          const char *comment,
01141                          svn_boolean_t steal_lock,
01142                          svn_ra_lock_callback_t lock_func, 
01143                          void *lock_baton,
01144                          apr_pool_t *pool);
01145 
01146 /**
01147  * Remove the repository lock for each path in @a path_tokens.
01148  * @a path_tokens is a hash whose keys are the paths to be locked, and
01149  * whose values are the corresponding lock tokens for each path.  If
01150  * the path has no corresponding lock token, or if @a break_lock is TRUE,
01151  * then the corresponding value shall be "".
01152  * 
01153  * Note that unlocking is never anonymous, so any server
01154  * implementing this function will have to "pull" a username from
01155  * the client, if it hasn't done so already.
01156  *
01157  * If @a token points to a lock, but the RA username doesn't match the
01158  * lock's owner, call @a lockfunc/@a lock_baton with an error.  If @a
01159  * break_lock is true, however, instead allow the lock to be "broken"
01160  * by the RA user.
01161  *
01162  * After successfully unlocking a path, @a lock_func is called with
01163  * the @a lock_baton.
01164  *
01165  * Use @a pool for temporary allocations.
01166  *
01167  * @since New in 1.2.
01168  */
01169 svn_error_t *svn_ra_unlock(svn_ra_session_t *session,
01170                            apr_hash_t *path_tokens,
01171                            svn_boolean_t break_lock,
01172                            svn_ra_lock_callback_t lock_func, 
01173                            void *lock_baton,
01174                            apr_pool_t *pool);
01175 
01176 /**  
01177  * If @a path is locked, set @a *lock to an svn_lock_t which
01178  * represents the lock, allocated in @a pool.  If @a path is not
01179  * locked, set @a *lock to NULL.
01180  *
01181  * @since New in 1.2.
01182  */
01183 svn_error_t *svn_ra_get_lock(svn_ra_session_t *session,
01184                              svn_lock_t **lock,
01185                              const char *path,
01186                              apr_pool_t *pool);
01187 
01188 /**
01189  * Set @a *locks to a hashtable which represents all locks on or
01190  * below @a path.
01191  *
01192  * The hashtable maps (const char *) absolute fs paths to (const
01193  * svn_lock_t *) structures.  The hashtable -- and all keys and
01194  * values -- are allocated in @a pool.
01195  *
01196  * @note It is not considered an error for @a path to not exist in HEAD.
01197  * Such a search will simply return no locks.
01198  *
01199  * @note This functionality is not available in pre-1.2 servers.  If the
01200  * server doesn't implement it, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is
01201  * returned.
01202  *
01203  * @since New in 1.2.
01204  */
01205 svn_error_t *svn_ra_get_locks(svn_ra_session_t *session,
01206                               apr_hash_t **locks,
01207                               const char *path,
01208                               apr_pool_t *pool);
01209 
01210 
01211 /**
01212  * Replay the changes from @a revision through @a editor and @a edit_baton.
01213  *
01214  * Changes will be limited to those that occur under @a session's URL, and
01215  * the server will assume that the client has no knowledge of revisions
01216  * prior to @a low_water_mark.  These two limiting factors define the portion
01217  * of the tree that the server will assume the client already has knowledge of,
01218  * and thus any copies of data from outside that part of the tree will be
01219  * sent in their entirety, not as simple copies or deltas against a previous
01220  * version.
01221  *
01222  * If @a send_deltas is @c TRUE, the actual text and property changes in
01223  * the revision will be sent, otherwise dummy text deltas and null property
01224  * changes will be sent instead.
01225  *
01226  * @a pool is used for all allocation.
01227  *
01228  * @since New in 1.4.
01229  */
01230 svn_error_t *svn_ra_replay(svn_ra_session_t *session,
01231                            svn_revnum_t revision,
01232                            svn_revnum_t low_water_mark,
01233                            svn_boolean_t send_deltas,
01234                            const svn_delta_editor_t *editor,
01235                            void *edit_baton,
01236                            apr_pool_t *pool);
01237 
01238 /**
01239  * Append a textual list of all available RA modules to the stringbuf
01240  * @a output.
01241  *
01242  * @since New in 1.2.
01243  */
01244 svn_error_t *svn_ra_print_modules(svn_stringbuf_t *output,
01245                                   apr_pool_t *pool);
01246 
01247 
01248 /**
01249  * Similar to svn_ra_print_modules().
01250  * @a ra_baton is ignored.
01251  *
01252  * @deprecated Provided for backward compatibility with the 1.1 API.
01253  */
01254 svn_error_t *svn_ra_print_ra_libraries(svn_stringbuf_t **descriptions,
01255                                        void *ra_baton,
01256                                        apr_pool_t *pool);
01257 
01258 
01259 
01260 /**
01261  * Using this callback struct is similar to calling the newer public
01262  * interface that is based on @c svn_ra_session_t.
01263  *
01264  * @deprecated Provided for backward compatibility with the 1.1 API.
01265  */
01266 typedef struct svn_ra_plugin_t
01267 {
01268   /** The proper name of the RA library, (like "ra_dav" or "ra_local") */
01269   const char *name;         
01270   
01271   /** Short doc string printed out by `svn --version` */
01272   const char *description;
01273 
01274   /* The vtable hooks */
01275 
01276   /** Call svn_ra_open() and set @a session_baton to an object representing
01277    * the new session.  All other arguments are passed to svn_ra_open().
01278    */
01279   svn_error_t *(*open)(void **session_baton,
01280                        const char *repos_URL,
01281                        const svn_ra_callbacks_t *callbacks,
01282                        void *callback_baton,
01283                        apr_hash_t *config,
01284                        apr_pool_t *pool);
01285 
01286   /** Call svn_ra_get_latest_revnum() with the session associated with
01287    * @a session_baton and all other arguments.
01288    */
01289   svn_error_t *(*get_latest_revnum)(void *session_baton,
01290                                     svn_revnum_t *latest_revnum,
01291                                     apr_pool_t *pool);
01292 
01293   /** Call svn_ra_get_dated_revision() with the session associated with
01294    * @a session_baton and all other arguments.
01295    */
01296   svn_error_t *(*get_dated_revision)(void *session_baton,
01297                                      svn_revnum_t *revision,
01298                                      apr_time_t tm,
01299                                      apr_pool_t *pool);
01300 
01301   /** Call svn_ra_change_rev_prop() with the session associated with
01302    * @a session_baton and all other arguments.
01303    */
01304   svn_error_t *(*change_rev_prop)(void *session_baton,
01305                                   svn_revnum_t rev,
01306                                   const char *name,
01307                                   const svn_string_t *value,
01308                                   apr_pool_t *pool);
01309 
01310   /** Call svn_ra_rev_proplist() with the session associated with
01311    * @a session_baton and all other arguments.
01312    */
01313   svn_error_t *(*rev_proplist)(void *session_baton,
01314                                svn_revnum_t rev,
01315                                apr_hash_t **props,
01316                                apr_pool_t *pool);
01317 
01318   /** Call svn_ra_rev_prop() with the session associated with
01319    * @a session_baton and all other arguments.
01320    */
01321   svn_error_t *(*rev_prop)(void *session_baton,
01322                            svn_revnum_t rev,
01323                            const char *name,
01324                            svn_string_t **value,
01325                            apr_pool_t *pool);
01326   
01327   /** Call svn_ra_get_commit_editor() with the session associated with
01328    * @a session_baton and all other arguments plus @a lock_tokens set to
01329    * @c NULL and @a keep_locks set to @c TRUE.
01330    */
01331   svn_error_t *(*get_commit_editor)(void *session_baton,
01332                                     const svn_delta_editor_t **editor,
01333                                     void **edit_baton,
01334                                     const char *log_msg,
01335                                     svn_commit_callback_t callback,
01336                                     void *callback_baton,
01337                                     apr_pool_t *pool);
01338 
01339   /** Call svn_ra_get_file() with the session associated with
01340    * @a session_baton and all other arguments.
01341    */
01342   svn_error_t *(*get_file)(void *session_baton,
01343                            const char *path,
01344                            svn_revnum_t revision,
01345                            svn_stream_t *stream,
01346                            svn_revnum_t *fetched_rev,
01347                            apr_hash_t **props,
01348                            apr_pool_t *pool);
01349 
01350   /** Call svn_ra_get_dir() with the session associated with
01351    * @a session_baton and all other arguments.
01352    */
01353   svn_error_t *(*get_dir)(void *session_baton,
01354                           const char *path,
01355                           svn_revnum_t revision,
01356                           apr_hash_t **dirents,
01357                           svn_revnum_t *fetched_rev,
01358                           apr_hash_t **props,
01359                           apr_pool_t *pool);
01360 
01361   /** Call svn_ra_do_update() with the session associated with
01362    * @a session_baton and all other arguments.
01363    */
01364   svn_error_t *(*do_update)(void *session_baton,
01365                             const svn_ra_reporter_t **reporter,
01366                             void **report_baton,
01367                             svn_revnum_t revision_to_update_to,
01368                             const char *update_target,
01369                             svn_boolean_t recurse,
01370                             const svn_delta_editor_t *update_editor,
01371                             void *update_baton,
01372                             apr_pool_t *pool);
01373 
01374   /** Call svn_ra_do_switch() with the session associated with
01375    * @a session_baton and all other arguments.
01376    */
01377   svn_error_t *(*do_switch)(void *session_baton,
01378                             const svn_ra_reporter_t **reporter,
01379                             void **report_baton,
01380                             svn_revnum_t revision_to_switch_to,
01381                             const char *switch_target,
01382                             svn_boolean_t recurse,
01383                             const char *switch_url,
01384                             const svn_delta_editor_t *switch_editor,
01385                             void *switch_baton,
01386                             apr_pool_t *pool);
01387 
01388   /** Call svn_ra_do_status() with the session associated with
01389    * @a session_baton and all other arguments.
01390    */
01391   svn_error_t *(*do_status)(void *session_baton,
01392                             const svn_ra_reporter_t **reporter,
01393                             void **report_baton,
01394                             const char *status_target,
01395                             svn_revnum_t revision,
01396                             svn_boolean_t recurse,
01397                             const svn_delta_editor_t *status_editor,
01398                             void *status_baton,
01399                             apr_pool_t *pool);
01400 
01401   /** Call svn_ra_do_diff() with the session associated with
01402    * @a session_baton and all other arguments.
01403    */
01404   svn_error_t *(*do_diff)(void *session_baton,
01405                           const svn_ra_reporter_t **reporter,
01406                           void **report_baton,
01407                           svn_revnum_t revision,
01408                           const char *diff_target,
01409                           svn_boolean_t recurse,
01410                           svn_boolean_t ignore_ancestry,
01411                           const char *versus_url,
01412                           const svn_delta_editor_t *diff_editor,
01413                           void *diff_baton,
01414                           apr_pool_t *pool);
01415 
01416   /** Call svn_ra_get_log() with the session associated with
01417    * @a session_baton and all other arguments.  @a limit is set to 0.
01418    */
01419   svn_error_t *(*get_log)(void *session_baton,
01420                           const apr_array_header_t *paths,
01421                           svn_revnum_t start,
01422                           svn_revnum_t end,
01423                           svn_boolean_t discover_changed_paths,
01424                           svn_boolean_t strict_node_history,
01425                           svn_log_message_receiver_t receiver,
01426                           void *receiver_baton,
01427                           apr_pool_t *pool);
01428 
01429   /** Call svn_ra_check_path() with the session associated with
01430    * @a session_baton and all other arguments.
01431    */
01432   svn_error_t *(*check_path)(void *session_baton,
01433                              const char *path,
01434                              svn_revnum_t revision,
01435                              svn_node_kind_t *kind,
01436                              apr_pool_t *pool);
01437 
01438   /** Call svn_ra_get_uuid() with the session associated with
01439    * @a session_baton and all other arguments.
01440    */
01441   svn_error_t *(*get_uuid)(void *session_baton,
01442                            const char **uuid,
01443                            apr_pool_t *pool);
01444 
01445   /** Call svn_ra_get_repos_root() with the session associated with
01446    * @a session_baton and all other arguments.
01447    */
01448   svn_error_t *(*get_repos_root)(void *session_baton,
01449                                  const char **url,
01450                                  apr_pool_t *pool);
01451 
01452   /**
01453    * Call svn_ra_get_locations() with the session associated with
01454    * @a session_baton and all other arguments.
01455    *
01456    * @since New in 1.1.
01457    */
01458   svn_error_t *(*get_locations)(void *session_baton,
01459                                 apr_hash_t **locations,
01460                                 const char *path,
01461                                 svn_revnum_t peg_revision,
01462                                 apr_array_header_t *location_revisions,
01463                                 apr_pool_t *pool);
01464 
01465   /**
01466    * Call svn_ra_get_file_revs() with the session associated with
01467    * @a session_baton and all other arguments.
01468    *
01469    * @since New in 1.1.
01470    */
01471   svn_error_t *(*get_file_revs)(void *session_baton,
01472                                 const char *path,
01473                                 svn_revnum_t start,
01474                                 svn_revnum_t end,
01475                                 svn_ra_file_rev_handler_t handler,
01476                                 void *handler_baton,
01477                                 apr_pool_t *pool);
01478 
01479   /**
01480    * Return the plugin's version information.
01481    *
01482    * @since New in 1.1.
01483    */
01484   const svn_version_t *(*get_version)(void);
01485 
01486   
01487 } svn_ra_plugin_t;
01488 
01489 /**
01490  * All "ra_FOO" implementations *must* export a function named
01491  * svn_ra_FOO_init() of type @c svn_ra_init_func_t.
01492  *
01493  * When called by libsvn_client, this routine adds an entry (or
01494  * entries) to the hash table for any URL schemes it handles.  The hash
01495  * value must be of type (<tt>@c svn_ra_plugin_t *</tt>).  @a pool is a 
01496  * pool for allocating configuration / one-time data.
01497  *
01498  * This type is defined to use the "C Calling Conventions" to ensure that
01499  * abi_version is the first parameter. The RA plugin must check that value
01500  * before accessing the other parameters.
01501  *
01502  * ### need to force this to be __cdecl on Windows... how??
01503  *
01504  * @deprecated Provided for backward compatibility with the 1.1 API.
01505  */
01506 typedef svn_error_t *(*svn_ra_init_func_t)(int abi_version,
01507                                            apr_pool_t *pool,
01508                                            apr_hash_t *hash);
01509 
01510 /**
01511  * The current ABI (Application Binary Interface) version for the
01512  * RA plugin model. This version number will change when the ABI
01513  * between the SVN core (e.g. libsvn_client) and the RA plugin changes.
01514  *
01515  * An RA plugin should verify that the passed version number is acceptable
01516  * before accessing the rest of the parameters, and before returning any
01517  * information.
01518  *
01519  * It is entirely acceptable for an RA plugin to accept multiple ABI
01520  * versions. It can simply interpret the parameters based on the version,
01521  * and it can return different plugin structures.
01522  *
01523  *
01524  * <pre>
01525  * VSN  DATE        REASON FOR CHANGE
01526  * ---  ----------  ------------------------------------------------
01527  *   1  2001-02-17  Initial revision.
01528  *   2  2004-06-29  Preparing for svn 1.1, which adds new RA vtable funcs.
01529  *      2005-01-19  Rework the plugin interface and don't provide the vtable
01530  *                  to the client.  Separate ABI versions are no longer used.
01531  * </pre>
01532  * 
01533  * @deprecated Provided for backward compatibility with the 1.0 API.
01534  */
01535 #define SVN_RA_ABI_VERSION      2
01536 
01537 /* Public RA implementations. */
01538 
01539 /** Initialize libsvn_ra_dav.
01540  *
01541  * @deprecated Provided for backward compatibility with the 1.1 API. */
01542 svn_error_t * svn_ra_dav_init(int abi_version,
01543                               apr_pool_t *pool,
01544                               apr_hash_t *hash);
01545 
01546 /** Initialize libsvn_ra_local.
01547  *
01548  * @deprecated Provided for backward compatibility with the 1.1 API. */
01549 svn_error_t * svn_ra_local_init(int abi_version,
01550                                 apr_pool_t *pool,
01551                                 apr_hash_t *hash);
01552 
01553 /** Initialize libsvn_ra_svn.
01554  *
01555  * @deprecated Provided for backward compatibility with the 1.1 API. */
01556 svn_error_t * svn_ra_svn_init(int abi_version,
01557                               apr_pool_t *pool,
01558                               apr_hash_t *hash);
01559 
01560 /** Initialize libsvn_ra_serf.
01561  *
01562  * @since New in 1.4.
01563  * @deprecated Provided for backward compatibility with the 1.1 API. */
01564 svn_error_t * svn_ra_serf_init(int abi_version,
01565                                apr_pool_t *pool,
01566                                apr_hash_t *hash);
01567 
01568 
01569 /**
01570  * Initialize the compatibility wrapper, using @a pool for any allocations.
01571  * The caller must hold on to @a ra_baton as long as the RA library is used.
01572  *
01573  * @deprecated Provided for backward compatibility with the 1.1 API.
01574  */
01575 svn_error_t *svn_ra_init_ra_libs(void **ra_baton, apr_pool_t *pool);
01576 
01577 /**
01578  * Return an RA vtable-@a library which can handle URL.  A number of
01579  * svn_client_* routines will call this internally, but client apps might
01580  * use it too.  $a ra_baton is a baton obtained by a call to
01581  * svn_ra_init_ra_libs().
01582  *
01583  * @deprecated Provided for backward compatibility with the 1.1 API.
01584  */
01585 svn_error_t *svn_ra_get_ra_library(svn_ra_plugin_t **library,
01586                                    void *ra_baton,
01587                                    const char *url,
01588                                    apr_pool_t *pool);
01589 
01590 #ifdef __cplusplus
01591 }
01592 #endif /* __cplusplus */
01593 
01594 #endif  /* SVN_RA_H */
01595                            

Generated on Wed Feb 13 18:44:38 2008 for Subversion by  doxygen 1.5.4