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