00001 /** 00002 * @copyright 00003 * ==================================================================== 00004 * Copyright (c) 2000-2008 CollabNet. All rights reserved. 00005 * 00006 * This software is licensed as described in the file COPYING, which 00007 * you should have received as part of this distribution. The terms 00008 * are also available at http://subversion.tigris.org/license-1.html. 00009 * If newer versions of this license are posted there, you may use a 00010 * newer version instead, at your option. 00011 * 00012 * This software consists of voluntary contributions made by many 00013 * individuals. For exact contribution history, see the revision 00014 * history and logs, available at http://subversion.tigris.org/. 00015 * ==================================================================== 00016 * @endcopyright 00017 * 00018 * @file svn_ra.h 00019 * @brief Repository Access 00020 */ 00021 00022 00023 00024 00025 #ifndef SVN_RA_H 00026 #define SVN_RA_H 00027 00028 #include <apr_pools.h> 00029 #include <apr_tables.h> 00030 00031 #include "svn_error.h" 00032 #include "svn_delta.h" 00033 #include "svn_auth.h" 00034 #include "svn_mergeinfo.h" 00035 #include "svn_types.h" 00036 00037 #ifdef __cplusplus 00038 extern "C" { 00039 #endif /* __cplusplus */ 00040 00041 00042 00043 /* Misc. declarations */ 00044 00045 /** 00046 * Get libsvn_ra version information. 00047 * 00048 * @since New in 1.1. 00049 */ 00050 const svn_version_t * 00051 svn_ra_version(void); 00052 00053 00054 /** This is a function type which allows the RA layer to fetch working 00055 * copy (WC) properties. 00056 * 00057 * The @a baton is provided along with the function pointer and should 00058 * be passed back in. This will be the @a callback_baton or the 00059 * @a close_baton as appropriate. 00060 * 00061 * @a path is relative to the "root" of the session, defined by the 00062 * @a repos_URL passed to svn_ra_open3() vtable call. 00063 * 00064 * @a name is the name of the property to fetch. If the property is present, 00065 * then it is returned in @a value. Otherwise, @a *value is set to @c NULL. 00066 */ 00067 typedef svn_error_t *(*svn_ra_get_wc_prop_func_t)(void *baton, 00068 const char *relpath, 00069 const char *name, 00070 const svn_string_t **value, 00071 apr_pool_t *pool); 00072 00073 /** This is a function type which allows the RA layer to store new 00074 * working copy properties during update-like operations. See the 00075 * comments for @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and 00076 * @a name. The @a value is the value that will be stored for the property; 00077 * a NULL @a value means the property will be deleted. 00078 */ 00079 typedef svn_error_t *(*svn_ra_set_wc_prop_func_t)(void *baton, 00080 const char *path, 00081 const char *name, 00082 const svn_string_t *value, 00083 apr_pool_t *pool); 00084 00085 /** This is a function type which allows the RA layer to store new 00086 * working copy properties as part of a commit. See the comments for 00087 * @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and @a name. 00088 * The @a value is the value that will be stored for the property; a 00089 * @c NULL @a value means the property will be deleted. 00090 * 00091 * Note that this might not actually store the new property before 00092 * returning, but instead schedule it to be changed as part of 00093 * post-commit processing (in which case a successful commit means the 00094 * properties got written). Thus, during the commit, it is possible 00095 * to invoke this function to set a new value for a wc prop, then read 00096 * the wc prop back from the working copy and get the *old* value. 00097 * Callers beware. 00098 */ 00099 typedef svn_error_t *(*svn_ra_push_wc_prop_func_t)(void *baton, 00100 const char *path, 00101 const char *name, 00102 const svn_string_t *value, 00103 apr_pool_t *pool); 00104 00105 /** This is a function type which allows the RA layer to invalidate 00106 * (i.e., remove) wcprops recursively. See the documentation for 00107 * @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and @a name. 00108 * 00109 * Unlike @c svn_ra_push_wc_prop_func_t, this has immediate effect. If 00110 * it returns success, the wcprops have been removed. 00111 */ 00112 typedef svn_error_t *(*svn_ra_invalidate_wc_props_func_t)(void *baton, 00113 const char *path, 00114 const char *name, 00115 apr_pool_t *pool); 00116 00117 00118 /** A function type for retrieving the youngest revision from a repos. */ 00119 typedef svn_error_t *(*svn_ra_get_latest_revnum_func_t) 00120 (void *session_baton, 00121 svn_revnum_t *latest_revnum); 00122 00123 /** A function type which allows the RA layer to ask about any 00124 * customizations to the client name string. This is primarily used 00125 * by HTTP-based RA layers wishing to extend the string reported to 00126 * Apache/mod_dav_svn via the User-agent HTTP header. 00127 */ 00128 typedef svn_error_t *(*svn_ra_get_client_string_func_t)(void *baton, 00129 const char **name, 00130 apr_pool_t *pool); 00131 00132 00133 /** 00134 * A callback function type for use in @c get_file_revs. 00135 * @a baton is provided by the caller, @a path is the pathname of the file 00136 * in revision @a rev and @a rev_props are the revision properties. 00137 * If @a delta_handler and @a delta_baton are non-NULL, they may be set to a 00138 * handler/baton which will be called with the delta between the previous 00139 * revision and this one after the return of this callback. They may be 00140 * left as NULL/NULL. 00141 * @a prop_diffs is an array of svn_prop_t elements indicating the property 00142 * delta for this and the previous revision. 00143 * @a pool may be used for temporary allocations, but you can't rely 00144 * on objects allocated to live outside of this particular call and the 00145 * immediately following calls to @a *delta_handler, if any. 00146 * 00147 * @since New in 1.1. 00148 */ 00149 typedef svn_error_t *(*svn_ra_file_rev_handler_t) 00150 (void *baton, 00151 const char *path, 00152 svn_revnum_t rev, 00153 apr_hash_t *rev_props, 00154 svn_txdelta_window_handler_t *delta_handler, 00155 void **delta_baton, 00156 apr_array_header_t *prop_diffs, 00157 apr_pool_t *pool); 00158 00159 /** 00160 * Callback function type for locking and unlocking actions. 00161 * 00162 * @since New in 1.2. 00163 * 00164 * @a do_lock is TRUE when locking @a path, and FALSE 00165 * otherwise. 00166 * 00167 * @a lock is a lock for @a path or NULL if @a do_lock is FALSE or @a ra_err is 00168 * non-NULL. 00169 * 00170 * @a ra_err is NULL unless the ra layer encounters a locking related 00171 * error which it passes back for notification purposes. The caller 00172 * is responsible for clearing @a ra_err after the callback is run. 00173 * 00174 * @a baton is a closure object; it should be provided by the 00175 * implementation, and passed by the caller. @a pool may be used for 00176 * temporary allocation. 00177 */ 00178 typedef svn_error_t *(*svn_ra_lock_callback_t)(void *baton, 00179 const char *path, 00180 svn_boolean_t do_lock, 00181 const svn_lock_t *lock, 00182 svn_error_t *ra_err, 00183 apr_pool_t *pool); 00184 00185 /** 00186 * Callback function type for progress notification. 00187 * 00188 * @a progress is the number of bytes already transferred, @a total is 00189 * the total number of bytes to transfer or -1 if it's not known, @a 00190 * baton is the callback baton. 00191 * 00192 * @since New in 1.3. 00193 */ 00194 typedef void (*svn_ra_progress_notify_func_t)(apr_off_t progress, 00195 apr_off_t total, 00196 void *baton, 00197 apr_pool_t *pool); 00198 00199 /** 00200 * Callback function type for replay_range actions. 00201 * 00202 * This callback function should provide replay_range with an editor which 00203 * will be driven with the received replay reports from the master repository. 00204 * 00205 * @a revision is the target revision number of the received replay report. 00206 * 00207 * @a editor and @a edit_baton should provided by the callback implementation. 00208 * 00209 * @a replay_baton is the baton as originally passed to replay_range. 00210 * 00211 * @a revprops contains key/value pairs for each revision properties for this 00212 * revision. 00213 * 00214 * @since New in 1.5. 00215 */ 00216 typedef svn_error_t *(*svn_ra_replay_revstart_callback_t) 00217 (svn_revnum_t revision, 00218 void *replay_baton, 00219 const svn_delta_editor_t **editor, 00220 void **edit_baton, 00221 apr_hash_t *rev_props, 00222 apr_pool_t *pool); 00223 00224 /** 00225 * Callback function type for replay_range actions. 00226 * 00227 * This callback function should close the editor. 00228 * 00229 * @a revision is the target revision number of the received replay report. 00230 * 00231 * @a editor and @a edit_baton should provided by the callback implementation. 00232 * 00233 * @a replay_baton is the baton as originally passed to replay_range. 00234 * 00235 * @a revprops contains key/value pairs for each revision properties for this 00236 * revision. 00237 * 00238 * @since New in 1.5. 00239 */ 00240 typedef svn_error_t *(*svn_ra_replay_revfinish_callback_t) 00241 (svn_revnum_t revision, 00242 void *replay_baton, 00243 const svn_delta_editor_t *editor, 00244 void *edit_baton, 00245 apr_hash_t *rev_props, 00246 apr_pool_t *pool); 00247 00248 00249 /** 00250 * The update Reporter. 00251 * 00252 * A vtable structure which allows a working copy to describe a subset 00253 * (or possibly all) of its working-copy to an RA layer, for the 00254 * purposes of an update, switch, status, or diff operation. 00255 * 00256 * Paths for report calls are relative to the target (not the anchor) 00257 * of the operation. Report calls must be made in depth-first order: 00258 * parents before children, all children of a parent before any 00259 * siblings of the parent. The first report call must be a set_path 00260 * with a @a path argument of "" and a valid revision. (If the target 00261 * of the operation is locally deleted or missing, use the anchor's 00262 * revision.) If the target of the operation is deleted or switched 00263 * relative to the anchor, follow up the initial set_path call with a 00264 * link_path or delete_path call with a @a path argument of "" to 00265 * indicate that. In no other case may there be two report 00266 * descriptions for the same path. If the target of the operation is 00267 * a locally added file or directory (which previously did not exist), 00268 * it may be reported as having revision 0 or as having the parent 00269 * directory's revision. 00270 * 00271 * @since New in 1.5. 00272 */ 00273 typedef struct svn_ra_reporter3_t 00274 { 00275 /** Describe a working copy @a path as being at a particular 00276 * @a revision and having depth @a depth. 00277 * 00278 * @a revision may be SVN_INVALID_REVNUM if (for example) @a path 00279 * represents a locally-added path with no revision number, or @a 00280 * depth is @c svn_depth_exclude. 00281 * 00282 * @a path may not be underneath a path on which set_path() was 00283 * previously called with @c svn_depth_exclude in this report. 00284 * 00285 * If @a start_empty is set and @a path is a directory, the 00286 * implementor should assume the directory has no entries or props. 00287 * 00288 * This will *override* any previous set_path() calls made on parent 00289 * paths. @a path is relative to the URL specified in svn_ra_open3(). 00290 * 00291 * If @a lock_token is non-NULL, it is the lock token for @a path in the WC. 00292 * 00293 * All temporary allocations are done in @a pool. 00294 */ 00295 svn_error_t *(*set_path)(void *report_baton, 00296 const char *path, 00297 svn_revnum_t revision, 00298 svn_depth_t depth, 00299 svn_boolean_t start_empty, 00300 const char *lock_token, 00301 apr_pool_t *pool); 00302 00303 /** Describing a working copy @a path as missing. 00304 * 00305 * @a path may not be underneath a path on which set_path() was 00306 * previously called with @c svn_depth_exclude in this report. 00307 * 00308 * All temporary allocations are done in @a pool. 00309 */ 00310 svn_error_t *(*delete_path)(void *report_baton, 00311 const char *path, 00312 apr_pool_t *pool); 00313 00314 /** Like set_path(), but differs in that @a path in the working copy 00315 * (relative to the root of the report driver) isn't a reflection of 00316 * @a path in the repository (relative to the URL specified when 00317 * opening the RA layer), but is instead a reflection of a different 00318 * repository @a url at @a revision, and has depth @a depth. 00319 * 00320 * @a path may not be underneath a path on which set_path() was 00321 * previously called with @c svn_depth_exclude in this report. 00322 * 00323 * If @a start_empty is set and @a path is a directory, 00324 * the implementor should assume the directory has no entries or props. 00325 * 00326 * If @a lock_token is non-NULL, it is the lock token for @a path in the WC. 00327 * 00328 * All temporary allocations are done in @a pool. 00329 */ 00330 svn_error_t *(*link_path)(void *report_baton, 00331 const char *path, 00332 const char *url, 00333 svn_revnum_t revision, 00334 svn_depth_t depth, 00335 svn_boolean_t start_empty, 00336 const char *lock_token, 00337 apr_pool_t *pool); 00338 00339 /** WC calls this when the state report is finished; any directories 00340 * or files not explicitly `set' are assumed to be at the 00341 * baseline revision originally passed into do_update(). No other 00342 * reporting functions, including abort_report, should be called after 00343 * calling this function. 00344 */ 00345 svn_error_t *(*finish_report)(void *report_baton, 00346 apr_pool_t *pool); 00347 00348 /** If an error occurs during a report, this routine should cause the 00349 * filesystem transaction to be aborted & cleaned up. No other reporting 00350 * functions should be called after calling this function. 00351 */ 00352 svn_error_t *(*abort_report)(void *report_baton, 00353 apr_pool_t *pool); 00354 00355 } svn_ra_reporter3_t; 00356 00357 /** 00358 * Similar to @c svn_ra_reporter3_t, but without support for depths. 00359 * 00360 * @deprecated Provided for backward compatibility with the 1.4 API. 00361 */ 00362 typedef struct svn_ra_reporter2_t 00363 { 00364 /** Similar to the corresponding field in @c svn_ra_reporter3_t, but 00365 * with @a depth always set to @c svn_depth_infinity. */ 00366 svn_error_t *(*set_path)(void *report_baton, 00367 const char *path, 00368 svn_revnum_t revision, 00369 svn_boolean_t start_empty, 00370 const char *lock_token, 00371 apr_pool_t *pool); 00372 00373 /** Same as the corresponding field in @c svn_ra_reporter3_t. */ 00374 svn_error_t *(*delete_path)(void *report_baton, 00375 const char *path, 00376 apr_pool_t *pool); 00377 00378 /** Similar to the corresponding field in @c svn_ra_reporter3_t, but 00379 * with @a depth always set to @c svn_depth_infinity. */ 00380 svn_error_t *(*link_path)(void *report_baton, 00381 const char *path, 00382 const char *url, 00383 svn_revnum_t revision, 00384 svn_boolean_t start_empty, 00385 const char *lock_token, 00386 apr_pool_t *pool); 00387 00388 /** Same as the corresponding field in @c svn_ra_reporter3_t. */ 00389 svn_error_t *(*finish_report)(void *report_baton, 00390 apr_pool_t *pool); 00391 00392 /** Same as the corresponding field in @c svn_ra_reporter3_t. */ 00393 svn_error_t *(*abort_report)(void *report_baton, 00394 apr_pool_t *pool); 00395 00396 } svn_ra_reporter2_t; 00397 00398 /** 00399 * Similar to @c svn_ra_reporter2_t, but without support for lock tokens. 00400 * 00401 * @deprecated Provided for backward compatibility with the 1.1 API. 00402 */ 00403 typedef struct svn_ra_reporter_t 00404 { 00405 /** Similar to the corresponding field in @c svn_ra_reporter2_t, but 00406 * with @a lock_token always set to NULL. */ 00407 svn_error_t *(*set_path)(void *report_baton, 00408 const char *path, 00409 svn_revnum_t revision, 00410 svn_boolean_t start_empty, 00411 apr_pool_t *pool); 00412 00413 /** Same as the corresponding field in @c svn_ra_reporter2_t. */ 00414 svn_error_t *(*delete_path)(void *report_baton, 00415 const char *path, 00416 apr_pool_t *pool); 00417 00418 /** Similar to the corresponding field in @c svn_ra_reporter2_t, but 00419 * with @a lock_token always set to NULL. */ 00420 svn_error_t *(*link_path)(void *report_baton, 00421 const char *path, 00422 const char *url, 00423 svn_revnum_t revision, 00424 svn_boolean_t start_empty, 00425 apr_pool_t *pool); 00426 00427 /** Same as the corresponding field in @c svn_ra_reporter2_t. */ 00428 svn_error_t *(*finish_report)(void *report_baton, 00429 apr_pool_t *pool); 00430 00431 /** Same as the corresponding field in @c svn_ra_reporter2_t. */ 00432 svn_error_t *(*abort_report)(void *report_baton, 00433 apr_pool_t *pool); 00434 } svn_ra_reporter_t; 00435 00436 00437 /** A collection of callbacks implemented by libsvn_client which allows 00438 * an RA layer to "pull" information from the client application, or 00439 * possibly store information. libsvn_client passes this vtable to 00440 * svn_ra_open3(). 00441 * 00442 * Each routine takes a @a callback_baton originally provided with the 00443 * vtable. 00444 * 00445 * Clients must use svn_ra_create_callbacks() to allocate and 00446 * initialize this structure. 00447 * 00448 * @since New in 1.3. 00449 */ 00450 typedef struct svn_ra_callbacks2_t 00451 { 00452 /** Open a unique temporary file for writing in the working copy. 00453 * This file will be automatically deleted when @a fp is closed. 00454 */ 00455 svn_error_t *(*open_tmp_file)(apr_file_t **fp, 00456 void *callback_baton, 00457 apr_pool_t *pool); 00458 00459 /** An authentication baton, created by the application, which is 00460 * capable of retrieving all known types of credentials. 00461 */ 00462 svn_auth_baton_t *auth_baton; 00463 00464 /*** The following items may be set to NULL to disallow the RA layer 00465 to perform the respective operations of the vtable functions. 00466 Perhaps WC props are not defined or are in invalid for this 00467 session, or perhaps the commit operation this RA session will 00468 perform is a server-side only one that shouldn't do post-commit 00469 processing on a working copy path. ***/ 00470 00471 /** Fetch working copy properties. 00472 * 00473 *<pre> ### we might have a problem if the RA layer ever wants a property 00474 * ### that corresponds to a different revision of the file than 00475 * ### what is in the WC. we'll cross that bridge one day...</pre> 00476 */ 00477 svn_ra_get_wc_prop_func_t get_wc_prop; 00478 00479 /** Immediately set new values for working copy properties. */ 00480 svn_ra_set_wc_prop_func_t set_wc_prop; 00481 00482 /** Schedule new values for working copy properties. */ 00483 svn_ra_push_wc_prop_func_t push_wc_prop; 00484 00485 /** Invalidate working copy properties. */ 00486 svn_ra_invalidate_wc_props_func_t invalidate_wc_props; 00487 00488 /** Notification callback used for progress information. 00489 * May be NULL if not used. 00490 */ 00491 svn_ra_progress_notify_func_t progress_func; 00492 00493 /** Notification callback baton, used with progress_func. */ 00494 void *progress_baton; 00495 00496 /** Cancelation function 00497 * 00498 * As its baton, the general callback baton is used 00499 * 00500 * @since New in 1.5 00501 */ 00502 svn_cancel_func_t cancel_func; 00503 00504 /** Client string customization callback function 00505 * @since New in 1.5 00506 */ 00507 svn_ra_get_client_string_func_t get_client_string; 00508 00509 } svn_ra_callbacks2_t; 00510 00511 /** Similar to svn_ra_callbacks2_t, except that the progress 00512 * notification function and baton is missing. 00513 * 00514 * @deprecated Provided for backward compatibility with the 1.2 API. 00515 */ 00516 typedef struct svn_ra_callbacks_t 00517 { 00518 svn_error_t *(*open_tmp_file)(apr_file_t **fp, 00519 void *callback_baton, 00520 apr_pool_t *pool); 00521 00522 svn_auth_baton_t *auth_baton; 00523 00524 svn_ra_get_wc_prop_func_t get_wc_prop; 00525 00526 svn_ra_set_wc_prop_func_t set_wc_prop; 00527 00528 svn_ra_push_wc_prop_func_t push_wc_prop; 00529 00530 svn_ra_invalidate_wc_props_func_t invalidate_wc_props; 00531 00532 } svn_ra_callbacks_t; 00533 00534 00535 00536 /*----------------------------------------------------------------------*/ 00537 00538 /* Public Interfaces. */ 00539 00540 /** 00541 * Initialize the RA library. This function must be called before using 00542 * any function in this header, except the deprecated APIs based on 00543 * @c svn_ra_plugin_t, or svn_ra_version(). This function must not be called 00544 * simultaneously in multiple threads. @a pool must live 00545 * longer than any open RA sessions. 00546 * 00547 * @since New in 1.2. 00548 */ 00549 svn_error_t * 00550 svn_ra_initialize(apr_pool_t *pool); 00551 00552 /** Initialize a callback structure. 00553 * Set @a *callbacks to a ra callbacks object, allocated in @a pool. 00554 * 00555 * Clients must use this function to allocate and initialize @c 00556 * svn_ra_callbacks2_t structures. 00557 * 00558 * @since New in 1.3. 00559 */ 00560 svn_error_t * 00561 svn_ra_create_callbacks(svn_ra_callbacks2_t **callbacks, 00562 apr_pool_t *pool); 00563 00564 /** 00565 * A repository access session. This object is used to perform requests 00566 * to a repository, identified by an URL. 00567 * 00568 * @since New in 1.2. 00569 */ 00570 typedef struct svn_ra_session_t svn_ra_session_t; 00571 00572 /** 00573 * Open a repository session to @a repos_URL. Return an opaque object 00574 * representing this session in @a *session_p, allocated in @a pool. 00575 * 00576 * Return @c SVN_ERR_RA_UUID_MISMATCH if @a uuid is non-NULL and not equal 00577 * to the UUID of the repository at @c repos_URL. 00578 * 00579 * @a callbacks/@a callback_baton is a table of callbacks provided by the 00580 * client; see @c svn_ra_callbacks2_t. 00581 * 00582 * @a config is a hash mapping <tt>const char *</tt> keys to 00583 * @c svn_config_t * values. For example, the @c svn_config_t for the 00584 * "~/.subversion/config" file is under the key "config". 00585 * 00586 * All RA requests require a session; they will continue to 00587 * use @a pool for memory allocation. 00588 * 00589 * @see svn_client_open_ra_session(). 00590 * 00591 * @since New in 1.5. 00592 */ 00593 svn_error_t * 00594 svn_ra_open3(svn_ra_session_t **session_p, 00595 const char *repos_URL, 00596 const char *uuid, 00597 const svn_ra_callbacks2_t *callbacks, 00598 void *callback_baton, 00599 apr_hash_t *config, 00600 apr_pool_t *pool); 00601 00602 /** 00603 * Similiar to svn_ra_open3(), but with @a uuid set to @c NULL. 00604 * 00605 * @since New in 1.3. 00606 * @deprecated Provided for backward compatibility with the 1.4 API. 00607 */ 00608 SVN_DEPRECATED 00609 svn_error_t * 00610 svn_ra_open2(svn_ra_session_t **session_p, 00611 const char *repos_URL, 00612 const svn_ra_callbacks2_t *callbacks, 00613 void *callback_baton, 00614 apr_hash_t *config, 00615 apr_pool_t *pool); 00616 00617 /** 00618 * @see svn_ra_open2(). 00619 * @since New in 1.2. 00620 * @deprecated Provided for backward compatibility with the 1.2 API. 00621 */ 00622 SVN_DEPRECATED 00623 svn_error_t * 00624 svn_ra_open(svn_ra_session_t **session_p, 00625 const char *repos_URL, 00626 const svn_ra_callbacks_t *callbacks, 00627 void *callback_baton, 00628 apr_hash_t *config, 00629 apr_pool_t *pool); 00630 00631 /** Change the root URL of an open @a ra_session to point to a new path in the 00632 * same repository. @a url is the new root URL. Use @a pool for 00633 * temporary allocations. 00634 * 00635 * If @a url has a different repository root than the current session 00636 * URL, return @c SVN_ERR_RA_ILLEGAL_URL. 00637 * 00638 * @since New in 1.4. 00639 */ 00640 svn_error_t * 00641 svn_ra_reparent(svn_ra_session_t *ra_session, 00642 const char *url, 00643 apr_pool_t *pool); 00644 00645 /** Set @a *url to the repository URL to which @a ra_session was 00646 * opened or most recently reparented. 00647 */ 00648 svn_error_t * 00649 svn_ra_get_session_url(svn_ra_session_t *ra_session, 00650 const char **url, 00651 apr_pool_t *pool); 00652 00653 00654 /** 00655 * Get the latest revision number from the repository of @a session. 00656 * 00657 * Use @a pool for memory allocation. 00658 * 00659 * @since New in 1.2. 00660 */ 00661 svn_error_t * 00662 svn_ra_get_latest_revnum(svn_ra_session_t *session, 00663 svn_revnum_t *latest_revnum, 00664 apr_pool_t *pool); 00665 00666 /** 00667 * Get the latest revision number at time @a tm in the repository of 00668 * @a session. 00669 * 00670 * Use @a pool for memory allocation. 00671 * 00672 * @since New in 1.2. 00673 */ 00674 svn_error_t * 00675 svn_ra_get_dated_revision(svn_ra_session_t *session, 00676 svn_revnum_t *revision, 00677 apr_time_t tm, 00678 apr_pool_t *pool); 00679 00680 /** 00681 * Set the property @a name to @a value on revision @a rev in the repository 00682 * of @a session. 00683 * 00684 * If @a value is @c NULL, delete the named revision property. 00685 * 00686 * Please note that properties attached to revisions are @em unversioned. 00687 * 00688 * Use @a pool for memory allocation. 00689 * 00690 * @since New in 1.2. 00691 */ 00692 svn_error_t * 00693 svn_ra_change_rev_prop(svn_ra_session_t *session, 00694 svn_revnum_t rev, 00695 const char *name, 00696 const svn_string_t *value, 00697 apr_pool_t *pool); 00698 00699 /** 00700 * Set @a *props to the list of unversioned properties attached to revision 00701 * @a rev in the repository of @a session. The hash maps 00702 * (<tt>const char *</tt>) names to (<tt>@c svn_string_t *</tt>) values. 00703 * 00704 * Use @a pool for memory allocation. 00705 * 00706 * @since New in 1.2. 00707 */ 00708 svn_error_t * 00709 svn_ra_rev_proplist(svn_ra_session_t *session, 00710 svn_revnum_t rev, 00711 apr_hash_t **props, 00712 apr_pool_t *pool); 00713 00714 /** 00715 * Set @a *value to the value of unversioned property @a name attached to 00716 * revision @a rev in the repository of @a session. If @a rev has no 00717 * property by that name, set @a *value to @c NULL. 00718 * 00719 * Use @a pool for memory allocation. 00720 * 00721 * @since New in 1.2. 00722 */ 00723 svn_error_t * 00724 svn_ra_rev_prop(svn_ra_session_t *session, 00725 svn_revnum_t rev, 00726 const char *name, 00727 svn_string_t **value, 00728 apr_pool_t *pool); 00729 00730 /** 00731 * Set @a *editor and @a *edit_baton to an editor for committing 00732 * changes to the repository of @a session, setting the revision 00733 * properties from @a revprop_table. The revisions being committed 00734 * against are passed to the editor functions, starting with the rev 00735 * argument to @c open_root. The path root of the commit is the @a 00736 * session's URL. 00737 * 00738 * @a revprop_table is a hash mapping <tt>const char *</tt> property 00739 * names to @c svn_string_t property values. The commit log message 00740 * is expected to be in the @c SVN_PROP_REVISION_LOG element. @a 00741 * revprop_table can not contain either of @c SVN_PROP_REVISION_DATE 00742 * or @c SVN_PROP_REVISION_AUTHOR. 00743 * 00744 * Before @c close_edit returns, but after the commit has succeeded, 00745 * it will invoke @a callback with the new revision number, the 00746 * commit date (as a <tt>const char *</tt>), commit author (as a 00747 * <tt>const char *</tt>), and @a callback_baton as arguments. If 00748 * @a callback returns an error, that error will be returned from @c 00749 * close_edit, otherwise @c close_edit will return successfully 00750 * (unless it encountered an error before invoking @a callback). 00751 * 00752 * The callback will not be called if the commit was a no-op 00753 * (i.e. nothing was committed); 00754 * 00755 * @a lock_tokens, if non-NULL, is a hash mapping <tt>const char 00756 * *</tt> paths (relative to the URL of @a session) to <tt> 00757 * const char *</tt> lock tokens. The server checks that the 00758 * correct token is provided for each committed, locked path. @a lock_tokens 00759 * must live during the whole commit operation. 00760 * 00761 * If @a keep_locks is @c TRUE, then do not release locks on 00762 * committed objects. Else, automatically release such locks. 00763 * 00764 * The caller may not perform any RA operations using @a session before 00765 * finishing the edit. 00766 * 00767 * Use @a pool for memory allocation. 00768 * 00769 * @since New in 1.5. 00770 */ 00771 svn_error_t * 00772 svn_ra_get_commit_editor3(svn_ra_session_t *session, 00773 const svn_delta_editor_t **editor, 00774 void **edit_baton, 00775 apr_hash_t *revprop_table, 00776 svn_commit_callback2_t callback, 00777 void *callback_baton, 00778 apr_hash_t *lock_tokens, 00779 svn_boolean_t keep_locks, 00780 apr_pool_t *pool); 00781 00782 /** 00783 * Same as svn_ra_get_commit_editor3(), but with @c revprop_table set 00784 * to a hash containing the @c SVN_PROP_REVISION_LOG property set 00785 * to the value of @a log_msg. 00786 * 00787 * @since New in 1.4. 00788 * 00789 * @deprecated Provided for backward compatibility with the 1.4 API. 00790 */ 00791 SVN_DEPRECATED 00792 svn_error_t * 00793 svn_ra_get_commit_editor2(svn_ra_session_t *session, 00794 const svn_delta_editor_t **editor, 00795 void **edit_baton, 00796 const char *log_msg, 00797 svn_commit_callback2_t callback, 00798 void *callback_baton, 00799 apr_hash_t *lock_tokens, 00800 svn_boolean_t keep_locks, 00801 apr_pool_t *pool); 00802 00803 /** 00804 * Same as svn_ra_get_commit_editor2(), but uses @c svn_commit_callback_t. 00805 * 00806 * @since New in 1.2. 00807 * 00808 * @deprecated Provided for backward compatibility with the 1.3 API. 00809 */ 00810 SVN_DEPRECATED 00811 svn_error_t * 00812 svn_ra_get_commit_editor(svn_ra_session_t *session, 00813 const svn_delta_editor_t **editor, 00814 void **edit_baton, 00815 const char *log_msg, 00816 svn_commit_callback_t callback, 00817 void *callback_baton, 00818 apr_hash_t *lock_tokens, 00819 svn_boolean_t keep_locks, 00820 apr_pool_t *pool); 00821 00822 /** 00823 * Fetch the contents and properties of file @a path at @a revision. 00824 * @a revision may be SVN_INVALID_REVNUM, indicating that the HEAD 00825 * revision should be used. Interpret @a path relative to the URL in 00826 * @a session. Use @a pool for all allocations. 00827 * 00828 * If @a revision is @c SVN_INVALID_REVNUM and @a fetched_rev is not 00829 * @c NULL, then set @a *fetched_rev to the actual revision that was 00830 * retrieved. 00831 * 00832 * If @a stream is non @c NULL, push the contents of the file at @a 00833 * stream, do not call svn_stream_close() when finished. 00834 * 00835 * If @a props is non @c NULL, set @a *props to contain the properties of 00836 * the file. This means @em all properties: not just ones controlled by 00837 * the user and stored in the repository fs, but non-tweakable ones 00838 * generated by the SCM system itself (e.g. 'wcprops', 'entryprops', 00839 * etc.) The keys are <tt>const char *</tt>, values are 00840 * <tt>@c svn_string_t *</tt>. 00841 * 00842 * The stream handlers for @a stream may not perform any RA 00843 * operations using @a session. 00844 * 00845 * @since New in 1.2. 00846 */ 00847 svn_error_t * 00848 svn_ra_get_file(svn_ra_session_t *session, 00849 const char *path, 00850 svn_revnum_t revision, 00851 svn_stream_t *stream, 00852 svn_revnum_t *fetched_rev, 00853 apr_hash_t **props, 00854 apr_pool_t *pool); 00855 00856 /** 00857 * If @a dirents is non @c NULL, set @a *dirents to contain all the entries 00858 * of directory @a path at @a revision. The keys of @a dirents will be 00859 * entry names (<tt>const char *</tt>), and the values dirents 00860 * (<tt>@c svn_dirent_t *</tt>). Use @a pool for all allocations. 00861 * 00862 * @a dirent_fields controls which portions of the <tt>@c svn_dirent_t</tt> 00863 * objects are filled in. To have them completely filled in just pass 00864 * @c SVN_DIRENT_ALL, otherwise pass the bitwise OR of all the @c SVN_DIRENT_ 00865 * fields you would like to have returned to you. 00866 * 00867 * @a path is interpreted relative to the URL in @a session. 00868 * 00869 * If @a revision is @c SVN_INVALID_REVNUM (meaning 'head') and 00870 * @a *fetched_rev is not @c NULL, then this function will set 00871 * @a *fetched_rev to the actual revision that was retrieved. (Some 00872 * callers want to know, and some don't.) 00873 * 00874 * If @a props is non @c NULL, set @a *props to contain the properties of 00875 * the directory. This means @em all properties: not just ones controlled by 00876 * the user and stored in the repository fs, but non-tweakable ones 00877 * generated by the SCM system itself (e.g. 'wcprops', 'entryprops', 00878 * etc.) The keys are <tt>const char *</tt>, values are 00879 * <tt>@c svn_string_t *</tt>. 00880 * 00881 * @since New in 1.4. 00882 */ 00883 svn_error_t * 00884 svn_ra_get_dir2(svn_ra_session_t *session, 00885 apr_hash_t **dirents, 00886 svn_revnum_t *fetched_rev, 00887 apr_hash_t **props, 00888 const char *path, 00889 svn_revnum_t revision, 00890 apr_uint32_t dirent_fields, 00891 apr_pool_t *pool); 00892 00893 /** 00894 * Similar to @c svn_ra_get_dir2, but with @c SVN_DIRENT_ALL for the 00895 * @a dirent_fields parameter. 00896 * 00897 * @since New in 1.2. 00898 * 00899 * @deprecated Provided for compatibility with the 1.3 API. 00900 */ 00901 SVN_DEPRECATED 00902 svn_error_t * 00903 svn_ra_get_dir(svn_ra_session_t *session, 00904 const char *path, 00905 svn_revnum_t revision, 00906 apr_hash_t **dirents, 00907 svn_revnum_t *fetched_rev, 00908 apr_hash_t **props, 00909 apr_pool_t *pool); 00910 00911 /** 00912 * Set @a *catalog to a mergeinfo catalog for the paths in @a paths. 00913 * If no mergeinfo is available, set @a *catalog to @c NULL. The 00914 * requested mergeinfo hashes are for @a paths (which are relative to 00915 * @a session's URL) in @a revision. If one of the paths does not exist 00916 * in that revision, return SVN_ERR_FS_NOT_FOUND. 00917 * 00918 * @a inherit indicates whether explicit, explicit or inherited, or 00919 * only inherited mergeinfo for @a paths is retrieved. 00920 * 00921 * If @a include_descendants is TRUE, then additionally return the 00922 * mergeinfo for any descendant of any element of @a paths which has 00923 * the @c SVN_PROP_MERGEINFO property explicitly set on it. (Note 00924 * that inheritance is only taken into account for the elements in @a 00925 * paths; descendants of the elements in @a paths which get their 00926 * mergeinfo via inheritance are not included in @a *catalog.) 00927 * 00928 * Allocate the returned values in @a pool. 00929 * 00930 * If @a revision is @c SVN_INVALID_REVNUM, it defaults to youngest. 00931 * 00932 * If the server doesn't support retrieval of mergeinfo (which can 00933 * happen even for file:// URLs, if the repository itself hasn't been 00934 * upgraded), return @c SVN_ERR_UNSUPPORTED_FEATURE in preference to 00935 * any other error that might otherwise be returned. 00936 * 00937 * @since New in 1.5. 00938 */ 00939 svn_error_t * 00940 svn_ra_get_mergeinfo(svn_ra_session_t *session, 00941 svn_mergeinfo_catalog_t *catalog, 00942 const apr_array_header_t *paths, 00943 svn_revnum_t revision, 00944 svn_mergeinfo_inheritance_t inherit, 00945 svn_boolean_t include_descendants, 00946 apr_pool_t *pool); 00947 00948 /** 00949 * Ask the RA layer to update a working copy. 00950 * 00951 * The client initially provides an @a update_editor/@a update_baton to the 00952 * RA layer; this editor contains knowledge of where the change will 00953 * begin in the working copy (when @c open_root() is called). 00954 * 00955 * In return, the client receives a @a reporter/@a report_baton. The 00956 * client then describes its working copy by making calls into the 00957 * @a reporter. 00958 * 00959 * When finished, the client calls @a reporter->finish_report(). The 00960 * RA layer then does a complete drive of @a update_editor, ending with 00961 * @a update_editor->close_edit(), to update the working copy. 00962 * 00963 * @a update_target is an optional single path component to restrict 00964 * the scope of the update to just that entry (in the directory 00965 * represented by the @a session's URL). If @a update_target is the 00966 * empty string, the entire directory is updated. 00967 * 00968 * Update the target only as deeply as @a depth indicates. 00969 * 00970 * If @a send_copyfrom_args is TRUE, then ask the server to send 00971 * copyfrom arguments to add_file() and add_directory() when possible. 00972 * (Note: this means that any subsequent txdeltas coming from the 00973 * server are presumed to apply against the copied file!) 00974 * 00975 * The working copy will be updated to @a revision_to_update_to, or the 00976 * "latest" revision if this arg is invalid. 00977 * 00978 * The caller may not perform any RA operations using @a session before 00979 * finishing the report, and may not perform any RA operations using 00980 * @a session from within the editing operations of @a update_editor. 00981 * 00982 * Use @a pool for memory allocation. 00983 * 00984 * @note The reporter provided by this function does NOT supply copy- 00985 * from information to the diff editor callbacks. 00986 * 00987 * @note In order to prevent pre-1.5 servers from doing more work than 00988 * needed, and sending too much data back, a pre-1.5 'recurse' 00989 * directive may be sent to the server, based on @a depth. 00990 * 00991 * @since New in 1.5. 00992 */ 00993 svn_error_t * 00994 svn_ra_do_update2(svn_ra_session_t *session, 00995 const svn_ra_reporter3_t **reporter, 00996 void **report_baton, 00997 svn_revnum_t revision_to_update_to, 00998 const char *update_target, 00999 svn_depth_t depth, 01000 svn_boolean_t send_copyfrom_args, 01001 const svn_delta_editor_t *update_editor, 01002 void *update_baton, 01003 apr_pool_t *pool); 01004 01005 /** 01006 * Similar to svn_ra_do_update2(), but taking @c svn_ra_reporter2_t 01007 * instead of @c svn_ra_reporter3_t; if @a recurse is true, pass @c 01008 * svn_depth_infinity for @a depth, else pass @c svn_depth_files; and 01009 * with @a send_copyfrom_args always false. 01010 * 01011 * @deprecated Provided for compatibility with the 1.4 API. 01012 */ 01013 SVN_DEPRECATED 01014 svn_error_t * 01015 svn_ra_do_update(svn_ra_session_t *session, 01016 const svn_ra_reporter2_t **reporter, 01017 void **report_baton, 01018 svn_revnum_t revision_to_update_to, 01019 const char *update_target, 01020 svn_boolean_t recurse, 01021 const svn_delta_editor_t *update_editor, 01022 void *update_baton, 01023 apr_pool_t *pool); 01024 01025 01026 /** 01027 * Ask the RA layer to 'switch' a working copy to a new 01028 * @a switch_url; it's another form of svn_ra_do_update(). 01029 * 01030 * The client initially provides a @a switch_editor/@a switch_baton to the RA 01031 * layer; this editor contains knowledge of where the change will 01032 * begin in the working copy (when open_root() is called). 01033 * 01034 * In return, the client receives a @a reporter/@a report_baton. The 01035 * client then describes its working copy by making calls into the 01036 * @a reporter. 01037 * 01038 * When finished, the client calls @a reporter->finish_report(). The 01039 * RA layer then does a complete drive of @a switch_editor, ending with 01040 * close_edit(), to switch the working copy. 01041 * 01042 * @a switch_target is an optional single path component will restrict 01043 * the scope of things affected by the switch to an entry in the 01044 * directory represented by the @a session's URL, or empty if the 01045 * entire directory is meant to be switched. 01046 * 01047 * Switch the target only as deeply as @a depth indicates. 01048 * 01049 * The working copy will be switched to @a revision_to_switch_to, or the 01050 * "latest" revision if this arg is invalid. 01051 * 01052 * The caller may not perform any RA operations using 01053 * @a session before finishing the report, and may not perform 01054 * any RA operations using @a session from within the editing 01055 * operations of @a switch_editor. 01056 * 01057 * Use @a pool for memory allocation. 01058 * 01059 * @note The reporter provided by this function does NOT supply copy- 01060 * from information to the diff editor callbacks. 01061 * 01062 * @note In order to prevent pre-1.5 servers from doing more work than 01063 * needed, and sending too much data back, a pre-1.5 'recurse' 01064 * directive may be sent to the server, based on @a depth. 01065 * 01066 * @since New in 1.5. 01067 */ 01068 svn_error_t * 01069 svn_ra_do_switch2(svn_ra_session_t *session, 01070 const svn_ra_reporter3_t **reporter, 01071 void **report_baton, 01072 svn_revnum_t revision_to_switch_to, 01073 const char *switch_target, 01074 svn_depth_t depth, 01075 const char *switch_url, 01076 const svn_delta_editor_t *switch_editor, 01077 void *switch_baton, 01078 apr_pool_t *pool); 01079 01080 /** 01081 * Similar to svn_ra_do_switch2(), but taking @c svn_ra_reporter2_t 01082 * instead of @c svn_ra_reporter3_t, and therefore only able to report 01083 * @c svn_depth_infinity for depths. The switch itself is performed 01084 * according to @a recurse: if TRUE, then use @c svn_depth_infinity 01085 * for @a depth, else use @c svn_depth_files. 01086 * 01087 * @deprecated Provided for compatibility with the 1.4 API. 01088 */ 01089 SVN_DEPRECATED 01090 svn_error_t * 01091 svn_ra_do_switch(svn_ra_session_t *session, 01092 const svn_ra_reporter2_t **reporter, 01093 void **report_baton, 01094 svn_revnum_t revision_to_switch_to, 01095 const char *switch_target, 01096 svn_boolean_t recurse, 01097 const char *switch_url, 01098 const svn_delta_editor_t *switch_editor, 01099 void *switch_baton, 01100 apr_pool_t *pool); 01101 01102 /** 01103 * Ask the RA layer to describe the status of a working copy with respect 01104 * to @a revision of the repository (or HEAD, if @a revision is invalid). 01105 * 01106 * The client initially provides a @a status_editor/@a status_baton to the RA 01107 * layer; this editor contains knowledge of where the change will 01108 * begin in the working copy (when open_root() is called). 01109 * 01110 * In return, the client receives a @a reporter/@a report_baton. The 01111 * client then describes its working copy by making calls into the 01112 * @a reporter. 01113 * 01114 * When finished, the client calls @a reporter->finish_report(). The RA 01115 * layer then does a complete drive of @a status_editor, ending with 01116 * close_edit(), to report, essentially, what would be modified in 01117 * the working copy were the client to call do_update(). 01118 * @a status_target is an optional single path component will restrict 01119 * the scope of the status report to an entry in the directory 01120 * represented by the @a session's URL, or empty if the entire directory 01121 * is meant to be examined. 01122 * 01123 * Get status only as deeply as @a depth indicates. 01124 * 01125 * The caller may not perform any RA operations using @a session 01126 * before finishing the report, and may not perform any RA operations 01127 * using @a session from within the editing operations of @a status_editor. 01128 * 01129 * Use @a pool for memory allocation. 01130 * 01131 * @note The reporter provided by this function does NOT supply copy- 01132 * from information to the diff editor callbacks. 01133 * 01134 * @note In order to prevent pre-1.5 servers from doing more work than 01135 * needed, and sending too much data back, a pre-1.5 'recurse' 01136 * directive may be sent to the server, based on @a depth. 01137 * 01138 * @since New in 1.5. 01139 */ 01140 svn_error_t * 01141 svn_ra_do_status2(svn_ra_session_t *session, 01142 const svn_ra_reporter3_t **reporter, 01143 void **report_baton, 01144 const char *status_target, 01145 svn_revnum_t revision, 01146 svn_depth_t depth, 01147 const svn_delta_editor_t *status_editor, 01148 void *status_baton, 01149 apr_pool_t *pool); 01150 01151 01152 /** 01153 * Similar to svn_ra_do_status2(), but taking @c svn_ra_reporter2_t 01154 * instead of @c svn_ra_reporter3_t, and therefore only able to report 01155 * @c svn_depth_infinity for depths. The status operation itself is 01156 * performed according to @a recurse: if TRUE, then @a depth is 01157 * @c svn_depth_infinity, else it is @c svn_depth_immediates. 01158 * 01159 * @deprecated Provided for compatibility with the 1.4 API. 01160 */ 01161 SVN_DEPRECATED 01162 svn_error_t * 01163 svn_ra_do_status(svn_ra_session_t *session, 01164 const svn_ra_reporter2_t **reporter, 01165 void **report_baton, 01166 const char *status_target, 01167 svn_revnum_t revision, 01168 svn_boolean_t recurse, 01169 const svn_delta_editor_t *status_editor, 01170 void *status_baton, 01171 apr_pool_t *pool); 01172 01173 /** 01174 * Ask the RA layer to 'diff' a working copy against @a versus_url; 01175 * it's another form of svn_ra_do_update2(). 01176 * 01177 * @note This function cannot be used to diff a single file, only a 01178 * working copy directory. See the svn_ra_do_switch2() function 01179 * for more details. 01180 * 01181 * The client initially provides a @a diff_editor/@a diff_baton to the RA 01182 * layer; this editor contains knowledge of where the common diff 01183 * root is in the working copy (when open_root() is called). 01184 * 01185 * In return, the client receives a @a reporter/@a report_baton. The 01186 * client then describes its working copy by making calls into the 01187 * @a reporter. 01188 * 01189 * When finished, the client calls @a reporter->finish_report(). The 01190 * RA layer then does a complete drive of @a diff_editor, ending with 01191 * close_edit(), to transmit the diff. 01192 * 01193 * @a diff_target is an optional single path component will restrict 01194 * the scope of the diff to an entry in the directory represented by 01195 * the @a session's URL, or empty if the entire directory is meant to be 01196 * one of the diff paths. 01197 * 01198 * The working copy will be diffed against @a versus_url as it exists 01199 * in revision @a revision, or as it is in head if @a revision is 01200 * @c SVN_INVALID_REVNUM. 01201 * 01202 * Use @a ignore_ancestry to control whether or not items being 01203 * diffed will be checked for relatedness first. Unrelated items 01204 * are typically transmitted to the editor as a deletion of one thing 01205 * and the addition of another, but if this flag is @c TRUE, 01206 * unrelated items will be diffed as if they were related. 01207 * 01208 * Diff only as deeply as @a depth indicates. 01209 * 01210 * The caller may not perform any RA operations using @a session before 01211 * finishing the report, and may not perform any RA operations using 01212 * @a session from within the editing operations of @a diff_editor. 01213 * 01214 * @a text_deltas instructs the driver of the @a diff_editor to enable 01215 * the generation of text deltas. If @a text_deltas is FALSE the window 01216 * handler returned by apply_textdelta will be called once with a NULL 01217 * @c svn_txdelta_window_t pointer. 01218 * 01219 * Use @a pool for memory allocation. 01220 * 01221 * @note The reporter provided by this function does NOT supply copy- 01222 * from information to the diff editor callbacks. 01223 * 01224 * @note In order to prevent pre-1.5 servers from doing more work than 01225 * needed, and sending too much data back, a pre-1.5 'recurse' 01226 * directive may be sent to the server, based on @a depth. 01227 * 01228 * @since New in 1.5. 01229 */ 01230 svn_error_t * 01231 svn_ra_do_diff3(svn_ra_session_t *session, 01232 const svn_ra_reporter3_t **reporter, 01233 void **report_baton, 01234 svn_revnum_t revision, 01235 const char *diff_target, 01236 svn_depth_t depth, 01237 svn_boolean_t ignore_ancestry, 01238 svn_boolean_t text_deltas, 01239 const char *versus_url, 01240 const svn_delta_editor_t *diff_editor, 01241 void *diff_baton, 01242 apr_pool_t *pool); 01243 01244 /** 01245 * Similar to svn_ra_do_diff3(), but taking @c svn_ra_reporter2_t 01246 * instead of @c svn_ra_reporter3_t, and therefore only able to report 01247 * @c svn_depth_infinity for depths. Perform the diff according to 01248 * @a recurse: if TRUE, then @a depth is @c svn_depth_infinity, else 01249 * it is @c svn_depth_files. 01250 * 01251 * @deprecated Provided for compatibility with the 1.4 API. 01252 */ 01253 SVN_DEPRECATED 01254 svn_error_t * 01255 svn_ra_do_diff2(svn_ra_session_t *session, 01256 const svn_ra_reporter2_t **reporter, 01257 void **report_baton, 01258 svn_revnum_t revision, 01259 const char *diff_target, 01260 svn_boolean_t recurse, 01261 svn_boolean_t ignore_ancestry, 01262 svn_boolean_t text_deltas, 01263 const char *versus_url, 01264 const svn_delta_editor_t *diff_editor, 01265 void *diff_baton, 01266 apr_pool_t *pool); 01267 01268 01269 /** 01270 * Similar to svn_ra_do_diff2(), but with @a text_deltas set to @c TRUE. 01271 * 01272 * @deprecated Provided for backward compatibility with the 1.3 API. 01273 */ 01274 SVN_DEPRECATED 01275 svn_error_t * 01276 svn_ra_do_diff(svn_ra_session_t *session, 01277 const svn_ra_reporter2_t **reporter, 01278 void **report_baton, 01279 svn_revnum_t revision, 01280 const char *diff_target, 01281 svn_boolean_t recurse, 01282 svn_boolean_t ignore_ancestry, 01283 const char *versus_url, 01284 const svn_delta_editor_t *diff_editor, 01285 void *diff_baton, 01286 apr_pool_t *pool); 01287 01288 /** 01289 * Invoke @a receiver with @a receiver_baton on each log message from 01290 * @a start to @a end. @a start may be greater or less than @a end; 01291 * this just controls whether the log messages are processed in descending 01292 * or ascending revision number order. 01293 * 01294 * If @a start or @a end is @c SVN_INVALID_REVNUM, it defaults to youngest. 01295 * 01296 * If @a paths is non-NULL and has one or more elements, then only show 01297 * revisions in which at least one of @a paths was changed (i.e., if 01298 * file, text or props changed; if dir, props changed or an entry 01299 * was added or deleted). Each path is an <tt>const char *</tt>, relative 01300 * to the @a session's common parent. 01301 * 01302 * If @a limit is non-zero only invoke @a receiver on the first @a limit 01303 * logs. 01304 * 01305 * If @a discover_changed_paths, then each call to receiver passes a 01306 * <tt>const apr_hash_t *</tt> for the receiver's @a changed_paths argument; 01307 * the hash's keys are all the paths committed in that revision. 01308 * Otherwise, each call to receiver passes NULL for @a changed_paths. 01309 * 01310 * If @a strict_node_history is set, copy history will not be traversed 01311 * (if any exists) when harvesting the revision logs for each path. 01312 * 01313 * If @a include_merged_revisions is set, log information for revisions 01314 * which have been merged to @a targets will also be returned. 01315 * 01316 * If @a revprops is NULL, retrieve all revprops; else, retrieve only the 01317 * revprops named in the array (i.e. retrieve none if the array is empty). 01318 * 01319 * If any invocation of @a receiver returns error, return that error 01320 * immediately and without wrapping it. 01321 * 01322 * If @a start or @a end is a non-existent revision, return the error 01323 * @c SVN_ERR_FS_NO_SUCH_REVISION, without ever invoking @a receiver. 01324 * 01325 * See also the documentation for @c svn_log_message_receiver_t. 01326 * 01327 * The caller may not invoke any RA operations using @a session from 01328 * within @a receiver. 01329 * 01330 * Use @a pool for memory allocation. 01331 * 01332 * @note If @a paths is NULL or empty, the result depends on the 01333 * server. Pre-1.5 servers will send nothing; 1.5 servers will 01334 * effectively perform the log operation on the root of the 01335 * repository. This behavior may be changed in the future to ensure 01336 * consistency across all pedigrees of server. 01337 * 01338 * @note Pre-1.5 servers do not support custom revprop retrieval; if @a 01339 * revprops is NULL or contains a revprop other than svn:author, svn:date, 01340 * or svn:log, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is returned. 01341 * 01342 * @since New in 1.5. 01343 */ 01344 01345 svn_error_t * 01346 svn_ra_get_log2(svn_ra_session_t *session, 01347 const apr_array_header_t *paths, 01348 svn_revnum_t start, 01349 svn_revnum_t end, 01350 int limit, 01351 svn_boolean_t discover_changed_paths, 01352 svn_boolean_t strict_node_history, 01353 svn_boolean_t include_merged_revisions, 01354 const apr_array_header_t *revprops, 01355 svn_log_entry_receiver_t receiver, 01356 void *receiver_baton, 01357 apr_pool_t *pool); 01358 01359 /** 01360 * Similar to svn_ra_get_log2(), but uses @c svn_log_message_receiver_t 01361 * instead of @c svn_log_entry_receiver_t. Also, @a 01362 * include_merged_revisions is set to @c FALSE and @a revprops is 01363 * svn:author, svn:date, and svn:log. 01364 * 01365 * @since New in 1.2. 01366 * @deprecated Provided for backward compatibility with the 1.4 API. 01367 */ 01368 SVN_DEPRECATED 01369 svn_error_t * 01370 svn_ra_get_log(svn_ra_session_t *session, 01371 const apr_array_header_t *paths, 01372 svn_revnum_t start, 01373 svn_revnum_t end, 01374 int limit, 01375 svn_boolean_t discover_changed_paths, 01376 svn_boolean_t strict_node_history, 01377 svn_log_message_receiver_t receiver, 01378 void *receiver_baton, 01379 apr_pool_t *pool); 01380 01381 /** 01382 * Set @a *kind to the node kind associated with @a path at @a revision. 01383 * If @a path does not exist under @a revision, set @a *kind to 01384 * @c svn_node_none. @a path is relative to the @a session's parent URL. 01385 * 01386 * Use @a pool for memory allocation. 01387 * 01388 * @since New in 1.2. 01389 */ 01390 svn_error_t * 01391 svn_ra_check_path(svn_ra_session_t *session, 01392 const char *path, 01393 svn_revnum_t revision, 01394 svn_node_kind_t *kind, 01395 apr_pool_t *pool); 01396 01397 /** 01398 * Set @a *dirent to an @c svn_dirent_t associated with @a path at @a 01399 * revision. @a path is relative to the @a session's parent's URL. 01400 * If @a path does not exist in @a revision, set @a *dirent to NULL. 01401 * 01402 * Use @a pool for memory allocation. 01403 * 01404 * @since New in 1.2. 01405 */ 01406 svn_error_t * 01407 svn_ra_stat(svn_ra_session_t *session, 01408 const char *path, 01409 svn_revnum_t revision, 01410 svn_dirent_t **dirent, 01411 apr_pool_t *pool); 01412 01413 01414 /** 01415 * Set @a *uuid to the repository's UUID, allocated in @a pool. 01416 * 01417 * @since New in 1.5. 01418 */ 01419 svn_error_t * 01420 svn_ra_get_uuid2(svn_ra_session_t *session, 01421 const char **uuid, 01422 apr_pool_t *pool); 01423 01424 /** 01425 * Similar to svn_ra_get_uuid2(), but returns the value allocated in 01426 * @a session's pool. 01427 * 01428 * @deprecated Provided for backward compatibility with the 1.4 API. 01429 * @since New in 1.2. 01430 */ 01431 SVN_DEPRECATED 01432 svn_error_t * 01433 svn_ra_get_uuid(svn_ra_session_t *session, 01434 const char **uuid, 01435 apr_pool_t *pool); 01436 01437 /** 01438 * Set @a *url to the repository's root URL, allocated in @a pool. 01439 * The value will not include a trailing '/'. The returned URL is 01440 * guaranteed to be a prefix of the @a session's URL. 01441 * 01442 * @since New in 1.5. 01443 */ 01444 svn_error_t * 01445 svn_ra_get_repos_root2(svn_ra_session_t *session, 01446 const char **url, 01447 apr_pool_t *pool); 01448 01449 01450 /** 01451 * Similar to svn_ra_get_repos_root2(), but returns the value 01452 * allocated in @a session's pool. 01453 * 01454 * @deprecated Provided for backward compatibility with the 1.4 API. 01455 * @since New in 1.2. 01456 */ 01457 SVN_DEPRECATED 01458 svn_error_t * 01459 svn_ra_get_repos_root(svn_ra_session_t *session, 01460 const char **url, 01461 apr_pool_t *pool); 01462 01463 /** 01464 * Set @a *locations to the locations (at the repository revisions 01465 * @a location_revisions) of the file identified by @a path in 01466 * @a peg_revision. @a path is relative to the URL to which 01467 * @a session was opened. @a location_revisions is an array of 01468 * @c svn_revnum_t's. @a *locations will be a mapping from the revisions to 01469 * their appropriate absolute paths. If the file doesn't exist in a 01470 * location_revision, that revision will be ignored. 01471 * 01472 * Use @a pool for all allocations. 01473 * 01474 * @since New in 1.2. 01475 */ 01476 svn_error_t * 01477 svn_ra_get_locations(svn_ra_session_t *session, 01478 apr_hash_t **locations, 01479 const char *path, 01480 svn_revnum_t peg_revision, 01481 apr_array_header_t *location_revisions, 01482 apr_pool_t *pool); 01483 01484 01485 /** 01486 * Call @a receiver (with @a receiver_baton) for each segment in the 01487 * location history of @a path in @a peg_revision, working backwards in 01488 * time from @a start_rev to @a end_rev. 01489 * 01490 * @a end_rev may be @c SVN_INVALID_REVNUM to indicate that you want 01491 * to trace the history of the object to its origin. 01492 * 01493 * @a start_rev may be @c SVN_INVALID_REVNUM to indicate "the HEAD 01494 * revision". Otherwise, @a start_rev must be younger than @a end_rev 01495 * (unless @a end_rev is @c SVN_INVALID_REVNUM). 01496 * 01497 * @a peg_revision may be @c SVN_INVALID_REVNUM to indicate "the HEAD 01498 * revision", and must evaluate to be at least as young as @a start_rev. 01499 * 01500 * Use @a pool for all allocations. 01501 * 01502 * @since New in 1.5. 01503 */ 01504 svn_error_t * 01505 svn_ra_get_location_segments(svn_ra_session_t *session, 01506 const char *path, 01507 svn_revnum_t peg_revision, 01508 svn_revnum_t start_rev, 01509 svn_revnum_t end_rev, 01510 svn_location_segment_receiver_t receiver, 01511 void *receiver_baton, 01512 apr_pool_t *pool); 01513 01514 /** 01515 * Retrieve a subset of the interesting revisions of a file @a path 01516 * as seen in revision @a end (see svn_fs_history_prev() for a 01517 * definition of "interesting revisions"). Invoke @a handler with 01518 * @a handler_baton as its first argument for each such revision. 01519 * @a session is an open RA session. Use @a pool for all allocations. 01520 * 01521 * If there is an interesting revision of the file that is less than or 01522 * equal to @a start, the iteration will begin at that revision. 01523 * Else, the iteration will begin at the first revision of the file in 01524 * the repository, which has to be less than or equal to @a end. Note 01525 * that if the function succeeds, @a handler will have been called at 01526 * least once. 01527 * 01528 * In a series of calls to @a handler, the file contents for the first 01529 * interesting revision will be provided as a text delta against the 01530 * empty file. In the following calls, the delta will be against the 01531 * fulltext contents for the previous call. 01532 * 01533 * If @a include_merged_revisions is TRUE, revisions which a included as a 01534 * result of a merge between @a start and @a end will be included. 01535 * 01536 * @note This functionality is not available in pre-1.1 servers. If the 01537 * server doesn't implement it, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is 01538 * returned. 01539 * 01540 * @since New in 1.5. 01541 */ 01542 svn_error_t * 01543 svn_ra_get_file_revs2(svn_ra_session_t *session, 01544 const char *path, 01545 svn_revnum_t start, 01546 svn_revnum_t end, 01547 svn_boolean_t include_merged_revisions, 01548 svn_file_rev_handler_t handler, 01549 void *handler_baton, 01550 apr_pool_t *pool); 01551 01552 /** 01553 * Similiar to svn_ra_get_file_revs2(), but with @a include_merged_revisions 01554 * set to FALSE. 01555 * 01556 * @since New in 1.2. 01557 * @deprecated Provided for backward compatibility with the 1.4 API. 01558 */ 01559 SVN_DEPRECATED 01560 svn_error_t * 01561 svn_ra_get_file_revs(svn_ra_session_t *session, 01562 const char *path, 01563 svn_revnum_t start, 01564 svn_revnum_t end, 01565 svn_ra_file_rev_handler_t handler, 01566 void *handler_baton, 01567 apr_pool_t *pool); 01568 01569 /** 01570 * Lock each path in @a path_revs, which is a hash whose keys are the 01571 * paths to be locked, and whose values are the corresponding base 01572 * revisions for each path. 01573 * 01574 * Note that locking is never anonymous, so any server implementing 01575 * this function will have to "pull" a username from the client, if 01576 * it hasn't done so already. 01577 * 01578 * @a comment is optional: it's either an xml-escapable string 01579 * which describes the lock, or it is NULL. 01580 * 01581 * If any path is already locked by a different user, then call @a 01582 * lock_func/@a lock_baton with an error. If @a steal_lock is TRUE, 01583 * then "steal" the existing lock(s) anyway, even if the RA username 01584 * does not match the current lock's owner. Delete any lock on the 01585 * path, and unconditionally create a new lock. 01586 * 01587 * For each path, if its base revision (in @a path_revs) is a valid 01588 * revnum, then do an out-of-dateness check. If the revnum is less 01589 * than the last-changed-revision of any path (or if a path doesn't 01590 * exist in HEAD), call @a lock_func/@a lock_baton with an 01591 * SVN_ERR_RA_OUT_OF_DATE error. 01592 * 01593 * After successfully locking a file, @a lock_func is called with the 01594 * @a lock_baton. 01595 * 01596 * Use @a pool for temporary allocations. 01597 * 01598 * @since New in 1.2. 01599 */ 01600 svn_error_t * 01601 svn_ra_lock(svn_ra_session_t *session, 01602 apr_hash_t *path_revs, 01603 const char *comment, 01604 svn_boolean_t steal_lock, 01605 svn_ra_lock_callback_t lock_func, 01606 void *lock_baton, 01607 apr_pool_t *pool); 01608 01609 /** 01610 * Remove the repository lock for each path in @a path_tokens. 01611 * @a path_tokens is a hash whose keys are the paths to be locked, and 01612 * whose values are the corresponding lock tokens for each path. If 01613 * the path has no corresponding lock token, or if @a break_lock is TRUE, 01614 * then the corresponding value shall be "". 01615 * 01616 * Note that unlocking is never anonymous, so any server 01617 * implementing this function will have to "pull" a username from 01618 * the client, if it hasn't done so already. 01619 * 01620 * If @a token points to a lock, but the RA username doesn't match the 01621 * lock's owner, call @a lock_func/@a lock_baton with an error. If @a 01622 * break_lock is TRUE, however, instead allow the lock to be "broken" 01623 * by the RA user. 01624 * 01625 * After successfully unlocking a path, @a lock_func is called with 01626 * the @a lock_baton. 01627 * 01628 * Use @a pool for temporary allocations. 01629 * 01630 * @since New in 1.2. 01631 */ 01632 svn_error_t * 01633 svn_ra_unlock(svn_ra_session_t *session, 01634 apr_hash_t *path_tokens, 01635 svn_boolean_t break_lock, 01636 svn_ra_lock_callback_t lock_func, 01637 void *lock_baton, 01638 apr_pool_t *pool); 01639 01640 /** 01641 * If @a path is locked, set @a *lock to an svn_lock_t which 01642 * represents the lock, allocated in @a pool. If @a path is not 01643 * locked, set @a *lock to NULL. 01644 * 01645 * @since New in 1.2. 01646 */ 01647 svn_error_t * 01648 svn_ra_get_lock(svn_ra_session_t *session, 01649 svn_lock_t **lock, 01650 const char *path, 01651 apr_pool_t *pool); 01652 01653 /** 01654 * Set @a *locks to a hashtable which represents all locks on or 01655 * below @a path. 01656 * 01657 * The hashtable maps (const char *) absolute fs paths to (const 01658 * svn_lock_t *) structures. The hashtable -- and all keys and 01659 * values -- are allocated in @a pool. 01660 * 01661 * @note It is not considered an error for @a path to not exist in HEAD. 01662 * Such a search will simply return no locks. 01663 * 01664 * @note This functionality is not available in pre-1.2 servers. If the 01665 * server doesn't implement it, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is 01666 * returned. 01667 * 01668 * @since New in 1.2. 01669 */ 01670 svn_error_t * 01671 svn_ra_get_locks(svn_ra_session_t *session, 01672 apr_hash_t **locks, 01673 const char *path, 01674 apr_pool_t *pool); 01675 01676 01677 /** 01678 * Replay the changes from a range of revisions between @a start_revision 01679 * and @a end_revision. 01680 * 01681 * When receiving information for one revision, a callback @a revstart_func is 01682 * called; this callback will provide an editor and baton through which the 01683 * revision will be replayed. 01684 * When replaying the revision is finished, callback @a revfinish_func will be 01685 * called so the editor can be closed. 01686 * 01687 * Changes will be limited to those that occur under @a session's URL, and 01688 * the server will assume that the client has no knowledge of revisions 01689 * prior to @a low_water_mark. These two limiting factors define the portion 01690 * of the tree that the server will assume the client already has knowledge of, 01691 * and thus any copies of data from outside that part of the tree will be 01692 * sent in their entirety, not as simple copies or deltas against a previous 01693 * version. 01694 * 01695 * If @a send_deltas is @c TRUE, the actual text and property changes in 01696 * the revision will be sent, otherwise dummy text deltas and NULL property 01697 * changes will be sent instead. 01698 * 01699 * @a pool is used for all allocation. 01700 * 01701 * @since New in 1.5. 01702 */ 01703 svn_error_t * 01704 svn_ra_replay_range(svn_ra_session_t *session, 01705 svn_revnum_t start_revision, 01706 svn_revnum_t end_revision, 01707 svn_revnum_t low_water_mark, 01708