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