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