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