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