svn_ra.h

Go to the documentation of this file.
00001 /**
00002  * @copyright
00003  * ====================================================================
00004  *    Licensed to the Apache Software Foundation (ASF) under one
00005  *    or more contributor license agreements.  See the NOTICE file
00006  *    distributed with this work for additional information
00007  *    regarding copyright ownership.  The ASF licenses this file
00008  *    to you under the Apache License, Version 2.0 (the
00009  *    "License"); you may not use this file except in compliance
00010  *    with the License.  You may obtain a copy of the License at
00011  *
00012  *      http://www.apache.org/licenses/LICENSE-2.0
00013  *
00014  *    Unless required by applicable law or agreed to in writing,
00015  *    software distributed under the License is distributed on an
00016  *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00017  *    KIND, either express or implied.  See the License for the
00018  *    specific language governing permissions and limitations
00019  *    under the License.
00020  * ====================================================================
00021  * @endcopyright
00022  *
00023  * @file svn_ra.h
00024  * @brief Repository Access
00025  */
00026 
00027 #ifndef SVN_RA_H
00028 #define SVN_RA_H
00029 
00030 #include <apr.h>
00031 #include <apr_pools.h>
00032 #include <apr_hash.h>
00033 #include <apr_tables.h>
00034 #include <apr_time.h>
00035 #include <apr_file_io.h>  /* for apr_file_t */
00036 
00037 #include "svn_types.h"
00038 #include "svn_string.h"
00039 #include "svn_delta.h"
00040 #include "svn_auth.h"
00041 #include "svn_mergeinfo.h"
00042 
00043 #ifdef __cplusplus
00044 extern "C" {
00045 #endif /* __cplusplus */
00046 
00047 
00048 
00049 /* Misc. declarations */
00050 
00051 /**
00052  * Get libsvn_ra version information.
00053  *
00054  * @since New in 1.1.
00055  */
00056 const svn_version_t *
00057 svn_ra_version(void);
00058 
00059 
00060 /** This is a function type which allows the RA layer to fetch working
00061  * copy (WC) properties.
00062  *
00063  * The @a baton is provided along with the function pointer and should
00064  * be passed back in. This will be the @a callback_baton or the
00065  * @a close_baton as appropriate.
00066  *
00067  * @a path is relative to the "root" of the session, defined by the
00068  * @a repos_URL passed to svn_ra_open4() vtable call.
00069  *
00070  * @a name is the name of the property to fetch. If the property is present,
00071  * then it is returned in @a value. Otherwise, @a *value is set to @c NULL.
00072  */
00073 typedef svn_error_t *(*svn_ra_get_wc_prop_func_t)(void *baton,
00074                                                   const char *path,
00075                                                   const char *name,
00076                                                   const svn_string_t **value,
00077                                                   apr_pool_t *pool);
00078 
00079 /** This is a function type which allows the RA layer to store new
00080  * working copy properties during update-like operations.  See the
00081  * comments for @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and
00082  * @a name. The @a value is the value that will be stored for the property;
00083  * a NULL @a value means the property will be deleted.
00084  */
00085 typedef svn_error_t *(*svn_ra_set_wc_prop_func_t)(void *baton,
00086                                                   const char *path,
00087                                                   const char *name,
00088                                                   const svn_string_t *value,
00089                                                   apr_pool_t *pool);
00090 
00091 /** This is a function type which allows the RA layer to store new
00092  * working copy properties as part of a commit.  See the comments for
00093  * @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and @a name.
00094  * The @a value is the value that will be stored for the property; a
00095  * @c NULL @a value means the property will be deleted.
00096  *
00097  * Note that this might not actually store the new property before
00098  * returning, but instead schedule it to be changed as part of
00099  * post-commit processing (in which case a successful commit means the
00100  * properties got written).  Thus, during the commit, it is possible
00101  * to invoke this function to set a new value for a wc prop, then read
00102  * the wc prop back from the working copy and get the *old* value.
00103  * Callers beware.
00104  */
00105 typedef svn_error_t *(*svn_ra_push_wc_prop_func_t)(void *baton,
00106                                                    const char *path,
00107                                                    const char *name,
00108                                                    const svn_string_t *value,
00109                                                    apr_pool_t *pool);
00110 
00111 /** This is a function type which allows the RA layer to invalidate
00112  * (i.e., remove) wcprops recursively.  See the documentation for
00113  * @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and @a name.
00114  *
00115  * Unlike @c svn_ra_push_wc_prop_func_t, this has immediate effect.  If
00116  * it returns success, the wcprops have been removed.
00117  */
00118 typedef svn_error_t *(*svn_ra_invalidate_wc_props_func_t)(void *baton,
00119                                                           const char *path,
00120                                                           const char *name,
00121                                                           apr_pool_t *pool);
00122 
00123 /** This is a function type which allows the RA layer to fetch the
00124  * cached pristine file contents whose checksum is @a checksum, if
00125  * any.  @a *contents will be a read stream containing those contents
00126  * if they are found; NULL otherwise.
00127  *
00128  * @since New in 1.8.
00129  */
00130 typedef svn_error_t *
00131 (*svn_ra_get_wc_contents_func_t)(void *baton,
00132                                  svn_stream_t **contents,
00133                                  const svn_checksum_t *checksum,
00134                                  apr_pool_t *pool);
00135 
00136 
00137 /** A function type for retrieving the youngest revision from a repos.
00138  * @deprecated Provided for backward compatibility with the 1.8 API.
00139  */
00140 /* ### It seems this type was never used by the API, since 1.0.0. */
00141 typedef svn_error_t *(*svn_ra_get_latest_revnum_func_t)(
00142   void *session_baton,
00143   svn_revnum_t *latest_revnum);
00144 
00145 /** A function type which allows the RA layer to ask about any
00146  * customizations to the client name string.  This is primarily used
00147  * by HTTP-based RA layers wishing to extend the string reported to
00148  * Apache/mod_dav_svn via the User-agent HTTP header.
00149  *
00150  * @since New in 1.5.
00151  */
00152 typedef svn_error_t *(*svn_ra_get_client_string_func_t)(void *baton,
00153                                                         const char **name,
00154                                                         apr_pool_t *pool);
00155 
00156 
00157 
00158 /**
00159  * A callback function type for use in @c get_file_revs.
00160  * @a baton is provided by the caller, @a path is the pathname of the file
00161  * in revision @a rev and @a rev_props are the revision properties.
00162  * If @a delta_handler and @a delta_baton are non-NULL, they may be set to a
00163  * handler/baton which will be called with the delta between the previous
00164  * revision and this one after the return of this callback.  They may be
00165  * left as NULL/NULL.
00166  * @a prop_diffs is an array of svn_prop_t elements indicating the property
00167  * delta for this and the previous revision.
00168  * @a pool may be used for temporary allocations, but you can't rely
00169  * on objects allocated to live outside of this particular call and the
00170  * immediately following calls to @a *delta_handler, if any.
00171  *
00172  * @since New in 1.1.
00173  */
00174 typedef svn_error_t *(*svn_ra_file_rev_handler_t)(
00175   void *baton,
00176   const char *path,
00177   svn_revnum_t rev,
00178   apr_hash_t *rev_props,
00179   svn_txdelta_window_handler_t *delta_handler,
00180   void **delta_baton,
00181   apr_array_header_t *prop_diffs,
00182   apr_pool_t *pool);
00183 
00184 /**
00185  * Callback function type for locking and unlocking actions.
00186  *
00187  * @since New in 1.2.
00188  *
00189  * @a do_lock is TRUE when locking @a path, and FALSE
00190  * otherwise.
00191  *
00192  * @a lock is a lock for @a path or NULL if @a do_lock is FALSE or @a ra_err is
00193  * non-NULL.
00194  *
00195  * @a ra_err is NULL unless the ra layer encounters a locking related
00196  * error which it passes back for notification purposes.  The caller
00197  * is responsible for clearing @a ra_err after the callback is run.
00198  *
00199  * @a baton is a closure object; it should be provided by the
00200  * implementation, and passed by the caller.  @a pool may be used for
00201  * temporary allocation.
00202  */
00203 typedef svn_error_t *(*svn_ra_lock_callback_t)(void *baton,
00204                                                const char *path,
00205                                                svn_boolean_t do_lock,
00206                                                const svn_lock_t *lock,
00207                                                svn_error_t *ra_err,
00208                                                apr_pool_t *pool);
00209 
00210 /**
00211  * Callback function type for progress notification.
00212  *
00213  * @a progress is the number of bytes already transferred, @a total is
00214  * the total number of bytes to transfer or -1 if it's not known, @a
00215  * baton is the callback baton.
00216  *
00217  * @since New in 1.3.
00218  */
00219 typedef void (*svn_ra_progress_notify_func_t)(apr_off_t progress,
00220                                               apr_off_t total,
00221                                               void *baton,
00222                                               apr_pool_t *pool);
00223 
00224 /**
00225  * Callback function type for replay_range actions.
00226  *
00227  * This callback function should provide replay_range with an editor which
00228  * will be driven with the received replay reports from the master repository.
00229  *
00230  * @a revision is the target revision number of the received replay report.
00231  *
00232  * @a editor and @a edit_baton should provided by the callback implementation.
00233  *
00234  * @a replay_baton is the baton as originally passed to replay_range.
00235  *
00236  * @a revprops contains key/value pairs for each revision properties for this
00237  * revision.
00238  *
00239  * @since New in 1.5.
00240  */
00241 typedef svn_error_t *(*svn_ra_replay_revstart_callback_t)(
00242   svn_revnum_t revision,
00243   void *replay_baton,
00244   const svn_delta_editor_t **editor,
00245   void **edit_baton,
00246   apr_hash_t *rev_props,
00247   apr_pool_t *pool);
00248 
00249 /**
00250  * Callback function type for replay_range actions.
00251  *
00252  * This callback function should close the editor.
00253  *
00254  * @a revision is the target revision number of the received replay report.
00255  *
00256  * @a editor and @a edit_baton should provided by the callback implementation.
00257  *
00258  * @a replay_baton is the baton as originally passed to replay_range.
00259  *
00260  * @a revprops contains key/value pairs for each revision properties for this
00261  * revision.
00262  *
00263  * @since New in 1.5.
00264  */
00265 typedef svn_error_t *(*svn_ra_replay_revfinish_callback_t)(
00266   svn_revnum_t revision,
00267   void *replay_baton,
00268   const svn_delta_editor_t *editor,
00269   void *edit_baton,
00270   apr_hash_t *rev_props,
00271   apr_pool_t *pool);
00272 
00273 
00274 /**
00275  * Callback function that checks if an ra_svn tunnel called
00276  * @a tunnel_name is handled by the callbakcs or the default
00277  * implementation.
00278  *
00279  * @a tunnel_baton is the baton as originally passed to ra_open.
00280  *
00281  * @since New in 1.9.
00282  */
00283 typedef svn_boolean_t (*svn_ra_check_tunnel_func_t)(
00284     void *tunnel_baton, const char *tunnel_name);
00285 
00286 /**
00287  * Callback function for closing a tunnel in ra_svn.
00288  *
00289  * This function will be called when the pool that owns the tunnel
00290  * connection is cleared or destroyed.
00291  *
00292  * @a tunnel_context is the baton as returned from the 
00293  * svn_ra_open_tunnel_func_t.
00294  *
00295  * @a tunnel_baton was returned by the open-tunnel callback.
00296  *
00297  * @since New in 1.9.
00298  */
00299 typedef void (*svn_ra_close_tunnel_func_t)(
00300     void *close_baton, void *tunnel_baton);
00301 
00302 /**
00303  * Callback function for opening a tunnel in ra_svn.
00304  *
00305  * Given the @a tunnel_name, tunnel @a user and server @a hostname and
00306  * @a port, open a tunnel to the server and return its file handles,
00307  * which are owned by @a pool, in @a request and @a response.
00308  *
00309  * @a request and @a response represent the standard input and output,
00310  * respectively, of the process on the other end of the tunnel.
00311  *
00312  * If @a *close_func is set it will be called with @a close_baton when
00313  * the tunnel is closed.
00314  *
00315  * The optional @a cancel_func callback can be invoked as usual to allow
00316  * the user to preempt potentially lengthy operations.
00317  *
00318  * @a tunnel_baton is the baton as set in the callbacks.
00319  *
00320  * @since New in 1.9.
00321  */
00322 typedef svn_error_t *(*svn_ra_open_tunnel_func_t)(
00323     svn_stream_t **request, svn_stream_t **response,
00324     svn_ra_close_tunnel_func_t *close_func, void **close_baton,
00325     void *tunnel_baton,
00326     const char *tunnel_name, const char *user,
00327     const char *hostname, int port,
00328     svn_cancel_func_t cancel_func, void *cancel_baton,
00329     apr_pool_t *pool);
00330 
00331 
00332 /**
00333  * The update Reporter.
00334  *
00335  * A vtable structure which allows a working copy to describe a subset
00336  * (or possibly all) of its working-copy to an RA layer, for the
00337  * purposes of an update, switch, status, or diff operation.
00338  *
00339  * Paths for report calls are relative to the target (not the anchor)
00340  * of the operation.  Report calls must be made in depth-first order:
00341  * parents before children, all children of a parent before any
00342  * siblings of the parent.  The first report call must be a set_path
00343  * with a @a path argument of "" and a valid revision.  (If the target
00344  * of the operation is locally deleted or missing, use the anchor's
00345  * revision.)  If the target of the operation is deleted or switched
00346  * relative to the anchor, follow up the initial set_path call with a
00347  * link_path or delete_path call with a @a path argument of "" to
00348  * indicate that.  In no other case may there be two report
00349  * descriptions for the same path.  If the target of the operation is
00350  * a locally added file or directory (which previously did not exist),
00351  * it may be reported as having revision 0 or as having the parent
00352  * directory's revision.
00353  *
00354  * @since New in 1.5.
00355  */
00356 typedef struct svn_ra_reporter3_t
00357 {
00358   /** Describe a working copy @a path as being at a particular
00359    * @a revision and having depth @a depth.
00360    *
00361    * @a revision may be SVN_INVALID_REVNUM if (for example) @a path
00362    * represents a locally-added path with no revision number, or @a
00363    * depth is @c svn_depth_exclude.
00364    *
00365    * @a path may not be underneath a path on which set_path() was
00366    * previously called with @c svn_depth_exclude in this report.
00367    *
00368    * If @a start_empty is set and @a path is a directory, the
00369    * implementor should assume the directory has no entries or props.
00370    *
00371    * This will *override* any previous set_path() calls made on parent
00372    * paths.  @a path is relative to the URL specified in svn_ra_open4().
00373    *
00374    * If @a lock_token is non-NULL, it is the lock token for @a path in the WC.
00375    *
00376    * All temporary allocations are done in @a pool.
00377    */
00378   svn_error_t *(*set_path)(void *report_baton,
00379                            const char *path,
00380                            svn_revnum_t revision,
00381                            svn_depth_t depth,
00382                            svn_boolean_t start_empty,
00383                            const char *lock_token,
00384                            apr_pool_t *pool);
00385 
00386   /** Describing a working copy @a path as missing.
00387    *
00388    * @a path may not be underneath a path on which set_path() was
00389    * previously called with @c svn_depth_exclude in this report.
00390    *
00391    * All temporary allocations are done in @a pool.
00392    */
00393   svn_error_t *(*delete_path)(void *report_baton,
00394                               const char *path,
00395                               apr_pool_t *pool);
00396 
00397   /** Like set_path(), but differs in that @a path in the working copy
00398    * (relative to the root of the report driver) isn't a reflection of
00399    * @a path in the repository (relative to the URL specified when
00400    * opening the RA layer), but is instead a reflection of a different
00401    * repository @a url at @a revision, and has depth @a depth.
00402    *
00403    * @a path may not be underneath a path on which set_path() was
00404    * previously called with @c svn_depth_exclude in this report.
00405    *
00406    * If @a start_empty is set and @a path is a directory,
00407    * the implementor should assume the directory has no entries or props.
00408    *
00409    * If @a lock_token is non-NULL, it is the lock token for @a path in the WC.
00410    *
00411    * All temporary allocations are done in @a pool.
00412    */
00413   svn_error_t *(*link_path)(void *report_baton,
00414                             const char *path,
00415                             const char *url,
00416                             svn_revnum_t revision,
00417                             svn_depth_t depth,
00418                             svn_boolean_t start_empty,
00419                             const char *lock_token,
00420                             apr_pool_t *pool);
00421 
00422   /** WC calls this when the state report is finished; any directories
00423    * or files not explicitly `set' are assumed to be at the
00424    * baseline revision originally passed into do_update().  No other
00425    * reporting functions, including abort_report, should be called after
00426    * calling this function.
00427    */
00428   svn_error_t *(*finish_report)(void *report_baton,
00429                                 apr_pool_t *pool);
00430 
00431   /** If an error occurs during a report, this routine should cause the
00432    * filesystem transaction to be aborted & cleaned up.  No other reporting
00433    * functions should be called after calling this function.
00434    */
00435   svn_error_t *(*abort_report)(void *report_baton,
00436                                apr_pool_t *pool);
00437 
00438 } svn_ra_reporter3_t;
00439 
00440 /**
00441  * Similar to @c svn_ra_reporter3_t, but without support for depths.
00442  *
00443  * @deprecated Provided for backward compatibility with the 1.4 API.
00444  */
00445 typedef struct svn_ra_reporter2_t
00446 {
00447   /** Similar to the corresponding field in @c svn_ra_reporter3_t, but
00448    * with @a depth always set to @c svn_depth_infinity. */
00449   svn_error_t *(*set_path)(void *report_baton,
00450                            const char *path,
00451                            svn_revnum_t revision,
00452                            svn_boolean_t start_empty,
00453                            const char *lock_token,
00454                            apr_pool_t *pool);
00455 
00456   /** Same as the corresponding field in @c svn_ra_reporter3_t. */
00457   svn_error_t *(*delete_path)(void *report_baton,
00458                               const char *path,
00459                               apr_pool_t *pool);
00460 
00461   /** Similar to the corresponding field in @c svn_ra_reporter3_t, but
00462    * with @a depth always set to @c svn_depth_infinity. */
00463   svn_error_t *(*link_path)(void *report_baton,
00464                             const char *path,
00465                             const char *url,
00466                             svn_revnum_t revision,
00467                             svn_boolean_t start_empty,
00468                             const char *lock_token,
00469                             apr_pool_t *pool);
00470 
00471   /** Same as the corresponding field in @c svn_ra_reporter3_t. */
00472   svn_error_t *(*finish_report)(void *report_baton,
00473                                 apr_pool_t *pool);
00474 
00475   /** Same as the corresponding field in @c svn_ra_reporter3_t. */
00476   svn_error_t *(*abort_report)(void *report_baton,
00477                                apr_pool_t *pool);
00478 
00479 } svn_ra_reporter2_t;
00480 
00481 /**
00482  * Similar to @c svn_ra_reporter2_t, but without support for lock tokens.
00483  *
00484  * @deprecated Provided for backward compatibility with the 1.1 API.
00485  */
00486 typedef struct svn_ra_reporter_t
00487 {
00488   /** Similar to the corresponding field in @c svn_ra_reporter2_t, but
00489    * with @a lock_token always set to NULL. */
00490   svn_error_t *(*set_path)(void *report_baton,
00491                            const char *path,
00492                            svn_revnum_t revision,
00493                            svn_boolean_t start_empty,
00494                            apr_pool_t *pool);
00495 
00496   /** Same as the corresponding field in @c svn_ra_reporter2_t. */
00497   svn_error_t *(*delete_path)(void *report_baton,
00498                               const char *path,
00499                               apr_pool_t *pool);
00500 
00501   /** Similar to the corresponding field in @c svn_ra_reporter2_t, but
00502    * with @a lock_token always set to NULL. */
00503   svn_error_t *(*link_path)(void *report_baton,
00504                             const char *path,
00505                             const char *url,
00506                             svn_revnum_t revision,
00507                             svn_boolean_t start_empty,
00508                             apr_pool_t *pool);
00509 
00510   /** Same as the corresponding field in @c svn_ra_reporter2_t. */
00511   svn_error_t *(*finish_report)(void *report_baton,
00512                                 apr_pool_t *pool);
00513 
00514   /** Same as the corresponding field in @c svn_ra_reporter2_t. */
00515   svn_error_t *(*abort_report)(void *report_baton,
00516                                apr_pool_t *pool);
00517 } svn_ra_reporter_t;
00518 
00519 
00520 /** A collection of callbacks implemented by libsvn_client which allows
00521  * an RA layer to "pull" information from the client application, or
00522  * possibly store information.  libsvn_client passes this vtable to
00523  * svn_ra_open4().
00524  *
00525  * Each routine takes a @a callback_baton originally provided with the
00526  * vtable.
00527  *
00528  * Clients must use svn_ra_create_callbacks() to allocate and
00529  * initialize this structure.
00530  *
00531  * @since New in 1.3.
00532  */
00533 typedef struct svn_ra_callbacks2_t
00534 {
00535   /** Open a unique temporary file for writing in the working copy.
00536    * This file will be automatically deleted when @a fp is closed.
00537    *
00538    * @deprecated This callback should no longer be used by RA layers.
00539    */
00540   svn_error_t *(*open_tmp_file)(apr_file_t **fp,
00541                                 void *callback_baton,
00542                                 apr_pool_t *pool);
00543 
00544   /** An authentication baton, created by the application, which is
00545    * capable of retrieving all known types of credentials.
00546    */
00547   svn_auth_baton_t *auth_baton;
00548 
00549   /*** The following items may be set to NULL to disallow the RA layer
00550        to perform the respective operations of the vtable functions.
00551        Perhaps WC props are not defined or are in invalid for this
00552        session, or perhaps the commit operation this RA session will
00553        perform is a server-side only one that shouldn't do post-commit
00554        processing on a working copy path.  ***/
00555 
00556   /** Fetch working copy properties.
00557    *
00558    *<pre> ### we might have a problem if the RA layer ever wants a property
00559    * ### that corresponds to a different revision of the file than
00560    * ### what is in the WC. we'll cross that bridge one day...</pre>
00561    */
00562   svn_ra_get_wc_prop_func_t get_wc_prop;
00563 
00564   /** Immediately set new values for working copy properties. */
00565   svn_ra_set_wc_prop_func_t set_wc_prop;
00566 
00567   /** Schedule new values for working copy properties. */
00568   svn_ra_push_wc_prop_func_t push_wc_prop;
00569 
00570   /** Invalidate working copy properties. */
00571   svn_ra_invalidate_wc_props_func_t invalidate_wc_props;
00572 
00573   /** Notification callback used for progress information.
00574    * May be NULL if not used.
00575    */
00576   svn_ra_progress_notify_func_t progress_func;
00577 
00578   /** Notification callback baton, used with progress_func. */
00579   void *progress_baton;
00580 
00581   /** Cancellation function
00582    *
00583    * As its baton, the general callback baton is used
00584    *
00585    * @since New in 1.5
00586    */
00587   svn_cancel_func_t cancel_func;
00588 
00589   /** Client string customization callback function
00590    * @since New in 1.5
00591    */
00592   svn_ra_get_client_string_func_t get_client_string;
00593 
00594   /** Working copy file content fetching function.
00595    * @since New in 1.8.
00596    */
00597   svn_ra_get_wc_contents_func_t get_wc_contents;
00598 
00599   /** Check-tunnel callback
00600    *
00601    * If not @c NULL, and open_tunnel_func is also not @c NULL, this
00602    * callback will be invoked to check if open_tunnel_func should be
00603    * used to create a specific tunnel, or if the default tunnel
00604    * implementation (either built-in or configured in the client
00605    * configuration file) should be used instead.
00606    * @since New in 1.9.
00607    */
00608   svn_ra_check_tunnel_func_t check_tunnel_func;
00609 
00610   /** Open-tunnel callback
00611    *
00612    * If not @c NULL, this callback will be invoked to create a tunnel
00613    * for a ra_svn connection that needs one, overriding any tunnel
00614    * definitions in the client config file. This callback is used only
00615    * for ra_svn and ignored by the other RA modules.
00616    * @since New in 1.9.
00617    */
00618   svn_ra_open_tunnel_func_t open_tunnel_func;
00619 
00620   /** A baton used with open_tunnel_func and close_tunnel_func.
00621    * @since New in 1.9.
00622    */
00623   void *tunnel_baton;
00624 } svn_ra_callbacks2_t;
00625 
00626 /** Similar to svn_ra_callbacks2_t, except that the progress
00627  * notification function and baton is missing.
00628  *
00629  * @deprecated Provided for backward compatibility with the 1.2 API.
00630  */
00631 typedef struct svn_ra_callbacks_t
00632 {
00633   svn_error_t *(*open_tmp_file)(apr_file_t **fp,
00634                                 void *callback_baton,
00635                                 apr_pool_t *pool);
00636 
00637   svn_auth_baton_t *auth_baton;
00638 
00639   svn_ra_get_wc_prop_func_t get_wc_prop;
00640 
00641   svn_ra_set_wc_prop_func_t set_wc_prop;
00642 
00643   svn_ra_push_wc_prop_func_t push_wc_prop;
00644 
00645   svn_ra_invalidate_wc_props_func_t invalidate_wc_props;
00646 
00647 } svn_ra_callbacks_t;
00648 
00649 
00650 
00651 /*----------------------------------------------------------------------*/
00652 
00653 /* Public Interfaces. */
00654 
00655 /**
00656  * Initialize the RA library.  This function must be called before using
00657  * any function in this header, except the deprecated APIs based on
00658  * @c svn_ra_plugin_t, or svn_ra_version().  This function must not be called
00659  * simultaneously in multiple threads.  @a pool must live
00660  * longer than any open RA sessions.
00661  *
00662  * @since New in 1.2.
00663  */
00664 svn_error_t *
00665 svn_ra_initialize(apr_pool_t *pool);
00666 
00667 /** Initialize a callback structure.
00668 * Set @a *callbacks to a ra callbacks object, allocated in @a pool.
00669 *
00670 * Clients must use this function to allocate and initialize @c
00671 * svn_ra_callbacks2_t structures.
00672 *
00673 * @since New in 1.3.
00674 */
00675 svn_error_t *
00676 svn_ra_create_callbacks(svn_ra_callbacks2_t **callbacks,
00677                         apr_pool_t *pool);
00678 
00679 /**
00680  * A repository access session.  This object is used to perform requests
00681  * to a repository, identified by a URL.
00682  *
00683  * @since New in 1.2.
00684  */
00685 typedef struct svn_ra_session_t svn_ra_session_t;
00686 
00687 /**
00688  * Open a repository access session to the repository at @a repos_URL,
00689  * or inform the caller regarding a correct URL by which to access
00690  * that repository.
00691  *
00692  * If @a repos_URL can be used successfully to access the repository,
00693  * set @a *session_p to an opaque object representing a repository
00694  * session for the repository and (if @a corrected_url is non-NULL)
00695  * set @a *corrected_url to NULL.  If there's a better URL that the
00696  * caller should try and @a corrected_url is non-NULL, set
00697  * @a *session_p to NULL and @a *corrected_url to the corrected URL.  If
00698  * there's a better URL that the caller should try, and @a
00699  * corrected_url is NULL, return an #SVN_ERR_RA_SESSION_URL_MISMATCH
00700  * error.  Allocate all returned items in @a pool.
00701  *
00702  * The @a repos_URL need not point to the root of the repository: subject
00703  * to authorization, it may point to any path within the repository, even
00704  * a path at which no node exists in the repository.  The session will
00705  * remember this URL as its "session URL" (also called "session root URL"),
00706  * until changed by svn_ra_reparent().  Many RA functions take or return
00707  * paths that are relative to the session URL.
00708  *
00709  * If a @a corrected_url is returned, it will point to the same path
00710  * within the new repository root URL that @a repos_URL pointed to within
00711  * the old repository root URL.
00712  *
00713  * Return @c SVN_ERR_RA_UUID_MISMATCH if @a uuid is non-NULL and not equal
00714  * to the UUID of the repository at @c repos_URL.
00715  *
00716  * @a callbacks/@a callback_baton is a table of callbacks provided by the
00717  * client; see @c svn_ra_callbacks2_t.
00718  *
00719  * @a config is a hash mapping <tt>const char *</tt> keys to
00720  * @c svn_config_t * values.  For example, the @c svn_config_t for the
00721  * "~/.subversion/config" file is under the key "config".  @a config may
00722  * be NULL.  This function examines some config settings under the
00723  * "servers" key (if present) before loading the required RA module, and
00724  * the RA module may also examine any config settings.
00725  *
00726  * All RA requests require a session; they will continue to
00727  * use @a pool for memory allocation.
00728  *
00729  * @see svn_client_open_ra_session().
00730  *
00731  * @since New in 1.7.
00732  */
00733 svn_error_t *
00734 svn_ra_open4(svn_ra_session_t **session_p,
00735              const char **corrected_url,
00736              const char *repos_URL,
00737              const char *uuid,
00738              const svn_ra_callbacks2_t *callbacks,
00739              void *callback_baton,
00740              apr_hash_t *config,
00741              apr_pool_t *pool);
00742 
00743 /** Similar to svn_ra_open4(), but with @a corrected_url always passed
00744  * as @c NULL.
00745  *
00746  * @since New in 1.5.
00747  * @deprecated Provided for backward compatibility with the 1.6 API.
00748  */
00749 SVN_DEPRECATED
00750 svn_error_t *
00751 svn_ra_open3(svn_ra_session_t **session_p,
00752              const char *repos_URL,
00753              const char *uuid,
00754              const svn_ra_callbacks2_t *callbacks,
00755              void *callback_baton,
00756              apr_hash_t *config,
00757              apr_pool_t *pool);
00758 
00759 /**
00760  * Similar to svn_ra_open3(), but with @a uuid set to @c NULL.
00761  *
00762  * @since New in 1.3.
00763  * @deprecated Provided for backward compatibility with the 1.4 API.
00764  */
00765 SVN_DEPRECATED
00766 svn_error_t *
00767 svn_ra_open2(svn_ra_session_t **session_p,
00768              const char *repos_URL,
00769              const svn_ra_callbacks2_t *callbacks,
00770              void *callback_baton,
00771              apr_hash_t *config,
00772              apr_pool_t *pool);
00773 
00774 /**
00775  * @see svn_ra_open2().
00776  * @since New in 1.2.
00777  * @deprecated Provided for backward compatibility with the 1.2 API.
00778  */
00779 SVN_DEPRECATED
00780 svn_error_t *
00781 svn_ra_open(svn_ra_session_t **session_p,
00782             const char *repos_URL,
00783             const svn_ra_callbacks_t *callbacks,
00784             void *callback_baton,
00785             apr_hash_t *config,
00786             apr_pool_t *pool);
00787 
00788 /**
00789  * Open a new ra session @a *new_session to the same repository as an existing
00790  * ra session @a old_session, copying the callbacks, auth baton, etc. from the
00791  * old session. This essentially limits the lifetime of the new, duplicated
00792  * session to the lifetime of the old session. If the new session should
00793  * outlive the new session, creating a new session using svn_ra_open4() is
00794  * recommended.
00795  *
00796  * If @a session_url is not NULL, parent the new session at session_url. Note
00797  * that @a session_url MUST BE in the same repository as @a old_session or an
00798  * error will be returned. When @a session_url NULL the same session root
00799  * will be used.
00800  *
00801  * Allocate @a new_session in @a result_pool. Perform temporary allocations
00802  * in @a scratch_pool.
00803  *
00804  * @since New in 1.9.
00805  */
00806 svn_error_t *
00807 svn_ra_dup_session(svn_ra_session_t **new_session,
00808                    svn_ra_session_t *old_session,
00809                    const char *session_url,
00810                    apr_pool_t *result_pool,
00811                    apr_pool_t *scratch_pool);
00812 
00813 
00814 /** Change the root URL of an open @a ra_session to point to a new path in the
00815  * same repository.  @a url is the new root URL.  Use @a pool for
00816  * temporary allocations.
00817  *
00818  * If @a url has a different repository root than the current session
00819  * URL, return @c SVN_ERR_RA_ILLEGAL_URL.
00820  *
00821  * @since New in 1.4.
00822  */
00823 svn_error_t *
00824 svn_ra_reparent(svn_ra_session_t *ra_session,
00825                 const char *url,
00826                 apr_pool_t *pool);
00827 
00828 /** Set @a *url to the session URL -- the URL to which @a ra_session was
00829  * opened or most recently reparented.
00830  *
00831  * @since New in 1.5.
00832  */
00833 svn_error_t *
00834 svn_ra_get_session_url(svn_ra_session_t *ra_session,
00835                        const char **url,
00836                        apr_pool_t *pool);
00837 
00838 
00839 /** Convert @a url into a path relative to the session URL of @a ra_session,
00840  * setting @a *rel_path to that value.  If @a url is not
00841  * a child of the session URL, return @c SVN_ERR_RA_ILLEGAL_URL.
00842  *
00843  * The returned path is uri decoded to allow using it with the ra or other
00844  * apis as a valid relpath.
00845  *
00846  * @since New in 1.7.
00847  */
00848 svn_error_t *
00849 svn_ra_get_path_relative_to_session(svn_ra_session_t *ra_session,
00850                                     const char **rel_path,
00851                                     const char *url,
00852                                     apr_pool_t *pool);
00853 
00854 /** Convert @a url into a path relative to the repository root URL of
00855  * the repository with which @a ra_session is associated, setting @a
00856  * *rel_path to that value.  If @a url is not a child of repository
00857  * root URL, return @c SVN_ERR_RA_ILLEGAL_URL.
00858  *
00859  * The returned path is uri decoded to allow using it with the ra or other
00860  * apis as a valid relpath.
00861  *
00862  * @since New in 1.7.
00863  */
00864 svn_error_t *
00865 svn_ra_get_path_relative_to_root(svn_ra_session_t *ra_session,
00866                                  const char **rel_path,
00867                                  const char *url,
00868                                  apr_pool_t *pool);
00869 
00870 /**
00871  * Get the latest revision number from the repository of @a session.
00872  *
00873  * Use @a pool for memory allocation.
00874  *
00875  * @since New in 1.2.
00876  */
00877 svn_error_t *
00878 svn_ra_get_latest_revnum(svn_ra_session_t *session,
00879                          svn_revnum_t *latest_revnum,
00880                          apr_pool_t *pool);
00881 
00882 /**
00883  * Get the latest revision number at time @a tm in the repository of
00884  * @a session.
00885  *
00886  * Use @a pool for memory allocation.
00887  *
00888  * @since New in 1.2.
00889  */
00890 svn_error_t *
00891 svn_ra_get_dated_revision(svn_ra_session_t *session,
00892                           svn_revnum_t *revision,
00893                           apr_time_t tm,
00894                           apr_pool_t *pool);
00895 
00896 /**
00897  * Set the property @a name to @a value on revision @a rev in the repository
00898  * of @a session.
00899  *
00900  * If @a value is @c NULL, delete the named revision property.
00901  *
00902  * If the server advertises the #SVN_RA_CAPABILITY_ATOMIC_REVPROPS capability
00903  * and @a old_value_p is not @c NULL, then changing the property will fail with
00904  * an error chain that contains #SVN_ERR_FS_PROP_BASEVALUE_MISMATCH if the
00905  * present value of the property is not @a *old_value_p.  (This is an atomic
00906  * test-and-set).
00907  * @a *old_value_p may be @c NULL, representing that the property must be not
00908  * already set.
00909  *
00910  * If the capability is not advertised, then @a old_value_p MUST be @c NULL.
00911  *
00912  * Please note that properties attached to revisions are @em unversioned.
00913  *
00914  * Use @a pool for memory allocation.
00915  *
00916  * @see svn_fs_change_rev_prop2(), svn_error_find_cause().
00917  *
00918  * @since New in 1.7.
00919  */
00920 svn_error_t *
00921 svn_ra_change_rev_prop2(svn_ra_session_t *session,
00922                         svn_revnum_t rev,
00923                         const char *name,
00924                         const svn_string_t *const *old_value_p,
00925                         const svn_string_t *value,
00926                         apr_pool_t *pool);
00927 
00928 /**
00929  * Similar to svn_ra_change_rev_prop2(), but with @a old_value_p set
00930  * to @c NULL.
00931  *
00932  * @since New in 1.2.
00933  * @deprecated Provided for backward compatibility with the 1.6 API.
00934  */
00935 SVN_DEPRECATED
00936 svn_error_t *
00937 svn_ra_change_rev_prop(svn_ra_session_t *session,
00938                        svn_revnum_t rev,
00939                        const char *name,
00940                        const svn_string_t *value,
00941                        apr_pool_t *pool);
00942 
00943 /**
00944  * Set @a *props to the list of unversioned properties attached to revision
00945  * @a rev in the repository of @a session.  The hash maps
00946  * (<tt>const char *</tt>) names to (<tt>@c svn_string_t *</tt>) values.
00947  *
00948  * Use @a pool for memory allocation.
00949  *
00950  * @since New in 1.2.
00951  */
00952 svn_error_t *
00953 svn_ra_rev_proplist(svn_ra_session_t *session,
00954                     svn_revnum_t rev,
00955                     apr_hash_t **props,
00956                     apr_pool_t *pool);
00957 
00958 /**
00959  * Set @a *value to the value of unversioned property @a name attached to
00960  * revision @a rev in the repository of @a session.  If @a rev has no
00961  * property by that name, set @a *value to @c NULL.
00962  *
00963  * Use @a pool for memory allocation.
00964  *
00965  * @since New in 1.2.
00966  */
00967 svn_error_t *
00968 svn_ra_rev_prop(svn_ra_session_t *session,
00969                 svn_revnum_t rev,
00970                 const char *name,
00971                 svn_string_t **value,
00972                 apr_pool_t *pool);
00973 
00974 /**
00975  * Set @a *editor and @a *edit_baton to an editor for committing
00976  * changes to the repository of @a session, setting the revision
00977  * properties from @a revprop_table.  The revisions being committed
00978  * against are passed to the editor functions, starting with the rev
00979  * argument to @c open_root.  The path root of the commit is the @a
00980  * session's URL.
00981  *
00982  * @a revprop_table is a hash mapping <tt>const char *</tt> property
00983  * names to @c svn_string_t property values.  The commit log message
00984  * is expected to be in the @c SVN_PROP_REVISION_LOG element.  @a
00985  * revprop_table can not contain either of @c SVN_PROP_REVISION_DATE
00986  * or @c SVN_PROP_REVISION_AUTHOR.
00987  *
00988  * Before @c close_edit returns, but after the commit has succeeded,
00989  * it will invoke @a commit_callback (if non-NULL) with filled-in
00990  * #svn_commit_info_t *, @a commit_baton, and @a pool or some subpool
00991  * thereof as arguments.  If @a commit_callback returns an error, that error
00992  * will be returned from @c * close_edit, otherwise @c close_edit will return
00993  * successfully (unless it encountered an error before invoking
00994  * @a commit_callback).
00995  *
00996  * The callback will not be called if the commit was a no-op
00997  * (i.e. nothing was committed);
00998  *
00999  * @a lock_tokens, if non-NULL, is a hash mapping <tt>const char
01000  * *</tt> paths (relative to the URL of @a session) to <tt>
01001  * const char *</tt> lock tokens.  The server checks that the
01002  * correct token is provided for each committed, locked path.  @a lock_tokens
01003  * must live during the whole commit operation.
01004  *
01005  * If @a keep_locks is @c TRUE, then do not release locks on
01006  * committed objects.  Else, automatically release such locks.
01007  *
01008  * The caller may not perform any RA operations using @a session before
01009  * finishing the edit.
01010  *
01011  * Use @a pool for memory allocation.
01012  *
01013  * @since New in 1.5.
01014  */
01015 svn_error_t *
01016 svn_ra_get_commit_editor3(svn_ra_session_t *session,
01017                           const svn_delta_editor_t **editor,
01018                           void **edit_baton,
01019                           apr_hash_t *revprop_table,
01020                           svn_commit_callback2_t commit_callback,
01021                           void *commit_baton,
01022                           apr_hash_t *lock_tokens,
01023                           svn_boolean_t keep_locks,
01024                           apr_pool_t *pool);
01025 
01026 /**
01027  * Same as svn_ra_get_commit_editor3(), but with @c revprop_table set
01028  * to a hash containing the @c SVN_PROP_REVISION_LOG property set
01029  * to the value of @a log_msg.
01030  *
01031  * @since New in 1.4.
01032  *
01033  * @deprecated Provided for backward compatibility with the 1.4 API.
01034  */
01035 SVN_DEPRECATED
01036 svn_error_t *
01037 svn_ra_get_commit_editor2(svn_ra_session_t *session,
01038                           const svn_delta_editor_t **editor,
01039                           void **edit_baton,
01040                           const char *log_msg,
01041                           svn_commit_callback2_t commit_callback,
01042                           void *commit_baton,
01043                           apr_hash_t *lock_tokens,
01044                           svn_boolean_t keep_locks,
01045                           apr_pool_t *pool);
01046 
01047 /**
01048  * Same as svn_ra_get_commit_editor2(), but uses @c svn_commit_callback_t.
01049  *
01050  * @since New in 1.2.
01051  *
01052  * @deprecated Provided for backward compatibility with the 1.3 API.
01053  */
01054 SVN_DEPRECATED
01055 svn_error_t *
01056 svn_ra_get_commit_editor(svn_ra_session_t *session,
01057                          const svn_delta_editor_t **editor,
01058                          void **edit_baton,
01059                          const char *log_msg,
01060                          svn_commit_callback_t callback,
01061                          void *callback_baton,
01062                          apr_hash_t *lock_tokens,
01063                          svn_boolean_t keep_locks,
01064                          apr_pool_t *pool);
01065 
01066 /**
01067  * Fetch the contents and properties of file @a path at @a revision.
01068  * @a revision may be SVN_INVALID_REVNUM, indicating that the HEAD
01069  * revision should be used.  Interpret @a path relative to the URL in
01070  * @a session.  Use @a pool for all allocations.
01071  *
01072  * If @a revision is @c SVN_INVALID_REVNUM and @a fetched_rev is not
01073  * @c NULL, then set @a *fetched_rev to the actual revision that was
01074  * retrieved.
01075  *
01076  * If @a stream is non @c NULL, push the contents of the file at @a
01077  * stream, do not call svn_stream_close() when finished.
01078  *
01079  * If @a props is non @c NULL, set @a *props to contain the properties of
01080  * the file.  This means @em all properties: not just ones controlled by
01081  * the user and stored in the repository fs, but non-tweakable ones
01082  * generated by the SCM system itself (e.g. 'wcprops', 'entryprops',
01083  * etc.)  The keys are <tt>const char *</tt>, values are
01084  * <tt>@c svn_string_t *</tt>.
01085  *
01086  * The stream handlers for @a stream may not perform any RA
01087  * operations using @a session.
01088  *
01089  * @since New in 1.2.
01090  */
01091 svn_error_t *
01092 svn_ra_get_file(svn_ra_session_t *session,
01093                 const char *path,
01094                 svn_revnum_t revision,
01095                 svn_stream_t *stream,
01096                 svn_revnum_t *fetched_rev,
01097                 apr_hash_t **props,
01098                 apr_pool_t *pool);
01099 
01100 /**
01101  * If @a dirents is non @c NULL, set @a *dirents to contain all the entries
01102  * of directory @a path at @a revision.  The keys of @a dirents will be
01103  * entry names (<tt>const char *</tt>), and the values dirents
01104  * (<tt>@c svn_dirent_t *</tt>).  Use @a pool for all allocations.
01105  *
01106  * @a dirent_fields controls which portions of the <tt>@c svn_dirent_t</tt>
01107  * objects are filled in.  To have them completely filled in just pass
01108  * @c SVN_DIRENT_ALL, otherwise pass the bitwise OR of all the @c SVN_DIRENT_
01109  * fields you would like to have returned to you.
01110  *
01111  * @a path is interpreted relative to the URL in @a session.
01112  *
01113  * If @a revision is @c SVN_INVALID_REVNUM (meaning 'head') and
01114  * @a *fetched_rev is not @c NULL, then this function will set
01115  * @a *fetched_rev to the actual revision that was retrieved.  (Some
01116  * callers want to know, and some don't.)
01117  *
01118  * If @a props is non @c NULL, set @a *props to contain the properties of
01119  * the directory.  This means @em all properties: not just ones controlled by
01120  * the user and stored in the repository fs, but non-tweakable ones
01121  * generated by the SCM system itself (e.g. 'wcprops', 'entryprops',
01122  * etc.)  The keys are <tt>const char *</tt>, values are
01123  * <tt>@c svn_string_t *</tt>.
01124  *
01125  * @since New in 1.4.
01126  */
01127 svn_error_t *
01128 svn_ra_get_dir2(svn_ra_session_t *session,
01129                 apr_hash_t **dirents,
01130                 svn_revnum_t *fetched_rev,
01131                 apr_hash_t **props,
01132                 const char *path,
01133                 svn_revnum_t revision,
01134                 apr_uint32_t dirent_fields,
01135                 apr_pool_t *pool);
01136 
01137 /**
01138  * Similar to @c svn_ra_get_dir2, but with @c SVN_DIRENT_ALL for the
01139  * @a dirent_fields parameter.
01140  *
01141  * @since New in 1.2.
01142  *
01143  * @deprecated Provided for compatibility with the 1.3 API.
01144  */
01145 SVN_DEPRECATED
01146 svn_error_t *
01147 svn_ra_get_dir(svn_ra_session_t *session,
01148                const char *path,
01149                svn_revnum_t revision,
01150                apr_hash_t **dirents,
01151                svn_revnum_t *fetched_rev,
01152                apr_hash_t **props,
01153                apr_pool_t *pool);
01154 
01155 /**
01156  * Set @a *catalog to a mergeinfo catalog for the paths in @a paths.
01157  * If no mergeinfo is available, set @a *catalog to @c NULL.  The
01158  * requested mergeinfo hashes are for @a paths (which are relative to
01159  * @a session's URL) in @a revision.  If one of the paths does not exist
01160  * in that revision, return SVN_ERR_FS_NOT_FOUND.
01161  *
01162  * @a inherit indicates whether explicit, explicit or inherited, or
01163  * only inherited mergeinfo for @a paths is retrieved.
01164  *
01165  * If @a include_descendants is TRUE, then additionally return the
01166  * mergeinfo for any descendant of any element of @a paths which has
01167  * the @c SVN_PROP_MERGEINFO property explicitly set on it.  (Note
01168  * that inheritance is only taken into account for the elements in @a
01169  * paths; descendants of the elements in @a paths which get their
01170  * mergeinfo via inheritance are not included in @a *catalog.)
01171  *
01172  * Allocate the returned values in @a pool.
01173  *
01174  * If @a revision is @c SVN_INVALID_REVNUM, it defaults to youngest.
01175  *
01176  * If the server doesn't support retrieval of mergeinfo (which can
01177  * happen even for file:// URLs, if the repository itself hasn't been
01178  * upgraded), return @c SVN_ERR_UNSUPPORTED_FEATURE in preference to
01179  * any other error that might otherwise be returned.
01180  *
01181  * @since New in 1.5.
01182  */
01183 svn_error_t *
01184 svn_ra_get_mergeinfo(svn_ra_session_t *session,
01185                      svn_mergeinfo_catalog_t *catalog,
01186                      const apr_array_header_t *paths,
01187                      svn_revnum_t revision,
01188                      svn_mergeinfo_inheritance_t inherit,
01189                      svn_boolean_t include_descendants,
01190                      apr_pool_t *pool);
01191 
01192 /**
01193  * Ask the RA layer to update a working copy to a new revision.
01194  *
01195  * The client initially provides an @a update_editor/@a update_baton to the
01196  * RA layer; this editor contains knowledge of where the change will
01197  * begin in the working copy (when @c open_root() is called).
01198  *
01199  * In return, the client receives a @a reporter/@a report_baton.  The
01200  * client then describes its working copy by making calls into the
01201  * @a reporter.
01202  *
01203  * When finished, the client calls @a reporter->finish_report().  The
01204  * RA layer then does a complete drive of @a update_editor, ending with
01205  * @a update_editor->close_edit(), to update the working copy.
01206  *
01207  * @a update_target is an optional single path component to restrict
01208  * the scope of the update to just that entry (in the directory
01209  * represented by the @a session's URL).  If @a update_target is the
01210  * empty string, the entire directory is updated.
01211  *
01212  * Update the target only as deeply as @a depth indicates.
01213  *
01214  * If @a send_copyfrom_args is TRUE, then ask the server to send
01215  * copyfrom arguments to add_file() and add_directory() when possible.
01216  * (Note: this means that any subsequent txdeltas coming from the
01217  * server are presumed to apply against the copied file!)
01218  *
01219  * Use @a ignore_ancestry to control whether or not items being
01220  * updated will be checked for relatedness first.  Unrelated items
01221  * are typically transmitted to the editor as a deletion of one thing
01222  * and the addition of another, but if this flag is @c TRUE,
01223  * unrelated items will be diffed as if they were related.
01224  *
01225  * The working copy will be updated to @a revision_to_update_to, or the
01226  * "latest" revision if this arg is invalid.
01227  *
01228  * The caller may not perform any RA operations using @a session before
01229  * finishing the report, and may not perform any RA operations using
01230  * @a session from within the editing operations of @a update_editor.
01231  *
01232  * Allocate @a *reporter and @a *report_baton in @a result_pool.  Use
01233  * @a scratch_pool for temporary allocations.
01234  *
01235  * @note The reporter provided by this function does NOT supply copy-
01236  * from information to the diff editor callbacks.
01237  *
01238  * @note In order to prevent pre-1.5 servers from doing more work than
01239  * needed, and sending too much data back, a pre-1.5 'recurse'
01240  * directive may be sent to the server, based on @a depth.
01241  *
01242  * @note Pre Subversion 1.8 svnserve based servers never ignore ancestry.
01243  *
01244  * @note This differs from calling svn_ra_do_switch3() with the current
01245  * URL of the target node.  Update changes only the revision numbers,
01246  * leaving any switched subtrees still switched, whereas switch changes
01247  * every node in the tree to a child of the same URL.
01248  *
01249  * @since New in 1.8.
01250  */
01251 svn_error_t *
01252 svn_ra_do_update3(svn_ra_session_t *session,
01253                   const svn_ra_reporter3_t **reporter,
01254                   void **report_baton,
01255                   svn_revnum_t revision_to_update_to,
01256                   const char *update_target,
01257                   svn_depth_t depth,
01258                   svn_boolean_t send_copyfrom_args,
01259                   svn_boolean_t ignore_ancestry,
01260                   const svn_delta_editor_t *update_editor,
01261                   void *update_baton,
01262                   apr_pool_t *result_pool,
01263                   apr_pool_t *scratch_pool);
01264 
01265 /**
01266  * Similar to svn_ra_do_update3(), but always ignoring ancestry.
01267  *
01268  * @since New in 1.5.
01269  * @deprecated Provided for compatibility with the 1.4 API.
01270  */
01271 SVN_DEPRECATED
01272 svn_error_t *
01273 svn_ra_do_update2(svn_ra_session_t *session,
01274                   const svn_ra_reporter3_t **reporter,
01275                   void **report_baton,
01276                   svn_revnum_t revision_to_update_to,
01277                   const char *update_target,
01278                   svn_depth_t depth,
01279                   svn_boolean_t send_copyfrom_args,
01280                   const svn_delta_editor_t *update_editor,
01281                   void *update_baton,
01282                   apr_pool_t *pool);
01283 
01284 /**
01285  * Similar to svn_ra_do_update2(), but taking @c svn_ra_reporter2_t
01286  * instead of @c svn_ra_reporter3_t; if @a recurse is true, pass @c
01287  * svn_depth_infinity for @a depth, else pass @c svn_depth_files; and
01288  * with @a send_copyfrom_args always false.
01289  *
01290  * @deprecated Provided for compatibility with the 1.4 API.
01291  */
01292 SVN_DEPRECATED
01293 svn_error_t *
01294 svn_ra_do_update(svn_ra_session_t *session,
01295                  const svn_ra_reporter2_t **reporter,
01296                  void **report_baton,
01297                  svn_revnum_t revision_to_update_to,
01298                  const char *update_target,
01299                  svn_boolean_t recurse,
01300                  const svn_delta_editor_t *update_editor,
01301                  void *update_baton,
01302                  apr_pool_t *pool);
01303 
01304 
01305 /**
01306  * Ask the RA layer to switch a working copy to a new revision and URL.
01307  *
01308  * This is similar to svn_ra_do_update3(), but also changes the URL of
01309  * every node in the target tree to a child of the @a switch_url.  In
01310  * contrast, update changes only the revision numbers, leaving any
01311  * switched subtrees still switched.
01312  *
01313  * @note Pre Subversion 1.8 svnserve based servers always ignore ancestry
01314  * and never send copyfrom data.
01315  *
01316  * @since New in 1.8.
01317  */
01318 svn_error_t *
01319 svn_ra_do_switch3(svn_ra_session_t *session,
01320                   const svn_ra_reporter3_t **reporter,
01321                   void **report_baton,
01322                   svn_revnum_t revision_to_switch_to,
01323                   const char *switch_target,
01324                   svn_depth_t depth,
01325                   const char *switch_url,
01326                   svn_boolean_t send_copyfrom_args,
01327                   svn_boolean_t ignore_ancestry,
01328                   const svn_delta_editor_t *switch_editor,
01329                   void *switch_baton,
01330                   apr_pool_t *result_pool,
01331                   apr_pool_t *scratch_pool);
01332 
01333 /**
01334  * Similar to svn_ra_do_switch3(), but always ignoring ancestry and
01335  * never sending copyfrom_args.
01336  *
01337  * @since New in 1.5.
01338  * @deprecated Provided for compatibility with the 1.7 API.
01339  */
01340 SVN_DEPRECATED
01341 svn_error_t *
01342 svn_ra_do_switch2(svn_ra_session_t *session,
01343                   const svn_ra_reporter3_t **reporter,
01344                   void **report_baton,
01345                   svn_revnum_t revision_to_switch_to,
01346                   const char *switch_target,
01347                   svn_depth_t depth,
01348                   const char *switch_url,
01349                   const svn_delta_editor_t *switch_editor,
01350                   void *switch_baton,
01351                   apr_pool_t *pool);
01352 
01353 /**
01354  * Similar to svn_ra_do_switch2(), but taking @c svn_ra_reporter2_t
01355  * instead of @c svn_ra_reporter3_t, and therefore only able to report
01356  * @c svn_depth_infinity for depths.  The switch itself is performed
01357  * according to @a recurse: if TRUE, then use @c svn_depth_infinity
01358  * for @a depth, else use @c svn_depth_files.
01359  *
01360  * @deprecated Provided for compatibility with the 1.4 API.
01361  */
01362 SVN_DEPRECATED
01363 svn_error_t *
01364 svn_ra_do_switch(svn_ra_session_t *session,
01365                  const svn_ra_reporter2_t **reporter,
01366                  void **report_baton,
01367                  svn_revnum_t revision_to_switch_to,
01368                  const char *switch_target,
01369                  svn_boolean_t recurse,
01370                  const char *switch_url,
01371                  const svn_delta_editor_t *switch_editor,
01372                  void *switch_baton,
01373                  apr_pool_t *pool);
01374 
01375 /**
01376  * Ask the RA layer to describe the status of a working copy with respect
01377  * to @a revision of the repository (or HEAD, if @a revision is invalid).
01378  *
01379  * The client initially provides a @a status_editor/@a status_baton to the RA
01380  * layer; this editor contains knowledge of where the change will
01381  * begin in the working copy (when open_root() is called).
01382  *
01383  * In return, the client receives a @a reporter/@a report_baton. The
01384  * client then describes its working copy by making calls into the
01385  * @a reporter.
01386  *
01387  * When finished, the client calls @a reporter->finish_report(). The RA
01388  * layer then does a complete drive of @a status_editor, ending with
01389  * close_edit(), to report, essentially, what would be modified in
01390  * the working copy were the client to call do_update().
01391  * @a status_target is an optional single path component will restrict
01392  * the scope of the status report to an entry in the directory
01393  * represented by the @a session's URL, or empty if the entire directory
01394  * is meant to be examined.
01395  *
01396  * Get status as deeply as @a depth indicates. If @a depth is
01397  * #svn_depth_unknown, get the status down to the ambient depth of the
01398  * working copy. If @a depth is deeper than the working copy, include changes
01399  * that would be needed to populate the working copy to that depth.
01400  *
01401  * The caller may not perform any RA operations using @a session
01402  * before finishing the report, and may not perform any RA operations
01403  * using @a session from within the editing operations of @a status_editor.
01404  *
01405  * Use @a pool for memory allocation.
01406  *
01407  * @note The reporter provided by this function does NOT supply copy-
01408  * from information to the diff editor callbacks.
01409  *
01410  * @note In order to prevent pre-1.5 servers from doing more work than
01411  * needed, and sending too much data back, a pre-1.5 'recurse'
01412  * directive may be sent to the server, based on @a depth.
01413  *
01414  * @since New in 1.5.
01415  */
01416 svn_error_t *
01417 svn_ra_do_status2(svn_ra_session_t *session,
01418                   const svn_ra_reporter3_t **reporter,
01419                   void **report_baton,
01420                   const char *status_target,
01421                   svn_revnum_t revision,
01422                   svn_depth_t depth,
01423                   const svn_delta_editor_t *status_editor,
01424                   void *status_baton,
01425                   apr_pool_t *pool);
01426 
01427 
01428 /**
01429  * Similar to svn_ra_do_status2(), but taking @c svn_ra_reporter2_t
01430  * instead of @c svn_ra_reporter3_t, and therefore only able to report
01431  * @c svn_depth_infinity for depths.  The status operation itself is
01432  * performed according to @a recurse: if TRUE, then @a depth is
01433  * @c svn_depth_infinity, else it is @c svn_depth_immediates.
01434  *
01435  * @deprecated Provided for compatibility with the 1.4 API.
01436  */
01437 SVN_DEPRECATED
01438 svn_error_t *
01439 svn_ra_do_status(svn_ra_session_t *session,
01440                  const svn_ra_reporter2_t **reporter,
01441                  void **report_baton,
01442                  const char *status_target,
01443                  svn_revnum_t revision,
01444                  svn_boolean_t recurse,
01445                  const svn_delta_editor_t *status_editor,
01446                  void *status_baton,
01447                  apr_pool_t *pool);
01448 
01449 /**
01450  * Ask the RA layer to 'diff' a working copy against @a versus_url;
01451  * it's another form of svn_ra_do_update2().
01452  *
01453  * @note This function cannot be used to diff a single file, only a
01454  * working copy directory.  See the svn_ra_do_switch3() function
01455  * for more details.
01456  *
01457  * The client initially provides a @a diff_editor/@a diff_baton to the RA
01458  * layer; this editor contains knowledge of where the common diff
01459  * root is in the working copy (when open_root() is called).
01460  *
01461  * In return, the client receives a @a reporter/@a report_baton. The
01462  * client then describes its working copy by making calls into the
01463  * @a reporter.
01464  *
01465  * When finished, the client calls @a reporter->finish_report().  The
01466  * RA layer then does a complete drive of @a diff_editor, ending with
01467  * close_edit(), to transmit the diff.
01468  *
01469  * @a diff_target is an optional single path component will restrict
01470  * the scope of the diff to an entry in the directory represented by
01471  * the @a session's URL, or empty if the entire directory is meant to be
01472  * one of the diff paths.
01473  *
01474  * The working copy will be diffed against @a versus_url as it exists
01475  * in revision @a revision, or as it is in head if @a revision is
01476  * @c SVN_INVALID_REVNUM.
01477  *
01478  * Use @a ignore_ancestry to control whether or not items being
01479  * diffed will be checked for relatedness first.  Unrelated items
01480  * are typically transmitted to the editor as a deletion of one thing
01481  * and the addition of another, but if this flag is @c TRUE,
01482  * unrelated items will be diffed as if they were related.
01483  *
01484  * Diff only as deeply as @a depth indicates.
01485  *
01486  * The caller may not perform any RA operations using @a session before
01487  * finishing the report, and may not perform any RA operations using
01488  * @a session from within the editing operations of @a diff_editor.
01489  *
01490  * @a text_deltas instructs the driver of the @a diff_editor to enable
01491  * the generation of text deltas. If @a text_deltas is FALSE the window
01492  * handler returned by apply_textdelta will be called once with a NULL
01493  * @c svn_txdelta_window_t pointer.
01494  *
01495  * Use @a pool for memory allocation.
01496  *
01497  * @note The reporter provided by this function does NOT supply copy-
01498  * from information to the diff editor callbacks.
01499  *
01500  * @note In order to prevent pre-1.5 servers from doing more work than
01501  * needed, and sending too much data back, a pre-1.5 'recurse'
01502  * directive may be sent to the server, based on @a depth.
01503  *
01504  * @since New in 1.5.
01505  */
01506 svn_error_t *
01507 svn_ra_do_diff3(svn_ra_session_t *session,
01508                 const svn_ra_reporter3_t **reporter,
01509                 void **report_baton,
01510                 svn_revnum_t revision,
01511                 const char *diff_target,
01512                 svn_depth_t depth,
01513                 svn_boolean_t ignore_ancestry,
01514                 svn_boolean_t text_deltas,
01515                 const char *versus_url,
01516                 const svn_delta_editor_t *diff_editor,
01517                 void *diff_baton,
01518                 apr_pool_t *pool);
01519 
01520 /**
01521  * Similar to svn_ra_do_diff3(), but taking @c svn_ra_reporter2_t
01522  * instead of @c svn_ra_reporter3_t, and therefore only able to report
01523  * @c svn_depth_infinity for depths.  Perform the diff according to
01524  * @a recurse: if TRUE, then @a depth is @c svn_depth_infinity, else
01525  * it is @c svn_depth_files.
01526  *
01527  * @deprecated Provided for compatibility with the 1.4 API.
01528  */
01529 SVN_DEPRECATED
01530 svn_error_t *
01531 svn_ra_do_diff2(svn_ra_session_t *session,
01532                 const svn_ra_reporter2_t **reporter,
01533                 void **report_baton,
01534                 svn_revnum_t revision,
01535                 const char *diff_target,
01536                 svn_boolean_t recurse,
01537                 svn_boolean_t ignore_ancestry,
01538                 svn_boolean_t text_deltas,
01539                 const char *versus_url,
01540                 const svn_delta_editor_t *diff_editor,
01541                 void *diff_baton,
01542                 apr_pool_t *pool);
01543 
01544 
01545 /**
01546  * Similar to svn_ra_do_diff2(), but with @a text_deltas set to @c TRUE.
01547  *
01548  * @deprecated Provided for backward compatibility with the 1.3 API.
01549  */
01550 SVN_DEPRECATED
01551 svn_error_t *
01552 svn_ra_do_diff(svn_ra_session_t *session,
01553                const svn_ra_reporter2_t **reporter,
01554                void **report_baton,
01555                svn_revnum_t revision,
01556                const char *diff_target,
01557                svn_boolean_t recurse,
01558                svn_boolean_t ignore_ancestry,
01559                const char *versus_url,
01560                const svn_delta_editor_t *diff_editor,
01561                void *diff_baton,
01562                apr_pool_t *pool);
01563 
01564 /**
01565  * Invoke @a receiver with @a receiver_baton on each log message from
01566  * @a start to @a end.  @a start may be greater or less than @a end;
01567  * this just controls whether the log messages are processed in descending
01568  * or ascending revision number order.
01569  *
01570  * If @a start or @a end is @c SVN_INVALID_REVNUM, it defaults to youngest.
01571  *
01572  * If @a paths is non-NULL and has one or more elements, then only show
01573  * revisions in which at least one of @a paths was changed (i.e., if
01574  * file, text or props changed; if dir, props changed or an entry
01575  * was added or deleted).  Each path is an <tt>const char *</tt>, relative
01576  * to the @a session's common parent.
01577  *
01578  * If @a limit is greater than zero only invoke @a receiver on the first
01579  * @a limit logs.
01580  *
01581  * If @a discover_changed_paths, then each call to @a receiver passes a
01582  * <tt>const apr_hash_t *</tt> for the receiver's @a changed_paths argument;
01583  * the hash's keys are all the paths committed in that revision, the hash's
01584  * values are <tt>const svn_log_changed_path2_t *</tt> for each committed
01585  * path. Otherwise, each call to receiver passes NULL for @a changed_paths.
01586  *
01587  * If @a strict_node_history is set, copy history will not be traversed
01588  * (if any exists) when harvesting the revision logs for each path.
01589  *
01590  * If @a include_merged_revisions is set, log information for revisions
01591  * which have been merged to @a targets will also be returned.
01592  *
01593  * @a move_behavior defines which changes are being reported as moves.
01594  * See #svn_move_behavior_t for the various options.
01595  *
01596  * If @a revprops is NULL, retrieve all revision properties; else, retrieve
01597  * only the revision properties named by the (const char *) array elements
01598  * (i.e. retrieve none if the array is empty).
01599  *
01600  * If any invocation of @a receiver returns error, return that error
01601  * immediately and without wrapping it.
01602  *
01603  * If @a start or @a end is a non-existent revision, return the error
01604  * @c SVN_ERR_FS_NO_SUCH_REVISION, without ever invoking @a receiver.
01605  *
01606  * See also the documentation for @c svn_log_message_receiver_t.
01607  *
01608  * The caller may not invoke any RA operations using @a session from
01609  * within @a receiver.
01610  *
01611  * Use @a pool for memory allocation.
01612  *
01613  * @note If @a paths is NULL or empty, the result depends on the
01614  * server.  Pre-1.5 servers will send nothing; 1.5 servers will
01615  * effectively perform the log operation on the root of the
01616  * repository.  This behavior may be changed in the future to ensure
01617  * consistency across all pedigrees of server.
01618  *
01619  * @note Pre-1.5 servers do not support custom revprop retrieval; if @a
01620  * revprops is NULL or contains a revprop other than svn:author, svn:date,
01621  * or svn:log, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is returned.
01622  *
01623  * @since New in 1.9.
01624  */
01625 
01626 svn_error_t *
01627 svn_ra_get_log3(svn_ra_session_t *session,
01628                 const apr_array_header_t *paths,
01629                 svn_revnum_t start,
01630                 svn_revnum_t end,
01631                 int limit,
01632                 svn_boolean_t discover_changed_paths,
01633                 svn_boolean_t strict_node_history,
01634                 svn_boolean_t include_merged_revisions,
01635                 svn_move_behavior_t move_behavior,
01636                 const apr_array_header_t *revprops,
01637                 svn_log_entry_receiver_t receiver,
01638                 void *receiver_baton,
01639                 apr_pool_t *pool);
01640 
01641 /**
01642  * Similar to svn_ra_get_log3(), but with @a move_behavior being set to
01643  * #svn_move_behavior_no_moves.
01644  *
01645  * @since New in 1.5.
01646  * @deprecated Provided for backward compatibility with the 1.8 API.
01647  */
01648 SVN_DEPRECATED
01649 svn_error_t *
01650 svn_ra_get_log2(svn_ra_session_t *session,
01651                 const apr_array_header_t *paths,
01652                 svn_revnum_t start,
01653                 svn_revnum_t end,
01654                 int limit,
01655                 svn_boolean_t discover_changed_paths,
01656                 svn_boolean_t strict_node_history,
01657                 svn_boolean_t include_merged_revisions,
01658                 const apr_array_header_t *revprops,
01659                 svn_log_entry_receiver_t receiver,
01660                 void *receiver_baton,
01661                 apr_pool_t *pool);
01662 
01663 /**
01664  * Similar to svn_ra_get_log2(), but uses @c svn_log_message_receiver_t
01665  * instead of @c svn_log_entry_receiver_t.  Also, @a
01666  * include_merged_revisions is set to @c FALSE and @a revprops is
01667  * svn:author, svn:date, and svn:log.
01668  *
01669  * @since New in 1.2.
01670  * @deprecated Provided for backward compatibility with the 1.4 API.
01671  */
01672 SVN_DEPRECATED
01673 svn_error_t *
01674 svn_ra_get_log(svn_ra_session_t *session,
01675                const apr_array_header_t *paths,
01676                svn_revnum_t start,
01677                svn_revnum_t end,
01678                int limit,
01679                svn_boolean_t discover_changed_paths,
01680                svn_boolean_t strict_node_history,
01681                svn_log_message_receiver_t receiver,
01682                void *receiver_baton,
01683                apr_pool_t *pool);
01684 
01685 /**
01686  * Set @a *kind to the node kind associated with @a path at @a revision.
01687  * If @a path does not exist under @a revision, set @a *kind to
01688  * @c svn_node_none.  @a path is relative to the @a session's parent URL.
01689  *
01690  * Use @a pool for memory allocation.
01691  *
01692  * @since New in 1.2.
01693  */
01694 svn_error_t *
01695 svn_ra_check_path(svn_ra_session_t *session,
01696                   const char *path,
01697                   svn_revnum_t revision,
01698                   svn_node_kind_t *kind,
01699                   apr_pool_t *pool);
01700 
01701 /**
01702  * Set @a *dirent to an @c svn_dirent_t associated with @a path at @a
01703  * revision.  @a path is relative to the @a session's parent's URL.
01704  * If @a path does not exist in @a revision, set @a *dirent to NULL.
01705  *
01706  * Use @a pool for memory allocation.
01707  *
01708  * @since New in 1.2.
01709  */
01710 svn_error_t *
01711 svn_ra_stat(svn_ra_session_t *session,
01712             const char *path,
01713             svn_revnum_t revision,
01714             svn_dirent_t **dirent,
01715             apr_pool_t *pool);
01716 
01717 
01718 /**
01719  * Set @a *uuid to the repository's UUID, allocated in @a pool.
01720  *
01721  * @since New in 1.5.
01722  */
01723 svn_error_t *
01724 svn_ra_get_uuid2(svn_ra_session_t *session,
01725                  const char **uuid,
01726                  apr_pool_t *pool);
01727 
01728 /**
01729  * Similar to svn_ra_get_uuid2(), but returns the value allocated in
01730  * @a session's pool.
01731  *
01732  * @deprecated Provided for backward compatibility with the 1.4 API.
01733  * @since New in 1.2.
01734  */
01735 SVN_DEPRECATED
01736 svn_error_t *
01737 svn_ra_get_uuid(svn_ra_session_t *session,
01738                 const char **uuid,
01739                 apr_pool_t *pool);
01740 
01741 /**
01742  * Set @a *url to the repository's root URL, allocated in @a pool.
01743  * The value will not include a trailing '/'.  The returned URL is
01744  * guaranteed to be a prefix of the @a session's URL.
01745  *
01746  * @since New in 1.5.
01747  */
01748 svn_error_t *
01749 svn_ra_get_repos_root2(svn_ra_session_t *session,
01750                        const char **url,
01751                        apr_pool_t *pool);
01752 
01753 
01754 /**
01755  * Similar to svn_ra_get_repos_root2(), but returns the value
01756  * allocated in @a session's pool.
01757  *
01758  * @deprecated Provided for backward compatibility with the 1.4 API.
01759  * @since New in 1.2.
01760  */
01761 SVN_DEPRECATED
01762 svn_error_t *
01763 svn_ra_get_repos_root(svn_ra_session_t *session,
01764                       const char **url,
01765                       apr_pool_t *pool);
01766 
01767 /**
01768  * Set @a *locations to the locations (at the repository revisions
01769  * @a location_revisions) of the file identified by @a path in
01770  * @a peg_revision.  @a path is relative to the URL to which
01771  * @a session was opened.  @a location_revisions is an array of
01772  * @c svn_revnum_t's.  @a *locations will be a mapping from the revisions to
01773  * their appropriate absolute paths.  If the file doesn't exist in a
01774  * location_revision, that revision will be ignored.
01775  *
01776  * Use @a pool for all allocations.
01777  *
01778  * @since New in 1.2.
01779  */
01780 svn_error_t *
01781 svn_ra_get_locations(svn_ra_session_t *session,
01782                      apr_hash_t **locations,
01783                      const char *path,
01784                      svn_revnum_t peg_revision,
01785                      const apr_array_header_t *location_revisions,
01786                      apr_pool_t *pool);
01787 
01788 
01789 /**
01790  * Call @a receiver (with @a receiver_baton) for each segment in the
01791  * location history of @a path in @a peg_revision, working backwards in
01792  * time from @a start_rev to @a end_rev.
01793  *
01794  * @a end_rev may be @c SVN_INVALID_REVNUM to indicate that you want
01795  * to trace the history of the object to its origin.
01796  *
01797  * @a start_rev may be @c SVN_INVALID_REVNUM to indicate "the HEAD
01798  * revision".  Otherwise, @a start_rev must be younger than @a end_rev
01799  * (unless @a end_rev is @c SVN_INVALID_REVNUM).
01800  *
01801  * @a peg_revision may be @c SVN_INVALID_REVNUM to indicate "the HEAD
01802  * revision", and must evaluate to be at least as young as @a start_rev.
01803  *
01804  * Use @a pool for all allocations.
01805  *
01806  * @since New in 1.5.
01807  */
01808 svn_error_t *
01809 svn_ra_get_location_segments(svn_ra_session_t *session,
01810                              const char *path,
01811                              svn_revnum_t peg_revision,
01812                              svn_revnum_t start_rev,
01813                              svn_revnum_t end_rev,
01814                              svn_location_segment_receiver_t receiver,
01815                              void *receiver_baton,
01816                              apr_pool_t *pool);
01817 
01818 /**
01819  * Retrieve a subset of the interesting revisions of a file @a path
01820  * as seen in revision @a end (see svn_fs_history_prev() for a
01821  * definition of "interesting revisions").  Invoke @a handler with
01822  * @a handler_baton as its first argument for each such revision.
01823  * @a session is an open RA session.  Use @a pool for all allocations.
01824  *
01825  * If there is an interesting revision of the file that is less than or
01826  * equal to @a start, the iteration will begin at that revision.
01827  * Else, the iteration will begin at the first revision of the file in
01828  * the repository, which has to be less than or equal to @a end.  Note
01829  * that if the function succeeds, @a handler will have been called at
01830  * least once.
01831  *
01832  * In a series of calls to @a handler, the file contents for the first
01833  * interesting revision will be provided as a text delta against the
01834  * empty file.  In the following calls, the delta will be against the
01835  * fulltext contents for the previous call.
01836  *
01837  * If @a include_merged_revisions is TRUE, revisions which are
01838  * included as a result of a merge between @a start and @a end will be
01839  * included.
01840  *
01841  * @note This functionality is not available in pre-1.1 servers.  If the
01842  * server doesn't implement it, an alternative (but much slower)
01843  * implementation based on svn_ra_get_log2() is used.
01844  *
01845  * On subversion 1.8 and newer servers this function has been enabled
01846  * to support reversion of the revision range for @a include_merged_revision
01847  * @c FALSE reporting by switching  @a end with @a start.
01848  *
01849  * @note Prior to Subversion 1.9, this function may accept delta handlers
01850  * from @handler even for empty text deltas.  Starting with 1.9, the
01851  * delta handler / baton return arguments passed to @handler will be
01852  * #NULL unless there is an actual difference in the file contents between
01853  * the current and the previous call.
01854  *
01855  * @since New in 1.5.
01856  */
01857 svn_error_t *
01858 svn_ra_get_file_revs2(svn_ra_session_t *session,
01859                       const char *path,
01860                       svn_revnum_t start,
01861                       svn_revnum_t end,
01862                       svn_boolean_t include_merged_revisions,
01863                       svn_file_rev_handler_t handler,
01864                       void *handler_baton,
01865                       apr_pool_t *pool);
01866 
01867 /**
01868  * Similar to svn_ra_get_file_revs2(), but with @a include_merged_revisions
01869  * set to FALSE.
01870  *
01871  * @since New in 1.2.
01872  * @deprecated Provided for backward compatibility with the 1.4 API.
01873  */
01874 SVN_DEPRECATED
01875 svn_error_t *
01876 svn_ra_get_file_revs(svn_ra_session_t *session,
01877                      const char *path,
01878                      svn_revnum_t start,
01879                      svn_revnum_t end,
01880                      svn_ra_file_rev_handler_t handler,
01881                      void *handler_baton,
01882                      apr_pool_t *pool);
01883 
01884 /**
01885  * Lock each path in @a path_revs, which is a hash whose keys are the
01886  * paths to be locked, and whose values are the corresponding base
01887  * revisions for each path.  The keys are (const char *) and the
01888  * revisions are (svn_revnum_t *).
01889  *
01890  * Note that locking is never anonymous, so any server implementing
01891  * this function will have to "pull" a username from the client, if
01892  * it hasn't done so already.
01893  *
01894  * @a comment is optional: it's either an xml-escapable string
01895  * which describes the lock, or it is NULL.
01896  *
01897  * If any path is already locked by a different user, then call @a
01898  * lock_func/@a lock_baton with an error.  If @a steal_lock is TRUE,
01899  * then "steal" the existing lock(s) anyway, even if the RA username
01900  * does not match the current lock's owner.  Delete any lock on the
01901  * path, and unconditionally create a new lock.
01902  *
01903  * For each path, if its base revision (in @a path_revs) is a valid
01904  * revnum, then do an out-of-dateness check.  If the revnum is less
01905  * than the last-changed-revision of any path (or if a path doesn't
01906  * exist in HEAD), call @a lock_func/@a lock_baton with an
01907  * SVN_ERR_RA_OUT_OF_DATE error.
01908  *
01909  * After successfully locking a file, @a lock_func is called with the
01910  * @a lock_baton.
01911  *
01912  * Use @a pool for temporary allocations.
01913  *
01914  * @since New in 1.2.
01915  */
01916 svn_error_t *
01917 svn_ra_lock(svn_ra_session_t *session,
01918             apr_hash_t *path_revs,
01919             const char *comment,
01920             svn_boolean_t steal_lock,
01921             svn_ra_lock_callback_t lock_func,
01922             void *lock_baton,
01923             apr_pool_t *pool);
01924 
01925 /**
01926  * Remove the repository lock for each path in @a path_tokens.
01927  * @a path_tokens is a hash whose keys are the paths to be locked, and
01928  * whose values are the corresponding lock tokens for each path.  If
01929  * the path has no corresponding lock token, or if @a break_lock is TRUE,
01930  * then the corresponding value shall be "".
01931  *
01932  * Note that unlocking is never anonymous, so any server
01933  * implementing this function will have to "pull" a username from
01934  * the client, if it hasn't done so already.
01935  *
01936  * If @a token points to a lock, but the RA username doesn't match the
01937  * lock's owner, call @a lock_func/@a lock_baton with an error.  If @a
01938  * break_lock is TRUE, however, instead allow the lock to be "broken"
01939  * by the RA user.
01940  *
01941  * After successfully unlocking a path, @a lock_func is called with
01942  * the @a lock_baton.
01943  *
01944  * Use @a pool for temporary allocations.
01945  *
01946  * @since New in 1.2.
01947  */
01948 svn_error_t *
01949 svn_ra_unlock(svn_ra_session_t *session,
01950               apr_hash_t *path_tokens,
01951               svn_boolean_t break_lock,
01952               svn_ra_lock_callback_t lock_func,
01953               void *lock_baton,
01954               apr_pool_t *pool);
01955 
01956 /**
01957  * If @a path is locked, set @a *lock to an svn_lock_t which
01958  * represents the lock, allocated in @a pool.  If @a path is not
01959  * locked, set @a *lock to NULL.
01960  *
01961  * @since New in 1.2.
01962  */
01963 svn_error_t *
01964 svn_ra_get_lock(svn_ra_session_t *session,
01965                 svn_lock_t **lock,
01966                 const char *path,
01967                 apr_pool_t *pool);
01968 
01969 /**
01970  * Set @a *locks to a hashtable which represents all locks on or
01971  * below @a path.
01972  *
01973  * @a depth limits the returned locks to those associated with paths
01974  * within the specified depth of @a path, and must be one of the
01975  * following values:  #svn_depth_empty, #svn_depth_files,
01976  * #svn_depth_immediates, or #svn_depth_infinity.
01977  *
01978  * The hashtable maps (const char *) absolute fs paths to (const
01979  * svn_lock_t *) structures.  The hashtable -- and all keys and
01980  * values -- are allocated in @a pool.
01981  *
01982  * @note It is not considered an error for @a path to not exist in HEAD.
01983  * Such a search will simply return no locks.
01984  *
01985  * @note This functionality is not available in pre-1.2 servers.  If the
01986  * server doesn't implement it, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is
01987  * returned.
01988  *
01989  * @since New in 1.7.
01990  */
01991 svn_error_t *
01992 svn_ra_get_locks2(svn_ra_session_t *session,
01993                   apr_hash_t **locks,
01994                   const char *path,
01995                   svn_depth_t depth,
01996                   apr_pool_t *pool);
01997 
01998 /**
01999  * Similar to svn_ra_get_locks2(), but with @a depth always passed as
02000  * #svn_depth_infinity.
02001  *
02002  * @since New in 1.2.
02003  * @deprecated Provided for backward compatibility with the 1.6 API.
02004  */
02005 SVN_DEPRECATED
02006 svn_error_t *
02007 svn_ra_get_locks(svn_ra_session_t *session,
02008                  apr_hash_t **locks,
02009                  const char *path,
02010                  apr_pool_t *pool);
02011 
02012 
02013 /**
02014  * Replay the changes from a range of revisions between @a start_revision
02015  * and @a end_revision.
02016  *
02017  * When receiving information for one revision, a callback @a revstart_func is
02018  * called; this callback will provide an editor and baton through which the
02019  * revision will be replayed.
02020  * When replaying the revision is finished, callback @a revfinish_func will be
02021  * called so the editor can be closed.
02022  *
02023  * Changes will be limited to those that occur under @a session's URL, and
02024  * the server will assume that the client has no knowledge of revisions
02025  * prior to @a low_water_mark.  These two limiting factors define the portion
02026  * of the tree that the server will assume the client already has knowledge of,
02027  * and thus any copies of data from outside that part of the tree will be
02028  * sent in their entirety, not as simple copies or deltas against a previous
02029  * version.
02030  *
02031  * If @a send_deltas is @c TRUE, the actual text and property changes in
02032  * the revision will be sent, otherwise dummy text deltas and NULL property
02033  * changes will be sent instead.
02034  *
02035  * @a pool is used for all allocation.
02036  *
02037  * @since New in 1.5.
02038  */
02039 svn_error_t *
02040 svn_ra_replay_range(svn_ra_session_t *session,
02041                     svn_revnum_t start_revision,
02042                     svn_revnum_t end_revision,
02043                     svn_revnum_t low_water_mark,
02044                     svn_boolean_t send_deltas,
02045                     svn_ra_replay_revstart_callback_t revstart_func,
02046                     svn_ra_replay_revfinish_callback_t revfinish_func,
02047                     void *replay_baton,
02048                     apr_pool_t *pool);
02049 
02050 /**
02051  * Replay the changes from @a revision through @a editor and @a edit_baton.
02052  *
02053  * Changes will be limited to those that occur under @a session's URL, and
02054  * the server will assume that the client has no knowledge of revisions
02055  * prior to @a low_water_mark.  These two limiting factors define the portion
02056  * of the tree that the server will assume the client already has knowledge of,
02057  * and thus any copies of data from outside that part of the tree will be
02058  * sent in their entirety, not as simple copies or deltas against a previous
02059  * version.
02060  *
02061  * If @a send_deltas is @c TRUE, the actual text and property changes in
02062  * the revision will be sent, otherwise dummy text deltas and null property
02063  * changes will be sent instead.
02064  *
02065  * @a pool is used for all allocation.
02066  *
02067  * @since New in 1.4.
02068  */
02069 svn_error_t *
02070 svn_ra_replay(svn_ra_session_t *session,
02071               svn_revnum_t revision,
02072               svn_revnum_t low_water_mark,
02073               svn_boolean_t send_deltas,
02074               const svn_delta_editor_t *editor,
02075               void *edit_baton,
02076               apr_pool_t *pool);
02077 
02078 /**
02079  * Given @a path at revision @a peg_revision, set @a *revision_deleted to the
02080  * revision @a path was first deleted, within the inclusive revision range
02081  * defined by @a peg_revision and @a end_revision.  @a path is relative
02082  * to the URL in @a session.
02083  *
02084  * If @a path does not exist at @a peg_revision or was not deleted within
02085  * the specified range, then set @a *revision_deleted to @c SVN_INVALID_REVNUM.
02086  * If @a peg_revision or @a end_revision are invalid or if @a peg_revision is
02087  * greater than @a end_revision, then return @c SVN_ERR_CLIENT_BAD_REVISION.
02088  *
02089  * Use @a pool for all allocations.
02090  *
02091  * @since New in 1.6.
02092  */
02093 svn_error_t *
02094 svn_ra_get_deleted_rev(svn_ra_session_t *session,
02095                        const char *path,
02096                        svn_revnum_t peg_revision,
02097                        svn_revnum_t end_revision,
02098                        svn_revnum_t *revision_deleted,
02099                        apr_pool_t *pool);
02100 
02101 /**
02102  * Set @a *inherited_props to a depth-first ordered array of
02103  * #svn_prop_inherited_item_t * structures representing the properties
02104  * inherited by @a path at @a revision (or the 'head' revision if
02105  * @a revision is @c SVN_INVALID_REVNUM).  Interpret @a path relative to
02106  * the URL in @a session.  Use @a pool for all allocations.  If no
02107  * inheritable properties are found, then set @a *inherited_props to
02108  * an empty array.
02109  *
02110  * The #svn_prop_inherited_item_t->path_or_url members of the
02111  * #svn_prop_inherited_item_t * structures in @a *inherited_props are
02112  * paths relative to the repository root URL (of the repository which
02113  * @a ra_session is associated).
02114  *
02115  * Allocate @a *inherited_props in @a result_pool.  Use @a scratch_pool
02116  * for temporary allocations.
02117  *
02118  * @since New in 1.8.
02119  */
02120 svn_error_t *
02121 svn_ra_get_inherited_props(svn_ra_session_t *session,
02122                            apr_array_header_t **inherited_props,
02123                            const char *path,
02124                            svn_revnum_t revision,
02125                            apr_pool_t *result_pool,
02126                            apr_pool_t *scratch_pool);
02127 
02128 /**
02129  * @defgroup Capabilities Dynamically query the server's capabilities.
02130  *
02131  * @{
02132  */
02133 
02134 /**
02135  * Set @a *has to TRUE if the server represented by @a session has
02136  * @a capability (one of the capabilities beginning with
02137  * @c "SVN_RA_CAPABILITY_"), else set @a *has to FALSE.
02138  *
02139  * If @a capability isn't recognized, throw @c SVN_ERR_UNKNOWN_CAPABILITY,
02140  * with the effect on @a *has undefined.
02141  *
02142  * Use @a pool for all allocation.
02143  *
02144  * @since New in 1.5.
02145  */
02146 svn_error_t *
02147 svn_ra_has_capability(svn_ra_session_t *session,
02148                       svn_boolean_t *has,
02149                       const char *capability,
02150                       apr_pool_t *pool);
02151 
02152 /**
02153  * The capability of understanding @c svn_depth_t (e.g., the server
02154  * understands what the client means when the client describes the
02155  * depth of a working copy to the server.)
02156  *
02157  * @since New in 1.5.
02158  */
02159 #define SVN_RA_CAPABILITY_DEPTH "depth"
02160 
02161 /**
02162  * The capability of doing the right thing with merge-tracking
02163  * information.  This capability should be reported bidirectionally,
02164  * because some repositories may want to reject clients that do not
02165  * self-report as knowing how to handle merge-tracking.
02166  *
02167  * @since New in 1.5.
02168  */
02169 #define SVN_RA_CAPABILITY_MERGEINFO "mergeinfo"
02170 
02171 /**
02172  * The capability of retrieving arbitrary revprops in svn_ra_get_log2.
02173  *
02174  * @since New in 1.5.
02175  */
02176 #define SVN_RA_CAPABILITY_LOG_REVPROPS "log-revprops"
02177 
02178 /**
02179  * The capability of replaying a directory in the repository (partial replay).
02180  *
02181  * @since New in 1.5.
02182  */
02183 #define SVN_RA_CAPABILITY_PARTIAL_REPLAY "partial-replay"
02184 
02185 /**
02186  * The capability of including revision properties in a commit.
02187  *
02188  * @since New in 1.5.
02189  */
02190 #define SVN_RA_CAPABILITY_COMMIT_REVPROPS "commit-revprops"
02191 
02192 /**
02193  * The capability of specifying (and atomically verifying) expected
02194  * preexisting values when modifying revprops.
02195  *
02196  * @since New in 1.7.
02197  */
02198 #define SVN_RA_CAPABILITY_ATOMIC_REVPROPS "atomic-revprops"
02199 
02200 /**
02201  * The capability to get inherited properties.
02202  *
02203  * @since New in 1.8.
02204  */
02205 #define SVN_RA_CAPABILITY_INHERITED_PROPS "inherited-props"
02206 
02207 /**
02208  * The capability of a server to automatically remove transaction
02209  * properties prefixed with SVN_PROP_EPHEMERAL_PREFIX.
02210  *
02211  * @since New in 1.8.
02212  */
02213 #define SVN_RA_CAPABILITY_EPHEMERAL_TXNPROPS "ephemeral-txnprops"
02214 
02215 /**
02216  * The capability of a server to walk revisions backwards in
02217  * svn_ra_get_file_revs2
02218  *
02219  * @since New in 1.8.
02220  */
02221 #define SVN_RA_CAPABILITY_GET_FILE_REVS_REVERSE "get-file-revs-reversed"
02222 
02223 
02224 /*       *** PLEASE READ THIS IF YOU ADD A NEW CAPABILITY ***
02225  *
02226  * RA layers generally fetch all capabilities when asked about any
02227  * capability, to save future round trips.  So if you add a new
02228  * capability here, make sure to update the RA layers to remember
02229  * it after any capabilities query.
02230  *
02231  * Also note that capability strings should not include colons,
02232  * because we pass a list of client capabilities to the start-commit
02233  * hook as a single, colon-separated string.
02234  */
02235 
02236 /** @} */
02237 
02238 
02239 /**
02240  * Append a textual list of all available RA modules to the stringbuf
02241  * @a output.
02242  *
02243  * @since New in 1.2.
02244  */
02245 svn_error_t *
02246 svn_ra_print_modules(svn_stringbuf_t *output,
02247                      apr_pool_t *pool);
02248 
02249 
02250 /**
02251  * Similar to svn_ra_print_modules().
02252  * @a ra_baton is ignored.
02253  *
02254  * @deprecated Provided for backward compatibility with the 1.1 API.
02255  */
02256 SVN_DEPRECATED
02257 svn_error_t *
02258 svn_ra_print_ra_libraries(svn_stringbuf_t **descriptions,
02259                           void *ra_baton,
02260                           apr_pool_t *pool);
02261 
02262 
02263 
02264 /**
02265  * Using this callback struct is similar to calling the newer public
02266  * interface that is based on @c svn_ra_session_t.
02267  *
02268  * @deprecated Provided for backward compatibility with the 1.1 API.
02269  */
02270 typedef struct svn_ra_plugin_t
02271 {
02272   /** The proper name of the RA library, (like "ra_serf" or "ra_local") */
02273   const char *name;
02274 
02275   /** Short doc string printed out by `svn --version` */
02276   const char *description;
02277 
02278   /* The vtable hooks */
02279 
02280   /** Call svn_ra_open() and set @a session_baton to an object representing
02281    * the new session.  All other arguments are passed to svn_ra_open().
02282    */
02283   svn_error_t *(*open)(void **session_baton,
02284                        const char *repos_URL,
02285                        const svn_ra_callbacks_t *callbacks,
02286                        void *callback_baton,
02287                        apr_hash_t *config,
02288                        apr_pool_t *pool);
02289 
02290   /** Call svn_ra_get_latest_revnum() with the session associated with
02291    * @a session_baton and all other arguments.
02292    */
02293   svn_error_t *(*get_latest_revnum)(void *session_baton,
02294                                     svn_revnum_t *latest_revnum,
02295                                     apr_pool_t *pool);
02296 
02297   /** Call svn_ra_get_dated_revision() with the session associated with
02298    * @a session_baton and all other arguments.
02299    */
02300   svn_error_t *(*get_dated_revision)(void *session_baton,
02301                                      svn_revnum_t *revision,
02302                                      apr_time_t tm,
02303                                      apr_pool_t *pool);
02304 
02305   /** Call svn_ra_change_rev_prop() with the session associated with
02306    * @a session_baton and all other arguments.
02307    */
02308   svn_error_t *(*change_rev_prop)(void *session_baton,
02309                                   svn_revnum_t rev,
02310                                   const char *name,
02311                                   const svn_string_t *value,
02312                                   apr_pool_t *pool);
02313 
02314   /** Call svn_ra_rev_proplist() with the session associated with
02315    * @a session_baton and all other arguments.
02316    */
02317   svn_error_t *(*rev_proplist)(void *session_baton,
02318                                svn_revnum_t rev,
02319                                apr_hash_t **props,
02320                                apr_pool_t *pool);
02321 
02322   /** Call svn_ra_rev_prop() with the session associated with
02323    * @a session_baton and all other arguments.
02324    */
02325   svn_error_t *(*rev_prop)(void *session_baton,
02326                            svn_revnum_t rev,
02327                            const char *name,
02328                            svn_string_t **value,
02329                            apr_pool_t *pool);
02330 
02331   /** Call svn_ra_get_commit_editor() with the session associated with
02332    * @a session_baton and all other arguments plus @a lock_tokens set to
02333    * @c NULL and @a keep_locks set to @c TRUE.
02334    */
02335   svn_error_t *(*get_commit_editor)(void *session_baton,
02336                                     const svn_delta_editor_t **editor,
02337                                     void **edit_baton,
02338                                     const char *log_msg,
02339                                     svn_commit_callback_t callback,
02340                                     void *callback_baton,
02341                                     apr_pool_t *pool);
02342 
02343   /** Call svn_ra_get_file() with the session associated with
02344    * @a session_baton and all other arguments.
02345    */
02346   svn_error_t *(*get_file)(void *session_baton,
02347                            const char *path,
02348                            svn_revnum_t revision,
02349                            svn_stream_t *stream,
02350                            svn_revnum_t *fetched_rev,
02351                            apr_hash_t **props,
02352                            apr_pool_t *pool);
02353 
02354   /** Call svn_ra_get_dir() with the session associated with
02355    * @a session_baton and all other arguments.
02356    */
02357   svn_error_t *(*get_dir)(void *session_baton,
02358                           const char *path,
02359                           svn_revnum_t revision,
02360                           apr_hash_t **dirents,
02361                           svn_revnum_t *fetched_rev,
02362                           apr_hash_t **props,
02363                           apr_pool_t *pool);
02364 
02365   /** Call svn_ra_do_update() with the session associated with
02366    * @a session_baton and all other arguments.
02367    */
02368   svn_error_t *(*do_update)(void *session_baton,
02369                             const svn_ra_reporter_t **reporter,
02370                             void **report_baton,
02371                             svn_revnum_t revision_to_update_to,
02372                             const char *update_target,
02373                             svn_boolean_t recurse,
02374                             const svn_delta_editor_t *update_editor,
02375                             void *update_baton,
02376                             apr_pool_t *pool);
02377 
02378   /** Call svn_ra_do_switch() with the session associated with
02379    * @a session_baton and all other arguments.
02380    */
02381   svn_error_t *(*do_switch)(void *session_baton,
02382                             const svn_ra_reporter_t **reporter,
02383                             void **report_baton,
02384                             svn_revnum_t revision_to_switch_to,
02385                             const char *switch_target,
02386                             svn_boolean_t recurse,
02387                             const char *switch_url,
02388                             const svn_delta_editor_t *switch_editor,
02389                             void *switch_baton,
02390                             apr_pool_t *pool);
02391 
02392   /** Call svn_ra_do_status() with the session associated with
02393    * @a session_baton and all other arguments.
02394    */
02395   svn_error_t *(*do_status)(void *session_baton,
02396                             const svn_ra_reporter_t **reporter,
02397                             void **report_baton,
02398                             const char *status_target,
02399                             svn_revnum_t revision,
02400                             svn_boolean_t recurse,
02401                             const svn_delta_editor_t *status_editor,
02402                             void *status_baton,
02403                             apr_pool_t *pool);
02404 
02405   /** Call svn_ra_do_diff() with the session associated with
02406    * @a session_baton and all other arguments.
02407    */
02408   svn_error_t *(*do_diff)(void *session_baton,
02409                           const svn_ra_reporter_t **reporter,
02410                           void **report_baton,
02411                           svn_revnum_t revision,
02412                           const char *diff_target,
02413                           svn_boolean_t recurse,
02414                           svn_boolean_t ignore_ancestry,
02415                           const char *versus_url,
02416                           const svn_delta_editor_t *diff_editor,
02417                           void *diff_baton,
02418                           apr_pool_t *pool);
02419 
02420   /** Call svn_ra_get_log() with the session associated with
02421    * @a session_baton and all other arguments.  @a limit is set to 0.
02422    */
02423   svn_error_t *(*get_log)(void *session_baton,
02424                           const apr_array_header_t *paths,
02425                           svn_revnum_t start,
02426                           svn_revnum_t end,
02427                           svn_boolean_t discover_changed_paths,
02428                           svn_boolean_t strict_node_history,
02429                           svn_log_message_receiver_t receiver,
02430                           void *receiver_baton,
02431                           apr_pool_t *pool);
02432 
02433   /** Call svn_ra_check_path() with the session associated with
02434    * @a session_baton and all other arguments.
02435    */
02436   svn_error_t *(*check_path)(void *session_baton,
02437                              const char *path,
02438                              svn_revnum_t revision,
02439                              svn_node_kind_t *kind,
02440                              apr_pool_t *pool);
02441 
02442   /** Call svn_ra_get_uuid() with the session associated with
02443    * @a session_baton and all other arguments.
02444    */
02445   svn_error_t *(*get_uuid)(void *session_baton,
02446                            const char **uuid,
02447                            apr_pool_t *pool);
02448 
02449   /** Call svn_ra_get_repos_root() with the session associated with
02450    * @a session_baton and all other arguments.
02451    */
02452   svn_error_t *(*get_repos_root)(void *session_baton,
02453                                  const char **url,
02454                                  apr_pool_t *pool);
02455 
02456   /**
02457    * Call svn_ra_get_locations() with the session associated with
02458    * @a session_baton and all other arguments.
02459    *
02460    * @since New in 1.1.
02461    */
02462   svn_error_t *(*get_locations)(void *session_baton,
02463                                 apr_hash_t **locations,
02464                                 const char *path,
02465                                 svn_revnum_t peg_revision,
02466                                 apr_array_header_t *location_revisions,
02467                                 apr_pool_t *pool);
02468 
02469   /**
02470    * Call svn_ra_get_file_revs() with the session associated with
02471    * @a session_baton and all other arguments.
02472    *
02473    * @since New in 1.1.
02474    */
02475   svn_error_t *(*get_file_revs)(void *session_baton,
02476                                 const char *path,
02477                                 svn_revnum_t start,
02478                                 svn_revnum_t end,
02479                                 svn_ra_file_rev_handler_t handler,
02480                                 void *handler_baton,
02481                                 apr_pool_t *pool);
02482 
02483   /**
02484    * Return the plugin's version information.
02485    *
02486    * @since New in 1.1.
02487    */
02488   const svn_version_t *(*get_version)(void);
02489 
02490 
02491 } svn_ra_plugin_t;
02492 
02493 /**
02494  * All "ra_FOO" implementations *must* export a function named
02495  * svn_ra_FOO_init() of type @c svn_ra_init_func_t.
02496  *
02497  * When called by libsvn_client, this routine adds an entry (or
02498  * entries) to the hash table for any URL schemes it handles.  The hash
02499  * value must be of type (<tt>@c svn_ra_plugin_t *</tt>).  @a pool is a
02500  * pool for allocating configuration / one-time data.
02501  *
02502  * This type is defined to use the "C Calling Conventions" to ensure that
02503  * abi_version is the first parameter. The RA plugin must check that value
02504  * before accessing the other parameters.
02505  *
02506  * ### need to force this to be __cdecl on Windows... how??
02507  *
02508  * @deprecated Provided for backward compatibility with the 1.1 API.
02509  */
02510 typedef svn_error_t *(*svn_ra_init_func_t)(int abi_version,
02511                                            apr_pool_t *pool,
02512                                            apr_hash_t *hash);
02513 
02514 /**
02515  * The current ABI (Application Binary Interface) version for the
02516  * RA plugin model. This version number will change when the ABI
02517  * between the SVN core (e.g. libsvn_client) and the RA plugin changes.
02518  *
02519  * An RA plugin should verify that the passed version number is acceptable
02520  * before accessing the rest of the parameters, and before returning any
02521  * information.
02522  *
02523  * It is entirely acceptable for an RA plugin to accept multiple ABI
02524  * versions. It can simply interpret the parameters based on the version,
02525  * and it can return different plugin structures.
02526  *
02527  *
02528  * <pre>
02529  * VSN  DATE        REASON FOR CHANGE
02530  * ---  ----------  ------------------------------------------------
02531  *   1  2001-02-17  Initial revision.
02532  *   2  2004-06-29  Preparing for svn 1.1, which adds new RA vtable funcs.
02533  *      2005-01-19  Rework the plugin interface and don't provide the vtable
02534  *                  to the client.  Separate ABI versions are no longer used.
02535  * </pre>
02536  *
02537  * @deprecated Provided for backward compatibility with the 1.0 API.
02538  */
02539 #define SVN_RA_ABI_VERSION      2
02540 
02541 /* Public RA implementations. */
02542 
02543 /** Initialize libsvn_ra_serf.
02544  *
02545  * @deprecated Provided for backward compatibility with the 1.1 API. */
02546 SVN_DEPRECATED
02547 svn_error_t *
02548 svn_ra_dav_init(int abi_version,
02549                 apr_pool_t *pool,
02550                 apr_hash_t *hash);
02551 
02552 /** Initialize libsvn_ra_local.
02553  *
02554  * @deprecated Provided for backward compatibility with the 1.1 API. */
02555 SVN_DEPRECATED
02556 svn_error_t *
02557 svn_ra_local_init(int abi_version,
02558                   apr_pool_t *pool,
02559                   apr_hash_t *hash);
02560 
02561 /** Initialize libsvn_ra_svn.
02562  *
02563  * @deprecated Provided for backward compatibility with the 1.1 API. */
02564 SVN_DEPRECATED
02565 svn_error_t *
02566 svn_ra_svn_init(int abi_version,
02567                 apr_pool_t *pool,
02568                 apr_hash_t *hash);
02569 
02570 /** Initialize libsvn_ra_serf.
02571  *
02572  * @since New in 1.4.
02573  * @deprecated Provided for backward compatibility with the 1.1 API. */
02574 SVN_DEPRECATED
02575 svn_error_t *
02576 svn_ra_serf_init(int abi_version,
02577                  apr_pool_t *pool,
02578                  apr_hash_t *hash);
02579 
02580 
02581 /**
02582  * Initialize the compatibility wrapper, using @a pool for any allocations.
02583  * The caller must hold on to @a ra_baton as long as the RA library is used.
02584  *
02585  * @deprecated Provided for backward compatibility with the 1.1 API.
02586  */
02587 SVN_DEPRECATED
02588 svn_error_t *
02589 svn_ra_init_ra_libs(void **ra_baton,
02590                     apr_pool_t *pool);
02591 
02592 /**
02593  * Return an RA vtable-@a library which can handle URL.  A number of
02594  * svn_client_* routines will call this internally, but client apps might
02595  * use it too.  $a ra_baton is a baton obtained by a call to
02596  * svn_ra_init_ra_libs().
02597  *
02598  * @deprecated Provided for backward compatibility with the 1.1 API.
02599  */
02600 SVN_DEPRECATED
02601 svn_error_t *
02602 svn_ra_get_ra_library(svn_ra_plugin_t **library,
02603                       void *ra_baton,
02604                       const char *url,
02605                       apr_pool_t *pool);
02606 
02607 #ifdef __cplusplus
02608 }
02609 #endif /* __cplusplus */
02610 
02611 #endif  /* SVN_RA_H */
02612 

Generated on Mon Mar 17 15:45:52 2014 for Subversion by  doxygen 1.4.7