00001 /** 00002 * @copyright 00003 * ==================================================================== 00004 * Copyright (c) 2000-2006 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_repos.h 00019 * @brief tools built on top of the filesystem. 00020 */ 00021 00022 00023 #ifndef SVN_REPOS_H 00024 #define SVN_REPOS_H 00025 00026 #include <apr_pools.h> 00027 #include <apr_hash.h> 00028 #include "svn_fs.h" 00029 #include "svn_delta.h" 00030 #include "svn_types.h" 00031 #include "svn_error.h" 00032 #include "svn_version.h" 00033 00034 00035 #ifdef __cplusplus 00036 extern "C" { 00037 #endif /* __cplusplus */ 00038 00039 /* ---------------------------------------------------------------*/ 00040 00041 /** 00042 * Get libsvn_repos version information. 00043 * 00044 * @since New in 1.1. 00045 */ 00046 const svn_version_t *svn_repos_version(void); 00047 00048 00049 00050 /** Callback type for checking authorization on paths produced by (at 00051 * least) svn_repos_dir_delta(). 00052 * 00053 * Set @a *allowed to TRUE to indicate that some operation is 00054 * authorized for @a path in @a root, or set it to FALSE to indicate 00055 * unauthorized (presumably according to state stored in @a baton). 00056 * 00057 * Do not assume @a pool has any lifetime beyond this call. 00058 * 00059 * The exact operation being authorized depends on the callback 00060 * implementation. For read authorization, for example, the caller 00061 * would implement an instance that does read checking, and pass it as 00062 * a parameter named [perhaps] 'authz_read_func'. The receiver of 00063 * that parameter might also take another parameter named 00064 * 'authz_write_func', which although sharing this type, would be a 00065 * different implementation. 00066 * 00067 * @note If someday we want more sophisticated authorization states 00068 * than just yes/no, @a allowed can become an enum type. 00069 */ 00070 typedef svn_error_t *(*svn_repos_authz_func_t)(svn_boolean_t *allowed, 00071 svn_fs_root_t *root, 00072 const char *path, 00073 void *baton, 00074 apr_pool_t *pool); 00075 00076 00077 /** An enum defining the kinds of access authz looks up. 00078 * 00079 * @since New in 1.3. 00080 */ 00081 typedef enum 00082 { 00083 /** No access. */ 00084 svn_authz_none = 0, 00085 00086 /** Path can be read. */ 00087 svn_authz_read = 1, 00088 00089 /** Path can be altered. */ 00090 svn_authz_write = 2, 00091 00092 /** The other access credentials are recursive. */ 00093 svn_authz_recursive = 4 00094 } svn_repos_authz_access_t; 00095 00096 00097 /** Callback type for checking authorization on paths produced by 00098 * the repository commit editor. 00099 * 00100 * Set @a *allowed to TRUE to indicate that the @a required access on 00101 * @a path in @a root is authorized, or set it to FALSE to indicate 00102 * unauthorized (presumable according to state stored in @a baton). 00103 * 00104 * If @a path is NULL, the callback should perform a global authz 00105 * lookup for the @a required access. That is, the lookup should 00106 * check if the @a required access is granted for at least one path of 00107 * the repository, and set @a *allowed to TRUE if so. @a root may 00108 * also be NULL if @a path is NULL. 00109 * 00110 * This callback is very similar to svn_repos_authz_func_t, with the 00111 * exception of the addition of the @a required parameter. 00112 * This is due to historical reasons: when authz was first implemented 00113 * for svn_repos_dir_delta(), it seemed there would need only checks 00114 * for read and write operations, hence the svn_repos_authz_func_t 00115 * callback prototype and usage scenario. But it was then realized 00116 * that lookups due to copying needed to be recursive, and that 00117 * brute-force recursive lookups didn't square with the O(1) 00118 * performances a copy operation should have. 00119 * 00120 * So a special way to ask for a recursive lookup was introduced. The 00121 * commit editor needs this capability to retain acceptable 00122 * performance. Instead of revving the existing callback, causing 00123 * unnecessary revving of functions that don't actually need the 00124 * extended functionality, this second, more complete callback was 00125 * introduced, for use by the commit editor. 00126 * 00127 * Some day, it would be nice to reunite these two callbacks and do 00128 * the necessary revving anyway, but for the time being, this dual 00129 * callback mechanism will do. 00130 */ 00131 typedef svn_error_t *(*svn_repos_authz_callback_t) 00132 (svn_repos_authz_access_t required, 00133 svn_boolean_t *allowed, 00134 svn_fs_root_t *root, 00135 const char *path, 00136 void *baton, 00137 apr_pool_t *pool); 00138 00139 /** 00140 * A callback function type for use in svn_repos_get_file_revs(). 00141 * @a baton is provided by the caller, @a path is the pathname of the file 00142 * in revision @a rev and @a rev_props are the revision properties. 00143 * If @a delta_handler and @a delta_baton are non-NULL, they may be set to a 00144 * handler/baton which will be called with the delta between the previous 00145 * revision and this one after the return of this callback. They may be 00146 * left as NULL/NULL. 00147 * @a prop_diffs is an array of svn_prop_t elements indicating the property 00148 * delta for this and the previous revision. 00149 * @a pool may be used for temporary allocations, but you can't rely 00150 * on objects allocated to live outside of this particular call and the 00151 * immediately following calls to @a *delta_handler if any. 00152 * 00153 * @since New in 1.1. 00154 */ 00155 typedef svn_error_t *(*svn_repos_file_rev_handler_t) 00156 (void *baton, 00157 const char *path, 00158 svn_revnum_t rev, 00159 apr_hash_t *rev_props, 00160 svn_txdelta_window_handler_t *delta_handler, 00161 void **delta_baton, 00162 apr_array_header_t *prop_diffs, 00163 apr_pool_t *pool); 00164 00165 00166 /** The repository object. */ 00167 typedef struct svn_repos_t svn_repos_t; 00168 00169 /* Opening and creating repositories. */ 00170 00171 00172 /** Find the root path of the repository that contains @a path. 00173 * 00174 * If a repository was found, the path to the root of the repository 00175 * is returned, else @c NULL. The pointer to the returned path may be 00176 * equal to @a path. 00177 */ 00178 const char *svn_repos_find_root_path(const char *path, 00179 apr_pool_t *pool); 00180 00181 /** Set @a *repos_p to a repository object for the repository at @a path. 00182 * 00183 * Allocate @a *repos_p in @a pool. 00184 * 00185 * Acquires a shared lock on the repository, and attaches a cleanup 00186 * function to @a pool to remove the lock. If no lock can be acquired, 00187 * returns error, with undefined effect on @a *repos_p. If an exclusive 00188 * lock is present, this blocks until it's gone. 00189 */ 00190 svn_error_t *svn_repos_open(svn_repos_t **repos_p, 00191 const char *path, 00192 apr_pool_t *pool); 00193 00194 /** Create a new Subversion repository at @a path, building the necessary 00195 * directory structure, creating the filesystem, and so on. 00196 * Return the repository object in @a *repos_p, allocated in @a pool. 00197 * 00198 * @a config is a client configuration hash of @c svn_config_t * items 00199 * keyed on config category names, and may be NULL. 00200 * 00201 * @a fs_config is passed to the filesystem, and may be NULL. 00202 * 00203 * @a unused_1 and @a unused_2 are not used and should be NULL. 00204 */ 00205 svn_error_t *svn_repos_create(svn_repos_t **repos_p, 00206 const char *path, 00207 const char *unused_1, 00208 const char *unused_2, 00209 apr_hash_t *config, 00210 apr_hash_t *fs_config, 00211 apr_pool_t *pool); 00212 00213 /** Destroy the Subversion repository found at @a path, using @a pool for any 00214 * necessary allocations. 00215 */ 00216 svn_error_t *svn_repos_delete(const char *path, apr_pool_t *pool); 00217 00218 /** Return the filesystem associated with repository object @a repos. */ 00219 svn_fs_t *svn_repos_fs(svn_repos_t *repos); 00220 00221 00222 /** Make a hot copy of the Subversion repository found at @a src_path 00223 * to @a dst_path. 00224 * 00225 * Copy a possibly live Subversion repository from @a src_path to 00226 * @a dst_path. If @a clean_logs is @c TRUE, perform cleanup on the 00227 * source filesystem as part of the copy operation; currently, this 00228 * means deleting copied, unused logfiles for a Berkeley DB source 00229 * repository. 00230 */ 00231 svn_error_t * svn_repos_hotcopy(const char *src_path, 00232 const char *dst_path, 00233 svn_boolean_t clean_logs, 00234 apr_pool_t *pool); 00235 00236 /** 00237 * Run database recovery procedures on the repository at @a path, 00238 * returning the database to a consistent state. Use @a pool for all 00239 * allocation. 00240 * 00241 * Acquires an exclusive lock on the repository, recovers the 00242 * database, and releases the lock. If an exclusive lock can't be 00243 * acquired, returns error. 00244 * 00245 * @deprecated Provided for backward compatibility with the 1.0 API. 00246 */ 00247 svn_error_t *svn_repos_recover(const char *path, apr_pool_t *pool); 00248 00249 /** 00250 * Run database recovery procedures on the repository at @a path, 00251 * returning the database to a consistent state. Use @a pool for all 00252 * allocation. 00253 * 00254 * Acquires an exclusive lock on the repository, recovers the 00255 * database, and releases the lock. If an exclusive lock can't be 00256 * acquired, returns error. 00257 * 00258 * If @a nonblocking is TRUE, an error of type EWOULDBLOCK is 00259 * returned if the lock is not immediately available. 00260 * 00261 * If @a start_callback is not NULL, it will be called with @a 00262 * start_callback_baton as argument before the recovery starts, but 00263 * after the exclusive lock has been acquired. 00264 * 00265 * @since New in 1.1. 00266 */ 00267 svn_error_t *svn_repos_recover2(const char *path, 00268 svn_boolean_t nonblocking, 00269 svn_error_t *(*start_callback)(void *baton), 00270 void *start_callback_baton, 00271 apr_pool_t *pool); 00272 00273 /** This function is a wrapper around svn_fs_berkeley_logfiles(), 00274 * returning log file paths relative to the root of the repository. 00275 * 00276 * @copydoc svn_fs_berkeley_logfiles() 00277 */ 00278 svn_error_t *svn_repos_db_logfiles(apr_array_header_t **logfiles, 00279 const char *path, 00280 svn_boolean_t only_unused, 00281 apr_pool_t *pool); 00282 00283 00284 00285 /* Repository Paths */ 00286 00287 /** Return the top-level repository path allocated in @a pool. */ 00288 const char *svn_repos_path(svn_repos_t *repos, apr_pool_t *pool); 00289 00290 /** Return the path to @a repos's filesystem directory, allocated in 00291 * @a pool. 00292 */ 00293 const char *svn_repos_db_env(svn_repos_t *repos, apr_pool_t *pool); 00294 00295 /** Return path to @a repos's config directory, allocated in @a pool. */ 00296 const char *svn_repos_conf_dir(svn_repos_t *repos, apr_pool_t *pool); 00297 00298 /** Return path to @a repos's svnserve.conf, allocated in @a pool. */ 00299 const char *svn_repos_svnserve_conf(svn_repos_t *repos, apr_pool_t *pool); 00300 00301 /** Return path to @a repos's lock directory, allocated in @a pool. */ 00302 const char *svn_repos_lock_dir(svn_repos_t *repos, apr_pool_t *pool); 00303 00304 /** Return path to @a repos's db lockfile, allocated in @a pool. */ 00305 const char *svn_repos_db_lockfile(svn_repos_t *repos, apr_pool_t *pool); 00306 00307 /** Return path to @a repos's db logs lockfile, allocated in @a pool. */ 00308 const char *svn_repos_db_logs_lockfile(svn_repos_t *repos, apr_pool_t *pool); 00309 00310 /** Return the path to @a repos's hook directory, allocated in @a pool. */ 00311 const char *svn_repos_hook_dir(svn_repos_t *repos, apr_pool_t *pool); 00312 00313 /** Return the path to @a repos's start-commit hook, allocated in @a pool. */ 00314 const char *svn_repos_start_commit_hook(svn_repos_t *repos, apr_pool_t *pool); 00315 00316 /** Return the path to @a repos's pre-commit hook, allocated in @a pool. */ 00317 const char *svn_repos_pre_commit_hook(svn_repos_t *repos, apr_pool_t *pool); 00318 00319 /** Return the path to @a repos's post-commit hook, allocated in @a pool. */ 00320 const char *svn_repos_post_commit_hook(svn_repos_t *repos, apr_pool_t *pool); 00321 00322 /** Return the path to @a repos's pre-revprop-change hook, allocated in 00323 * @a pool. 00324 */ 00325 const char *svn_repos_pre_revprop_change_hook(svn_repos_t *repos, 00326 apr_pool_t *pool); 00327 00328 /** Return the path to @a repos's post-revprop-change hook, allocated in 00329 * @a pool. 00330 */ 00331 const char *svn_repos_post_revprop_change_hook(svn_repos_t *repos, 00332 apr_pool_t *pool); 00333 00334 00335 /** @defgroup svn_repos_lock_hooks paths to lock hooks 00336 * @{ 00337 * @since New in 1.2. */ 00338 00339 /** Return the path to @a repos's pre-lock hook, allocated in @a pool. */ 00340 const char *svn_repos_pre_lock_hook(svn_repos_t *repos, apr_pool_t *pool); 00341 00342 /** Return the path to @a repos's post-lock hook, allocated in @a pool. */ 00343 const char *svn_repos_post_lock_hook(svn_repos_t *repos, apr_pool_t *pool); 00344 00345 /** Return the path to @a repos's pre-unlock hook, allocated in @a pool. */ 00346 const char *svn_repos_pre_unlock_hook(svn_repos_t *repos, apr_pool_t *pool); 00347 00348 /** Return the path to @a repos's post-unlock hook, allocated in @a pool. */ 00349 const char *svn_repos_post_unlock_hook(svn_repos_t *repos, apr_pool_t *pool); 00350 00351 /** @} */ 00352 00353 /* ---------------------------------------------------------------*/ 00354 00355 /* Reporting the state of a working copy, for updates. */ 00356 00357 00358 /** 00359 * Construct and return a @a report_baton that will be passed to the 00360 * other functions in this section to describe the state of a pre-existing 00361 * tree (typically, a working copy). When the report is finished, 00362 * @a editor/@a edit_baton will be driven in such a way as to transform the 00363 * existing tree to @a revnum and, if @a tgt_path is non-NULL, switch the 00364 * reported hierarchy to @a tgt_path. 00365 * 00366 * @a fs_base is the absolute path of the node in the filesystem at which 00367 * the comparison should be rooted. @a target is a single path component, 00368 * used to limit the scope of the report to a single entry of @a fs_base, 00369 * or "" if all of @a fs_base itself is the main subject of the report. 00370 * 00371 * @a tgt_path and @a revnum is the fs path/revision pair that is the 00372 * "target" of the delta. @a tgt_path should be provided only when 00373 * the source and target paths of the report differ. That is, @a tgt_path 00374 * should *only* be specified when specifying that the resultant editor 00375 * drive be one that transforms the reported hierarchy into a pristine tree 00376 * of @a tgt_path at revision @a revnum. A @c NULL value for @a tgt_path 00377 * will indicate that the editor should be driven in such a way as to 00378 * transform the reported hierarchy to revision @a revnum, preserving the 00379 * reported hierarchy. 00380 * 00381 * @a text_deltas instructs the driver of the @a editor to enable 00382 * the generation of text deltas. 00383 * 00384 * @a recurse instructs the driver of the @a editor to send a recursive 00385 * delta (or not.) 00386 * 00387 * @a ignore_ancestry instructs the driver to ignore node ancestry 00388 * when determining how to transmit differences. 00389 * 00390 * The @a authz_read_func and @a authz_read_baton are passed along to 00391 * svn_repos_dir_delta(); see that function for how they are used. 00392 * 00393 * All allocation for the context and collected state will occur in 00394 * @a pool. 00395 * 00396 * @note @a username isn't used and should be removed if this function is 00397 * revised. 00398 */ 00399 svn_error_t * 00400 svn_repos_begin_report(void **report_baton, 00401 svn_revnum_t revnum, 00402 const char *username, 00403 svn_repos_t *repos, 00404 const char *fs_base, 00405 const char *target, 00406 const char *tgt_path, 00407 svn_boolean_t text_deltas, 00408 svn_boolean_t recurse, 00409 svn_boolean_t ignore_ancestry, 00410 const svn_delta_editor_t *editor, 00411 void *edit_baton, 00412 svn_repos_authz_func_t authz_read_func, 00413 void *authz_read_baton, 00414 apr_pool_t *pool); 00415 00416 /** 00417 * Given a @a report_baton constructed by svn_repos_begin_report(), 00418 * record the presence of @a path at @a revision in the current tree. 00419 * 00420 * @a path is relative to the anchor/target used in the creation of the 00421 * @a report_baton. 00422 * 00423 * @a revision may be SVN_INVALID_REVNUM if (for example) @a path represents 00424 * a locally-added path with no revision number. 00425 * 00426 * The first call of this in a given report usually passes an empty 00427 * @a path; this is used to set up the correct root revision for the editor 00428 * drive. 00429 * 00430 * If @a start_empty is true and @a path is a directory, then require the 00431 * caller to explicitly provide all the children of @path - do not assume 00432 * that the tree also contains all the children of @a path at @a revision. 00433 * This is for 'low confidence' client reporting. 00434 * 00435 * If the caller has a lock token for @a path, then @a lock_token should 00436 * be set to that token. Else, @a lock_token should be NULL. 00437 * 00438 * All temporary allocations are done in @a pool. 00439 * 00440 * @since New in 1.2. 00441 */ 00442 svn_error_t *svn_repos_set_path2(void *report_baton, 00443 const char *path, 00444 svn_revnum_t revision, 00445 svn_boolean_t start_empty, 00446 const char *lock_token, 00447 apr_pool_t *pool); 00448 00449 /** 00450 * Similar to svn_repos_set_path2(), but with @a lock_token set to @c NULL. 00451 * 00452 * @deprecated Provided for backward compatibility with the 1.1 API. 00453 */ 00454 svn_error_t *svn_repos_set_path(void *report_baton, 00455 const char *path, 00456 svn_revnum_t revision, 00457 svn_boolean_t start_empty, 00458 apr_pool_t *pool); 00459 00460 /** 00461 * Given a @a report_baton constructed by svn_repos_begin_report(), 00462 * record the presence of @path in the current tree, containing the contents 00463 * of @a link_path at @a revision. 00464 * 00465 * Note that while @a path is relative to the anchor/target used in the 00466 * creation of the @a report_baton, @a link_path is an absolute filesystem 00467 * path! 00468 * 00469 * If @a start_empty is true and @a path is a directory, then require the 00470 * caller to explicitly provide all the children of @path - do not assume 00471 * that the tree also contains all the children of @a link_path at 00472 * @a revision. This is for 'low confidence' client reporting. 00473 * 00474 * If the caller has a lock token for @a link_path, then @a lock_token 00475 * should be set to that token. Else, @a lock_token should be NULL. 00476 * 00477 * All temporary allocations are done in @a pool. 00478 * 00479 * @since New in 1.2. 00480 */ 00481 svn_error_t *svn_repos_link_path2(void *report_baton, 00482 const char *path, 00483 const char *link_path, 00484 svn_revnum_t revision, 00485 svn_boolean_t start_empty, 00486 const char *lock_token, 00487 apr_pool_t *pool); 00488 00489 /** 00490 * Similar to svn_repos_link_path2(), but with @a lock_token set to @c NULL. 00491 * 00492 * @deprecated Provided for backward compatibility with the 1.1 API. 00493 */ 00494 svn_error_t *svn_repos_link_path(void *report_baton, 00495 const char *path, 00496 const char *link_path, 00497 svn_revnum_t revision, 00498 svn_boolean_t start_empty, 00499 apr_pool_t *pool); 00500 00501 /** Given a @a report_baton constructed by svn_repos_begin_report(), 00502 * record the non-existence of @a path in the current tree. 00503 * 00504 * (This allows the reporter's driver to describe missing pieces of a 00505 * working copy, so that 'svn up' can recreate them.) 00506 * 00507 * All temporary allocations are done in @a pool. 00508 */ 00509 svn_error_t *svn_repos_delete_path(void *report_baton, 00510 const char *path, 00511 apr_pool_t *pool); 00512 00513 /** Given a @a report_baton constructed by svn_repos_begin_report(), 00514 * finish the report and drive the editor as specified when the report 00515 * baton was constructed. 00516 * 00517 * If an error occurs during the driving of the editor, do NOT abort the 00518 * edit; that responsibility belongs to the caller of this function, if 00519 * it happens at all. 00520 * 00521 * After the call to this function, @a report_baton is no longer valid; 00522 * it should not be passed to any other reporting functions, including 00523 * svn_repos_abort_report(). 00524 */ 00525 svn_error_t *svn_repos_finish_report(void *report_baton, 00526 apr_pool_t *pool); 00527 00528 00529 /** Given a @a report_baton constructed by svn_repos_begin_report(), 00530 * abort the report. This function can be called anytime before 00531 * svn_repos_finish_report() is called. 00532 * 00533 * After the call to this function, @a report_baton is no longer valid; 00534 * it should not be passed to any other reporting functions. 00535 */ 00536 svn_error_t *svn_repos_abort_report(void *report_baton, 00537 apr_pool_t *pool); 00538 00539 00540 /* ---------------------------------------------------------------*/ 00541 00542 /* The magical dir_delta update routines. */ 00543 00544 /** Use the provided @a editor and @a edit_baton to describe the changes 00545 * necessary for making a given node (and its descendants, if it is a 00546 * directory) under @a src_root look exactly like @a tgt_path under 00547 * @a tgt_root. @a src_entry is the node to update. If @a src_entry 00548 * is empty, then compute the difference between the entire tree 00549 * anchored at @a src_parent_dir under @a src_root and @a tgt_path 00550 * under @a target_root. Else, describe the changes needed to update 00551 * only that entry in @a src_parent_dir. Typically, callers of this 00552 * function will use a @a tgt_path that is the concatenation of @a 00553 * src_parent_dir and @a src_entry. 00554 * 00555 * @a src_root and @a tgt_root can both be either revision or transaction 00556 * roots. If @a tgt_root is a revision, @a editor's set_target_revision() 00557 * will be called with the @a tgt_root's revision number, else it will 00558 * not be called at all. 00559 * 00560 * If @a authz_read_func is non-null, invoke it before any call to 00561 * 00562 * @a editor->open_root 00563 * @a editor->add_directory 00564 * @a editor->open_directory 00565 * @a editor->add_file 00566 * @a editor->open_file 00567 * 00568 * passing @a tgt_root, the same path that would be passed to the 00569 * editor function in question, and @a authz_read_baton. If the 00570 * @a *allowed parameter comes back TRUE, then proceed with the planned 00571 * editor call; else if FALSE, then invoke @a editor->absent_file or 00572 * @a editor->absent_directory as appropriate, except if the planned 00573 * editor call was open_root, throw SVN_ERR_AUTHZ_ROOT_UNREADABLE. 00574 * 00575 * If @a text_deltas is @c FALSE, send a single @c NULL txdelta window to 00576 * the window handler returned by @a editor->apply_textdelta(). 00577 * 00578 * If @a entry_props is @c TRUE, accompany each opened/added entry with 00579 * propchange editor calls that relay special "entry props" (this 00580 * is typically used only for working copy updates). 00581 * 00582 * @a ignore_ancestry instructs the function to ignore node ancestry 00583 * when determining how to transmit differences. 00584 * 00585 * Before completing successfully, this function calls @a editor's 00586 * close_edit(), so the caller should expect its @a edit_baton to be 00587 * invalid after its use with this function. 00588 * 00589 * Do any allocation necessary for the delta computation in @a pool. 00590 * This function's maximum memory consumption is at most roughly 00591 * proportional to the greatest depth of the tree under @a tgt_root, not 00592 * the total size of the delta. 00593 */ 00594 svn_error_t * 00595 svn_repos_dir_delta(svn_fs_root_t *src_root, 00596 const char *src_parent_dir, 00597 const char *src_entry, 00598 svn_fs_root_t *tgt_root, 00599 const char *tgt_path, 00600 const svn_delta_editor_t *editor, 00601 void *edit_baton, 00602 svn_repos_authz_func_t authz_read_func, 00603 void *authz_read_baton, 00604 svn_boolean_t text_deltas, 00605 svn_boolean_t recurse, 00606 svn_boolean_t entry_props, 00607 svn_boolean_t ignore_ancestry, 00608 apr_pool_t *pool); 00609 00610 /** Use the provided @a editor and @a edit_baton to describe the 00611 * skeletal changes made in a particular filesystem @a root 00612 * (revision or transaction). 00613 * 00614 * Changes will be limited to those within @a base_dir, and if 00615 * @a low_water_mark is set to something other than @c SVN_INVALID_REVNUM 00616 * it is assumed that the client has no knowledge of revisions prior to 00617 * @a low_water_mark. Together, these two arguments define the portion of 00618 * the tree that the client is assumed to have knowledge of, and thus any 00619 * copies of data from outside that part of the tree will be sent in their 00620 * entirety, not as simple copies or deltas against a previous version. 00621 * 00622 * The @a editor passed to this function should be aware of the fact 00623 * that, if @a send_deltas is false, calls to its change_dir_prop(), 00624 * change_file_prop(), and apply_textdelta() functions will not 00625 * contain meaningful data, and merely serve as indications that 00626 * properties or textual contents were changed. 00627 * 00628 * If @a send_deltas is @c TRUE, the text and property deltas for changes 00629 * will be sent, otherwise null text deltas and empty prop changes will be 00630 * used. 00631 * 00632 * If @a authz_read_func is non-NULL, it will be used to determine if the 00633 * user has read access to the data being accessed. Data that the user 00634 * cannot access will be skipped. 00635 * 00636 * @note This editor driver passes SVN_INVALID_REVNUM for all 00637 * revision parameters in the editor interface except the copyfrom 00638 * parameter of the add_file() and add_directory() editor functions. 00639 * 00640 * @since New in 1.4. 00641 */ 00642 svn_error_t * 00643 svn_repos_replay2(svn_fs_root_t *root, 00644 const char *base_dir, 00645 svn_revnum_t low_water_mark, 00646 svn_boolean_t send_deltas, 00647 const svn_delta_editor_t *editor, 00648 void *edit_baton, 00649 svn_repos_authz_func_t authz_read_func, 00650 void *authz_read_baton, 00651 apr_pool_t *pool); 00652 00653 /** 00654 * Similar to svn_repos_replay2(), but with @a base_dir set to @c "", 00655 * @a low_water_mark set to @c SVN_INVALID_REVNUM, @a send_deltas 00656 * set to @c FALSE, and @a authz_read_func and @a authz_read_baton 00657 * set to @c NULL. 00658 * 00659 * @deprecated Provided for backward compatibility with the 1.3 API. 00660 */ 00661 svn_error_t * 00662 svn_repos_replay(svn_fs_root_t *root, 00663 const svn_delta_editor_t *editor, 00664 void *edit_baton, 00665 apr_pool_t *pool); 00666 00667 /* ---------------------------------------------------------------*/ 00668 00669 /* Making commits. */ 00670 00671 /** 00672 * Return an @a editor and @a edit_baton to commit changes to @a session->fs, 00673 * beginning at location 'rev:@a base_path', where "rev" is the argument 00674 * given to open_root(). 00675 * 00676 * @a repos is a previously opened repository. @a repos_url is the 00677 * decoded URL to the base of the repository, and is used to check 00678 * copyfrom paths. @a txn is a filesystem transaction object to use 00679 * during the commit, or @c NULL to indicate that this function should 00680 * create (and fully manage) a new transaction. 00681 * 00682 * Iff @a user is not @c NULL, store it as the author of the commit 00683 * transaction. 00684 * 00685 * Iff @a log_msg is not @c NULL, store it as the log message 00686 * associated with the commit transaction. 00687 * 00688 * Iff @a authz_callback is provided, check read/write authorizations 00689 * on paths accessed by editor operations. An operation which fails 00690 * due to authz will return SVN_ERR_AUTHZ_UNREADABLE or 00691 * SVN_ERR_AUTHZ_UNWRITABLE. 00692 * 00693 * Calling @a (*editor)->close_edit completes the commit. Before 00694 * @c close_edit returns, but after the commit has succeeded, it will 00695 * invoke @a callback with the new revision number, the commit date (as a 00696 * <tt>const char *</tt>), commit author (as a <tt>const char *</tt>), and 00697 * @a callback_baton as arguments. If @a callback returns an error, that 00698 * error will be returned from @c close_edit, otherwise if there was a 00699 * post-commit hook failure, then that error will be returned and will 00700 * have code SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED. 00701 * 00702 * Calling @a (*editor)->abort_edit aborts the commit, and will also 00703 * abort the commit transaction unless @a txn was supplied (not @c 00704 * NULL). Callers who supply their own transactions are responsible 00705 * for cleaning them up (either by committing them, or aborting them). 00706 * 00707 * @since New in 1.4. 00708 */ 00709 svn_error_t * 00710 svn_repos_get_commit_editor4(const svn_delta_editor_t **editor, 00711 void **edit_baton, 00712 svn_repos_t *repos, 00713 svn_fs_txn_t *txn, 00714 const char *repos_url, 00715 const char *base_path, 00716 const char *user, 00717 const char *log_msg, 00718 svn_commit_callback2_t callback, 00719 void *callback_baton, 00720 svn_repos_authz_callback_t authz_callback, 00721 void *authz_baton, 00722 apr_pool_t *pool); 00723 00724 /** 00725 * Similar to svn_repos_get_commit_editor4(), but 00726 * uses the svn_commit_callback_t type. 00727 * 00728 * @since New in 1.3. 00729 * 00730 * @deprecated Provided for backward compatibility with the 1.3 API. 00731 */ 00732 svn_error_t * 00733 svn_repos_get_commit_editor3(const svn_delta_editor_t **editor, 00734 void **edit_baton, 00735 svn_repos_t *repos, 00736 svn_fs_txn_t *txn, 00737 const char *repos_url, 00738 const char *base_path, 00739 const char *user, 00740 const char *log_msg, 00741 svn_commit_callback_t callback, 00742 void *callback_baton, 00743 svn_repos_authz_callback_t authz_callback, 00744 void *authz_baton, 00745 apr_pool_t *pool); 00746 00747 /** 00748 * Similar to svn_repos_get_commit_editor3(), but with @a 00749 * authz_callback and @a authz_baton set to @c NULL. 00750 * 00751 * @deprecated Provided for backward compatibility with the 1.2 API. 00752 */ 00753 svn_error_t *svn_repos_get_commit_editor2(const svn_delta_editor_t **editor, 00754 void **edit_baton, 00755 svn_repos_t *repos, 00756 svn_fs_txn_t *txn, 00757 const char *repos_url, 00758 const char *base_path, 00759 const char *user, 00760 const char *log_msg, 00761 svn_commit_callback_t callback, 00762 void *callback_baton, 00763 apr_pool_t *pool); 00764 00765 00766 /** 00767 * Similar to svn_repos_get_commit_editor2(), but with @a txn always 00768 * set to @c NULL. 00769 * 00770 * @deprecated Provided for backward compatibility with the 1.1 API. 00771 */ 00772 svn_error_t *svn_repos_get_commit_editor(const svn_delta_editor_t **editor, 00773 void **edit_baton, 00774 svn_repos_t *repos, 00775 const char *repos_url, 00776 const char *base_path, 00777 const char *user, 00778 const char *log_msg, 00779 svn_commit_callback_t callback, 00780 void *callback_baton, 00781 apr_pool_t *pool); 00782 00783 /* ---------------------------------------------------------------*/ 00784 00785 /* Finding particular revisions. */ 00786 00787 /** Set @a *revision to the revision number in @a repos's filesystem that was 00788 * youngest at time @a tm. 00789 */ 00790 svn_error_t * 00791 svn_repos_dated_revision(svn_revnum_t *revision, 00792 svn_repos_t *repos, 00793 apr_time_t tm, 00794 apr_pool_t *pool); 00795 00796 00797 /** Given a @a root/@a path within some filesystem, return three pieces of 00798 * information allocated in @a pool: 00799 * 00800 * - set @a *committed_rev to the revision in which the object was 00801 * last modified. (In fs parlance, this is the revision in which 00802 * the particular node-rev-id was 'created'.) 00803 * 00804 * - set @a *committed_date to the date of said revision, or @c NULL 00805 * if not available. 00806 * 00807 * - set @a *last_author to the author of said revision, or @c NULL 00808 * if not available. 00809 */ 00810 svn_error_t * 00811 svn_repos_get_committed_info(svn_revnum_t *committed_rev, 00812 const char **committed_date, 00813 const char **last_author, 00814 svn_fs_root_t *root, 00815 const char *path, 00816 apr_pool_t *pool); 00817 00818 00819 /** 00820 * Set @a *dirent to an @c svn_dirent_t associated with @a path in @a 00821 * root. If @a path does not exist in @a root, set @a *dirent to 00822 * NULL. Use @a pool for memory allocation. 00823 * 00824 * @since New in 1.2. 00825 */ 00826 svn_error_t * 00827 svn_repos_stat(svn_dirent_t **dirent, 00828 svn_fs_root_t *root, 00829 const char *path, 00830 apr_pool_t *pool); 00831 00832 00833 /** Callback type for use with svn_repos_history(). @a path and @a 00834 * revision represent interesting history locations in the lifetime 00835 * of the path passed to svn_repos_history(). @a baton is the same 00836 * baton given to svn_repos_history(). @a pool is provided for the 00837 * convenience of the implementor, who should not expect it to live 00838 * longer than a single callback call. 00839 */ 00840 typedef svn_error_t *(*svn_repos_history_func_t)(void *baton, 00841 const char *path, 00842 svn_revnum_t revision, 00843 apr_pool_t *pool); 00844 00845 /** 00846 * Call @a history_func (with @a history_baton) for each interesting 00847 * history location in the lifetime of @a path in @a fs, from the 00848 * youngest of @a end and @ start to the oldest. Only cross 00849 * filesystem copy history if @a cross_copies is @c TRUE. And do all 00850 * of this in @a pool. 00851 * 00852 * If @a authz_read_func is non-NULL, then use it (and @a 00853 * authz_read_baton) to verify that @a path in @a end is readable; if 00854 * not, return SVN_ERR_AUTHZ_UNREADABLE. Also verify the readability 00855 * of every ancestral path/revision pair before pushing them at @a 00856 * history_func. If a pair is deemed unreadable, then do not send 00857 * them; instead, immediately stop traversing history and return 00858 * SVN_NO_ERROR. 00859 * 00860 * @since New in 1.1. 00861 */ 00862 svn_error_t * 00863 svn_repos_history2(svn_fs_t *fs, 00864 const char *path, 00865 svn_repos_history_func_t history_func, 00866 void *history_baton, 00867 svn_repos_authz_func_t authz_read_func, 00868 void *authz_read_baton, 00869 svn_revnum_t start, 00870 svn_revnum_t end, 00871 svn_boolean_t cross_copies, 00872 apr_pool_t *pool); 00873 00874 /** 00875 * Similar to svn_repos_history2(), but with @a authz_read_func 00876 * and @a authz_read_baton always set to NULL. 00877 * 00878 * @deprecated Provided for backward compatibility with the 1.0 API. 00879 */ 00880 svn_error_t * 00881 svn_repos_history(svn_fs_t *fs, 00882 const char *path, 00883 svn_repos_history_func_t history_func, 00884 void *history_baton, 00885 svn_revnum_t start, 00886 svn_revnum_t end, 00887 svn_boolean_t cross_copies, 00888 apr_pool_t *pool); 00889 00890 00891 /** 00892 * Set @a *locations to be a mapping of the revisions to the paths of 00893 * the file @a fs_path present at the repository in revision 00894 * @a peg_revision, where the revisions are taken out of the array 00895 * @a location_revisions. 00896 * 00897 * @a location_revisions is an array of svn_revnum_t's and @a *locations 00898 * maps 'svn_revnum_t *' to 'const char *'. 00899 * 00900 * If optional @a authz_read_func is non-NULL, then use it (and @a 00901 * authz_read_baton) to verify that the peg-object is readable. If not, 00902 * return SVN_ERR_AUTHZ_UNREADABLE. Also use the @a authz_read_func 00903 * to check that every path returned in the hash is readable. If an 00904 * unreadable path is encountered, stop tracing and return 00905 * SVN_NO_ERROR. 00906 * 00907 * @a pool is used for all allocations. 00908 * 00909 * @since New in 1.1. 00910 */ 00911 svn_error_t * 00912 svn_repos_trace_node_locations(svn_fs_t *fs, 00913 apr_hash_t **locations, 00914 const char *fs_path, 00915 svn_revnum_t peg_revision, 00916 apr_array_header_t *location_revisions, 00917 svn_repos_authz_func_t authz_read_func, 00918 void *authz_read_baton, 00919 apr_pool_t *pool); 00920 00921 /* ### other queries we can do someday -- 00922 00923 * fetch the last revision created by <user> 00924 (once usernames become revision properties!) 00925 * fetch the last revision where <path> was modified 00926 00927 */ 00928 00929 00930 00931 /* ---------------------------------------------------------------*/ 00932 00933 /* Retrieving log messages. */ 00934 00935 00936 /** 00937 * Invoke @a receiver with @a receiver_baton on each log message from 00938 * @a start to @a end in @a repos's filesystem. @a start may be greater 00939 * or less than @a end; this just controls whether the log messages are 00940 * processed in descending or ascending revision number order. 00941 * 00942 * If @a start or @a end is @c SVN_INVALID_REVNUM, it defaults to youngest. 00943 * 00944 * If @a paths is non-null and has one or more elements, then only show 00945 * revisions in which at least one of @a paths was changed (i.e., if 00946 * file, text or props changed; if dir, props or entries changed or any node 00947 * changed below it). Each path is a <tt>const char *</tt> representing 00948 * an absolute path in the repository. 00949 * 00950 * If @a limit is non-zero then only invoke @a receiver on the first 00951 * @a limit logs. 00952 * 00953 * If @a discover_changed_paths, then each call to @a receiver passes a 00954 * hash mapping paths committed in that revision to information about them 00955 * as the receiver's @a changed_paths argument. 00956 * Otherwise, each call to @a receiver passes null for @a changed_paths. 00957 * 00958 * If @a strict_node_history is set, copy history (if any exists) will 00959 * not be traversed while harvesting revision logs for each path. 00960 * 00961 * If any invocation of @a receiver returns error, return that error 00962 * immediately and without wrapping it. 00963 * 00964 * If @a start or @a end is a non-existent revision, return the error 00965 * @c SVN_ERR_FS_NO_SUCH_REVISION, without ever invoking @a receiver. 00966 * 00967 * If optional @a authz_read_func is non-NULL, then use this function 00968 * (along with optional @a authz_read_baton) to check the readability 00969 * of each changed-path in each revision about to be "pushed" at 00970 * @a receiver. If a revision has all unreadable changed-paths, then 00971 * don't push the revision at all. If a revision has a mixture of 00972 * readable and unreadable changed-paths, then silently omit the 00973 * unreadable changed-paths when pushing the revision. 00974 * 00975 * See also the documentation for @c svn_log_message_receiver_t. 00976 * 00977 * Use @a pool for temporary allocations. 00978 * 00979 * @since New in 1.2. 00980 */ 00981 svn_error_t * 00982 svn_repos_get_logs3(svn_repos_t *repos, 00983 const apr_array_header_t *paths, 00984 svn_revnum_t start, 00985 svn_revnum_t end, 00986 int limit, 00987 svn_boolean_t discover_changed_paths, 00988 svn_boolean_t strict_node_history, 00989 svn_repos_authz_func_t authz_read_func, 00990 void *authz_read_baton, 00991 svn_log_message_receiver_t receiver, 00992 void *receiver_baton, 00993 apr_pool_t *pool); 00994 00995 00996 /** 00997 * Same as svn_repos_get_logs3(), but with @a limit always set to 0. 00998 * 00999 * @deprecated Provided for backward compatibility with the 1.1 API. 01000 */ 01001 svn_error_t * 01002 svn_repos_get_logs2(svn_repos_t *repos, 01003 const apr_array_header_t *paths, 01004 svn_revnum_t start, 01005 svn_revnum_t end, 01006 svn_boolean_t discover_changed_paths, 01007 svn_boolean_t strict_node_history, 01008 svn_repos_authz_func_t authz_read_func, 01009 void *authz_read_baton, 01010 svn_log_message_receiver_t receiver, 01011 void *receiver_baton, 01012 apr_pool_t *pool); 01013 01014 /** 01015 * Same as svn_repos_get_logs2(), but with @a authz_read_func and 01016 * @a authz_read_baton always set to NULL. 01017 * 01018 * @deprecated Provided for backward compatibility with the 1.0 API. 01019 */ 01020 svn_error_t * 01021 svn_repos_get_logs(svn_repos_t *repos, 01022 const apr_array_header_t *paths, 01023 svn_revnum_t start, 01024 svn_revnum_t end, 01025 svn_boolean_t discover_changed_paths, 01026 svn_boolean_t strict_node_history, 01027 svn_log_message_receiver_t receiver, 01028 void *receiver_baton, 01029 apr_pool_t *pool); 01030 01031 01032 01033 /* ---------------------------------------------------------------*/ 01034 01035 /* Retreiving multiple revisions of a file. */ 01036 01037 /** 01038 * Retrieve a subset of the interesting revisions of a file @a path in 01039 * @a repos as seen in revision @a end. Invoke @a handler with 01040 * @a handler_baton as its first argument for each such revision. 01041 * @a pool is used for all allocations. See svn_fs_history_prev() for 01042 * a discussion of interesting revisions. 01043 * 01044 * If optional @a authz_read_func is non-NULL, then use this function 01045 * (along with optional @a authz_read_baton) to check the readability 01046 * of the rev-path in each interesting revision encountered. 01047 * 01048 * Revision discovery happens from @a end to @a start, and if an 01049 * unreadable revision is encountered before @a start is reached, then 01050 * revision discovery stops and only the revisions from @a end to the 01051 * oldest readable revision are returned (So it will appear that @a 01052 * path was added without history in the latter revision). 01053 * 01054 * If there is an interesting revision of the file that is less than or 01055 * equal to start, the iteration will start at that revision. Else, the 01056 * iteration will start at the first revision of the file in the repository, 01057 * which has to be less than or equal to end. Note that if the function 01058 * succeeds, @a handler will have been called at least once. 01059 * 01060 * In a series of calls, the file contents for the first interesting revision 01061 * will be provided as a text delta against the empty file. In the following 01062 * calls, the delta will be against the contents for the previous call. 01063 * 01064 * @since New in 1.1. 01065 */ 01066 svn_error_t *svn_repos_get_file_revs(svn_repos_t *repos, 01067 const char *path, 01068 svn_revnum_t start, 01069 svn_revnum_t end, 01070 svn_repos_authz_func_t authz_read_func, 01071 void *authz_read_baton, 01072 svn_repos_file_rev_handler_t handler, 01073 void *handler_baton, 01074 apr_pool_t *pool); 01075 01076 01077 /* ---------------------------------------------------------------*/ 01078 01079 /** 01080 * @defgroup svn_repos_hook_wrappers Hook-sensitive wrappers for libsvn_fs 01081 * routines. 01082 * @{ 01083 */ 01084 01085 /** Like svn_fs_commit_txn(), but invoke the @a repos's pre- and 01086 * post-commit hooks around the commit. Use @a pool for any necessary 01087 * allocations. 01088 * 01089 * If the pre-commit hook or svn_fs_commit_txn() fails, throw the 01090 * original error to caller. If an error occurs when running the 01091 * post-commit hook, return the original error wrapped with 01092 * SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED. If the caller sees this 01093 * error, it knows that the commit succeeded anyway. 01094 * 01095 * @a conflict_p, @a new_rev, and @a txn are as in svn_fs_commit_txn(). 01096 */ 01097 svn_error_t *svn_repos_fs_commit_txn(const char **conflict_p, 01098 svn_repos_t *repos, 01099 svn_revnum_t *new_rev, 01100 svn_fs_txn_t *txn, 01101 apr_pool_t *pool); 01102 01103 /** Like svn_fs_begin_txn(), but use @a author and @a log_msg to set the 01104 * corresponding properties on transaction @a *txn_p. @a repos is the 01105 * repository object which contains the filesystem. @a rev, @a *txn_p, and 01106 * @a pool are as in svn_fs_begin_txn(). 01107 * 01108 * Before a txn is created, the repository's start-commit hooks are 01109 * run; if any of them fail, no txn is created, @a *txn_p is unaffected, 01110 * and @c SVN_ERR_REPOS_HOOK_FAILURE is returned. 01111 * 01112 * @a log_msg may be @c NULL to indicate the message is not (yet) available. 01113 * The caller will need to attach it to the transaction at a later time. 01114 */ 01115 svn_error_t *svn_repos_fs_begin_txn_for_commit(svn_fs_txn_t **txn_p, 01116 svn_repos_t *repos, 01117 svn_revnum_t rev, 01118 const char *author, 01119 const char *log_msg, 01120 apr_pool_t *pool); 01121 01122 01123 /** Like svn_fs_begin_txn(), but use @a author to set the corresponding 01124 * property on transaction @a *txn_p. @a repos is the repository object 01125 * which contains the filesystem. @a rev, @a *txn_p, and @a pool are as in 01126 * svn_fs_begin_txn(). 01127 * 01128 * ### Someday: before a txn is created, some kind of read-hook could 01129 * be called here. 01130 */ 01131 svn_error_t *svn_repos_fs_begin_txn_for_update(svn_fs_txn_t **txn_p, 01132 svn_repos_t *repos, 01133 svn_revnum_t rev, 01134 const char *author, 01135 apr_pool_t *pool); 01136 01137 01138 /** @defgroup svn_repos_fs_locks repository lock wrappers 01139 * @{ 01140 * @since New in 1.2. */ 01141 01142 /** Like svn_fs_lock(), but invoke the @a repos's pre- and 01143 * post-lock hooks before and after the locking action. Use @a pool 01144 * for any necessary allocations. 01145 * 01146 * If the pre-lock hook or svn_fs_lock() fails, throw the original 01147 * error to caller. If an error occurs when running the post-lock 01148 * hook, return the original error wrapped with 01149 * SVN_ERR_REPOS_POST_LOCK_HOOK_FAILED. If the caller sees this 01150 * error, it knows that the lock succeeded anyway. 01151 */ 01152 svn_error_t *svn_repos_fs_lock(svn_lock_t **lock, 01153 svn_repos_t *repos, 01154 const char *path, 01155 const char *token, 01156 const char *comment, 01157 svn_boolean_t is_dav_comment, 01158 apr_time_t expiration_date, 01159 svn_revnum_t current_rev, 01160 svn_boolean_t steal_lock, 01161 apr_pool_t *pool); 01162 01163 01164 /** Like svn_fs_unlock(), but invoke the @a repos's pre- and 01165 * post-unlock hooks before and after the unlocking action. Use @a 01166 * pool for any necessary allocations. 01167 * 01168 * If the pre-unlock hook or svn_fs_unlock() fails, throw the original 01169 * error to caller. If an error occurs when running the post-unlock 01170 * hook, return the original error wrapped with 01171 * SVN_ERR_REPOS_POST_UNLOCK_HOOK_FAILED. If the caller sees this 01172 * error, it knows that the unlock succeeded anyway. 01173 */ 01174 svn_error_t *svn_repos_fs_unlock(svn_repos_t *repos, 01175 const char *path, 01176 const char *token, 01177 svn_boolean_t break_lock, 01178 apr_pool_t *pool); 01179 01180 01181 01182 /** Look up all the locks in and under @a path in @a repos, setting @a 01183 * *locks to a hash which maps <tt>const char *</tt> paths to the @c 01184 * svn_lock_t locks associated with those paths. Use @a 01185 * authz_read_func and @a authz_read_baton to "screen" all returned 01186 * locks. That is: do not return any locks on any paths that are 01187 * unreadable in HEAD, just silently omit them. 01188 */ 01189 svn_error_t *svn_repos_fs_get_locks(apr_hash_t **locks, 01190 svn_repos_t *repos, 01191 const char *path, 01192 svn_repos_authz_func_t authz_read_func, 01193 void *authz_read_baton, 01194 apr_pool_t *pool); 01195 01196 /** @} */ 01197 01198 /** 01199 * Like svn_fs_change_rev_prop(), but invoke the @a repos's pre- and 01200 * post-revprop-change hooks around the change. Use @a pool for 01201 * temporary allocations. 01202 * 01203 * @a rev is the revision whose property to change, @a name is the 01204 * name of the property, and @a new_value is the new value of the 01205 * property. @a author is the authenticated username of the person 01206 * changing the property value, or null if not available. 01207 * 01208 * If @a authz_read_func is non-NULL, then use it (with @a 01209 * authz_read_baton) to validate the changed-paths associated with @a 01210 * rev. If the revision contains any unreadable changed paths, then 01211 * return SVN_ERR_AUTHZ_UNREADABLE. 01212 * 01213 * @since New in 1.1. 01214 */ 01215 svn_error_t *svn_repos_fs_change_rev_prop2(svn_repos_t *repos, 01216 svn_revnum_t rev, 01217 const char *author, 01218 const char *name, 01219 const svn_string_t *new_value, 01220 svn_repos_authz_func_t 01221 authz_read_func, 01222 void *authz_read_baton, 01223 apr_pool_t *pool); 01224 01225 /** 01226 * Similar to svn_repos_fs_change_rev_prop2(), but with the 01227 * @a authz_read_func parameter always NULL. 01228 * 01229 * @deprecated Provided for backward compatibility with the 1.0 API. 01230 */ 01231 svn_error_t *svn_repos_fs_change_rev_prop(svn_repos_t *repos, 01232 svn_revnum_t rev, 01233 const char *author, 01234 const char *name, 01235 const svn_string_t *new_value, 01236 apr_pool_t *pool); 01237 01238 01239 01240 /** 01241 * Set @a *value_p to the value of the property named @a propname on 01242 * revision @a rev in the filesystem opened in @a repos. If @a rev 01243 * has no property by that name, set @a *value_p to zero. Allocate 01244 * the result in @a pool. 01245 * 01246 * If @a authz_read_func is non-NULL, then use it (with @a 01247 * authz_read_baton) to validate the changed-paths associated with @a 01248 * rev. If the changed-paths are all unreadable, then set @a *value_p 01249 * to zero unconditionally. If only some of the changed-paths are 01250 * unreadable, then allow 'svn:author' and 'svn:date' propvalues to be 01251 * fetched, but return 0 for any other property. 01252 * 01253 * @since New in 1.1. 01254 */ 01255 svn_error_t *svn_repos_fs_revision_prop(svn_string_t **value_p, 01256 svn_repos_t *repos, 01257 svn_revnum_t rev, 01258 const char *propname, 01259 svn_repos_authz_func_t 01260 authz_read_func, 01261 void *authz_read_baton, 01262 apr_pool_t *pool); 01263 01264 01265 /** 01266 * Set @a *table_p to the entire property list of revision @a rev in 01267 * filesystem opened in @a repos, as a hash table allocated in @a 01268 * pool. The table maps <tt>char *</tt> property names to @c 01269 * svn_string_t * values; the names and values are allocated in @a 01270 * pool. 01271 * 01272 * If @a authz_read_func is non-NULL, then use it (with @a 01273 * authz_read_baton) to validate the changed-paths associated with @a 01274 * rev. If the changed-paths are all unreadable, then return an empty 01275 * hash. If only some of the changed-paths are unreadable, then return 01276 * an empty hash, except for 'svn:author' and 'svn:date' properties 01277 * (assuming those properties exist). 01278 * 01279 * @since New in 1.1. 01280 */ 01281 svn_error_t *svn_repos_fs_revision_proplist(apr_hash_t **table_p, 01282 svn_repos_t *repos, 01283 svn_revnum_t rev, 01284 svn_repos_authz_func_t 01285 authz_read_func, 01286 void *authz_read_baton, 01287 apr_pool_t *pool); 01288 01289 01290 01291 /* ---------------------------------------------------------------*/ 01292 01293 /* Prop-changing wrappers for libsvn_fs routines. */ 01294 01295 /* NOTE: svn_repos_fs_change_rev_prop() also exists, but is located 01296 above with the hook-related functions. */ 01297 01298 01299 /** Validating wrapper for svn_fs_change_node_prop() (which see for 01300 * argument descriptions). 01301 */ 01302 svn_error_t *svn_repos_fs_change_node_prop(svn_fs_root_t *root, 01303 const char *path, 01304 const char *name, 01305 const svn_string_t *value, 01306 apr_pool_t *pool); 01307 01308 /** Validating wrapper for svn_fs_change_txn_prop() (which see for 01309 * argument descriptions). 01310 */ 01311 svn_error_t *svn_repos_fs_change_txn_prop(svn_fs_txn_t *txn, 01312 const char *name, 01313 const svn_string_t *value, 01314 apr_pool_t *pool); 01315 01316 /** @} */ 01317 01318 /* ---------------------------------------------------------------*/ 01319 01320 /** 01321 * @defgroup svn_repos_inspection Data structures and editor things for 01322 * repository inspection. 01323 * @{ 01324 * 01325 * As it turns out, the svn_repos_dir_delta() interface can be 01326 * extremely useful for examining the repository, or more exactly, 01327 * changes to the repository. svn_repos_dir_delta() allows for 01328 * differences between two trees to be described using an editor. 01329 * 01330 * By using the editor obtained from svn_repos_node_editor() with 01331 * svn_repos_dir_delta(), the description of how to transform one tree 01332 * into another can be used to build an in-memory linked-list tree, 01333 * which each node representing a repository node that was changed as a 01334 * result of having svn_repos_dir_delta() drive that editor. 01335 */ 01336 01337 /** A node in the repository. */ 01338 typedef struct svn_repos_node_t 01339 { 01340 /** Node type (file, dir, etc.) */ 01341 svn_node_kind_t kind; 01342 01343 /** How this node entered the node tree: 'A'dd, 'D'elete, 'R'eplace */ 01344 char action; 01345 01346 /** Were there any textual mods? (files only) */ 01347 svn_boolean_t text_mod; 01348 01349 /** Where there any property mods? */ 01350 svn_boolean_t prop_mod; 01351 01352 /** The name of this node as it appears in its parent's entries list */ 01353 const char *name; 01354 01355 /** The filesystem revision where this was copied from (if any) */ 01356 svn_revnum_t copyfrom_rev; 01357 01358 /** The filesystem path where this was copied from (if any) */ 01359 const char *copyfrom_path; 01360 01361 /** Pointer to the next sibling of this node */ 01362 struct svn_repos_node_t *sibling; 01363 01364 /** Pointer to the first child of this node */ 01365 struct svn_repos_node_t *child; 01366 01367 /** Pointer to the parent of this node */ 01368 struct svn_repos_node_t *parent; 01369 01370 } svn_repos_node_t; 01371 01372 01373 /** Set @a *editor and @a *edit_baton to an editor that, when driven by 01374 * svn_repos_dir_delta(), builds an <tt>svn_repos_node_t *</tt> tree 01375 * representing the delta from @a base_root to @a root in @a repos's 01376 * filesystem. 01377 * 01378 * Invoke svn_repos_node_from_baton() on @a edit_baton to obtain the root 01379 * node afterwards. 01380 * 01381 * Note that the delta includes "bubbled-up" directories; that is, 01382 * many of the directory nodes will have no prop_mods. 01383 * 01384 * Allocate the tree and its contents in @a node_pool; do all other 01385 * allocation in @a pool. 01386 */ 01387 svn_error_t *svn_repos_node_editor(const svn_delta_editor_t **editor, 01388 void **edit_baton, 01389 svn_repos_t *repos, 01390 svn_fs_root_t *base_root, 01391 svn_fs_root_t *root, 01392 apr_pool_t *node_pool, 01393 apr_pool_t *pool); 01394 01395 /** Return the root node of the linked-list tree generated by driving 01396 * the editor created by svn_repos_node_editor() with 01397 * svn_repos_dir_delta(), which is stored in @a edit_baton. This is 01398 * only really useful if used *after* the editor drive is completed. 01399 */ 01400 svn_repos_node_t *svn_repos_node_from_baton(void *edit_baton); 01401 01402 /** @} */ 01403 01404 /* ---------------------------------------------------------------*/ 01405 01406 /** 01407 * @defgroup svn_repos_dump_load Dumping and loading filesystem data 01408 * @{ 01409 * 01410 * The filesystem 'dump' format contains nothing but the abstract 01411 * structure of the filesystem -- independent of any internal node-id 01412 * schema or database back-end. All of the data in the dumpfile is 01413 * acquired by public function calls into svn_fs.h. Similarly, the 01414 * parser which reads the dumpfile is able to reconstruct the 01415 * filesystem using only public svn_fs.h routines. 01416 * 01417 * Thus the dump/load feature's main purpose is for *migrating* data 01418 * from one svn filesystem to another -- presumably two filesystems 01419 * which have different internal implementations. 01420 * 01421 * If you simply want to backup your filesystem, you're probably 01422 * better off using the built-in facilities of the DB backend (using 01423 * Berkeley DB's hot-backup feature, for example.) 01424 * 01425 * For a description of the dumpfile format, see 01426 * /trunk/notes/fs_dumprestore.txt. 01427 */ 01428 01429 /* The RFC822-style headers in our dumpfile format. */ 01430 #define SVN_REPOS_DUMPFILE_MAGIC_HEADER "SVN-fs-dump-format-version" 01431 #define SVN_REPOS_DUMPFILE_FORMAT_VERSION 3 01432 #define SVN_REPOS_DUMPFILE_UUID "UUID" 01433 #define SVN_REPOS_DUMPFILE_CONTENT_LENGTH "Content-length" 01434 01435 #define SVN_REPOS_DUMPFILE_REVISION_NUMBER "Revision-number" 01436 01437 #define SVN_REPOS_DUMPFILE_NODE_PATH "Node-path" 01438 #define SVN_REPOS_DUMPFILE_NODE_KIND "Node-kind" 01439 #define SVN_REPOS_DUMPFILE_NODE_ACTION "Node-action" 01440 #define SVN_REPOS_DUMPFILE_NODE_COPYFROM_PATH "Node-copyfrom-path" 01441 #define SVN_REPOS_DUMPFILE_NODE_COPYFROM_REV "Node-copyfrom-rev" 01442 #define SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_CHECKSUM "Text-copy-source-md5" 01443 #define SVN_REPOS_DUMPFILE_TEXT_CONTENT_CHECKSUM "Text-content-md5" 01444 01445 #define SVN_REPOS_DUMPFILE_PROP_CONTENT_LENGTH "Prop-content-length" 01446 #define SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH "Text-content-length" 01447 01448 /* @since New in 1.1. */ 01449 #define SVN_REPOS_DUMPFILE_PROP_DELTA "Prop-delta" 01450 /* @since New in 1.1. */ 01451 #define SVN_REPOS_DUMPFILE_TEXT_DELTA "Text-delta" 01452 01453 /** The different "actions" attached to nodes in the dumpfile. */ 01454 enum svn_node_action 01455 { 01456 svn_node_action_change, 01457 svn_node_action_add, 01458 svn_node_action_delete, 01459 svn_node_action_replace 01460 }; 01461 01462 /** The different policies for processing the UUID in the dumpfile. */ 01463 enum svn_repos_load_uuid 01464 { 01465 svn_repos_load_uuid_default, 01466 svn_repos_load_uuid_ignore, 01467 svn_repos_load_uuid_force 01468 }; 01469 01470 /** 01471 * Dump the contents of the filesystem within already-open @a repos into 01472 * writable @a dumpstream. Begin at revision @a start_rev, and dump every 01473 * revision up through @a end_rev. Use @a pool for all allocation. If 01474 * non-@c NULL, send feedback to @a feedback_stream. @a dumpstream can be 01475 * @c NULL for the purpose of verifying the repository. 01476 * 01477 * If @a start_rev is @c SVN_INVALID_REVNUM, then start dumping at revision 01478 * 0. If @a end_rev is @c SVN_INVALID_REVNUM, then dump through the @c HEAD 01479 * revision. 01480 * 01481 * If @a incremental is @c TRUE, the first revision dumped will be a diff 01482 * against the previous revision (usually it looks like a full dump of 01483 * the tree). 01484 * 01485 * If @a use_deltas is @c TRUE, output only node properties which have 01486 * changed relative to the previous contents, and output text contents 01487 * as svndiff data against the previous contents. Regardless of how 01488 * this flag is set, the first revision of a non-incremental dump will 01489 * be done with full plain text. A dump with @a use_deltas set cannot 01490 * be loaded by Subversion 1.0.x. 01491 * 01492 * If @a cancel_func is not @c NULL, it is called periodically with 01493 * @a cancel_baton as argument to see if the client wishes to cancel 01494 * the dump. 01495 * 01496 * @since New in 1.1. 01497 */ 01498 svn_error_t *svn_repos_dump_fs2(svn_repos_t *repos, 01499 svn_stream_t *dumpstream, 01500 svn_stream_t *feedback_stream, 01501 svn_revnum_t start_rev, 01502 svn_revnum_t end_rev, 01503 svn_boolean_t incremental, 01504 svn_boolean_t use_deltas, 01505 svn_cancel_func_t cancel_func, 01506 void *cancel_baton, 01507 apr_pool_t *pool); 01508 01509 01510 /** 01511 * Similar to svn_repos_dump_fs2(), but with the @a use_deltas 01512 * parameter always set to @c FALSE. 01513 * 01514 * @deprecated Provided for backward compatibility with the 1.0 API. 01515 */ 01516 svn_error_t *svn_repos_dump_fs(svn_repos_t *repos, 01517 svn_stream_t *dumpstream, 01518 svn_stream_t *feedback_stream, 01519 svn_revnum_t start_rev, 01520 svn_revnum_t end_rev, 01521 svn_boolean_t incremental, 01522 svn_cancel_func_t cancel_func, 01523 void *cancel_baton, 01524 apr_pool_t *pool); 01525 01526 01527 /** 01528 * Read and parse dumpfile-formatted @a dumpstream, reconstructing 01529 * filesystem revisions in already-open @a repos, handling uuids 01530 * in accordance with @a uuid_action. 01531 * 01532 * Read and parse dumpfile-formatted @a dumpstream, reconstructing 01533 * filesystem revisions in already-open @a repos. Use @a pool for all 01534 * allocation. If non-@c NULL, send feedback to @a feedback_stream. 01535 * 01536 * If the dumpstream contains copy history that is unavailable in the 01537 * repository, an error will be thrown. 01538 * 01539 * The repository's UUID will be updated iff 01540 * the dumpstream contains a UUID and 01541 * @a uuid_action is not equal to @c svn_repos_load_uuid_ignore and 01542 * either the repository contains no revisions or 01543 * @a uuid_action is equal to @c svn_repos_load_uuid_force. 01544 * 01545 * If the dumpstream contains no UUID, then @a uuid_action is 01546 * ignored and the repository UUID is not touched. 01547 * 01548 * If @a parent_dir is not null, then the parser will reparent all the 01549 * loaded nodes, from root to @a parent_dir. The directory @a parent_dir 01550 * must be an existing directory in the repository. 01551 * 01552 * If @a use_pre_commit_hook is set, call the repository's pre-commit 01553 * hook before committing each loaded revision. 01554 * 01555 * If @a use_post_commit_hook is set, call the repository's 01556 * post-commit hook after committing each loaded revision. 01557 * 01558 * If @a cancel_func is not @c NULL, it is called periodically with 01559 * @a cancel_baton as argument to see if the client wishes to cancel 01560 * the load. 01561 * 01562 * @since New in 1.2. 01563 */ 01564 svn_error_t *svn_repos_load_fs2(svn_repos_t *repos, 01565 svn_stream_t *dumpstream, 01566 svn_stream_t *feedback_stream, 01567 enum svn_repos_load_uuid uuid_action, 01568 const char *parent_dir, 01569 svn_boolean_t use_pre_commit_hook, 01570 svn_boolean_t use_post_commit_hook, 01571 svn_cancel_func_t cancel_func, 01572 void *cancel_baton, 01573 apr_pool_t *pool); 01574 01575 /** 01576 * Similar to svn_repos_load_fs2(), but with @a use_pre_commit_hook and 01577 * @a use_post_commit_hook always @c FALSE. 01578 * 01579 * @deprecated Provided for backward compatibility with the 1.0 API. 01580 */ 01581 svn_error_t *svn_repos_load_fs(svn_repos_t *repos, 01582 svn_stream_t *dumpstream, 01583 svn_stream_t *feedback_stream, 01584 enum svn_repos_load_uuid uuid_action, 01585 const char *parent_dir, 01586 svn_cancel_func_t cancel_func, 01587 void *cancel_baton, 01588 apr_pool_t *pool); 01589 01590 01591 /** 01592 * A vtable that is driven by svn_repos_parse_dumpstream2(). 01593 * 01594 * @since New in 1.1. 01595 */ 01596 typedef struct svn_repos_parse_fns2_t 01597 { 01598 /** The parser has discovered a new revision record within the 01599 * parsing session represented by @a parse_baton. All the headers are 01600 * placed in @a headers (allocated in @a pool), which maps <tt>const 01601 * char *</tt> header-name ==> <tt>const char *</tt> header-value. 01602 * The @a revision_baton received back (also allocated in @a pool) 01603 * represents the revision. 01604 */ 01605 svn_error_t *(*new_revision_record)(void **revision_baton, 01606 apr_hash_t *headers, 01607 void *parse_baton, 01608 apr_pool_t *pool); 01609 01610 /** The parser has discovered a new uuid record within the parsing 01611 * session represented by @a parse_baton. The uuid's value is 01612 * @a uuid, and it is allocated in @a pool. 01613 */ 01614 svn_error_t *(*uuid_record)(const char *uuid, 01615 void *parse_baton, 01616 apr_pool_t *pool); 01617 01618 /** The parser has discovered a new node record within the current 01619 * revision represented by @a revision_baton. All the headers are 01620 * placed in @a headers (as with @c new_revision_record), allocated in 01621 * @a pool. The @a node_baton received back is allocated in @a pool 01622 * and represents the node. 01623 */ 01624 svn_error_t *(*new_node_record)(void **node_baton, 01625 apr_hash_t *headers, 01626 void *revision_baton, 01627 apr_pool_t *pool); 01628 01629 /** For a given @a revision_baton, set a property @a name to @a value. */ 01630 svn_error_t *(*set_revision_property)(void *revision_baton, 01631 const char *name, 01632 const svn_string_t *value); 01633 01634 /** For a given @a node_baton, set a property @a name to @a value. */ 01635 svn_error_t *(*set_node_property)(void *node_baton, 01636 const char *name, 01637 const svn_string_t *value); 01638 01639 /** For a given @a node_baton, delete property @a name. */ 01640 svn_error_t *(*delete_node_property)(void *node_baton, const char *name); 01641 01642 /** For a given @a node_baton, remove all properties. */ 01643 svn_error_t *(*remove_node_props)(void *node_baton); 01644 01645 /** For a given @a node_baton, receive a writable @a stream capable of 01646 * receiving the node's fulltext. After writing the fulltext, call 01647 * the stream's close() function. 01648 * 01649 * If a @c NULL is returned instead of a stream, the vtable is 01650 * indicating that no text is desired, and the parser will not 01651 * attempt to send it. 01652 */ 01653 svn_error_t *(*set_fulltext)(svn_stream_t **stream, 01654 void *node_baton); 01655 01656 /** For a given @a node_baton, set @a handler and @a handler_baton 01657 * to a window handler and baton capable of receiving a delta 01658 * against the node's previous contents. A NULL window will be 01659 * sent to the handler after all the windows are sent. 01660 * 01661 * If a @c NULL is returned instead of a handler, the vtable is 01662 * indicating that no delta is desired, and the parser will not 01663 * attempt to send it. 01664 */ 01665 svn_error_t *(*apply_textdelta)(svn_txdelta_window_handler_t *handler, 01666 void **handler_baton, 01667 void *node_baton); 01668 01669 /** The parser has reached the end of the current node represented by 01670 * @a node_baton, it can be freed. 01671 */ 01672 svn_error_t *(*close_node)(void *node_baton); 01673 01674 /** The parser has reached the end of the current revision 01675 * represented by @a revision_baton. In other words, there are no more 01676 * changed nodes within the revision. The baton can be freed. 01677 */ 01678 svn_error_t *(*close_revision)(void *revision_baton); 01679 01680 } svn_repos_parse_fns2_t; 01681 01682 /** @deprecated Provided for backward compatibility with the 1.2 API. */ 01683 typedef svn_repos_parse_fns2_t svn_repos_parser_fns2_t; 01684 01685 01686 /** 01687 * Read and parse dumpfile-formatted @a stream, calling callbacks in 01688 * @a parse_fns/@a parse_baton, and using @a pool for allocations. 01689 * 01690 * If @a cancel_func is not @c NULL, it is called periodically with 01691 * @a cancel_baton as argument to see if the client wishes to cancel 01692 * the dump. 01693 * 01694 * This parser has built-in knowledge of the dumpfile format, but only 01695 * in a general sense: 01696 * 01697 * * it recognizes revision and node records by looking for either 01698 * a REVISION_NUMBER or NODE_PATH headers. 01699 * 01700 * * it recognizes the CONTENT-LENGTH headers, so it knows if and 01701 * how to suck up the content body. 01702 * 01703 * * it knows how to parse a content body into two parts: props 01704 * and text, and pass the pieces to the vtable. 01705 * 01706 * This is enough knowledge to make it easy on vtable implementors, 01707 * but still allow expansion of the format: most headers are ignored. 01708 * 01709 * @since New in 1.1. 01710 */ 01711 svn_error_t * 01712 svn_repos_parse_dumpstream2(svn_stream_t *stream, 01713 const svn_repos_parse_fns2_t *parse_fns, 01714 void *parse_baton, 01715 svn_cancel_func_t cancel_func, 01716 void *cancel_baton, 01717 apr_pool_t *pool); 01718 01719 01720 /** 01721 * Set @a *parser and @a *parse_baton to a vtable parser which commits new 01722 * revisions to the fs in @a repos. The constructed parser will treat 01723 * UUID records in a manner consistent with @a uuid_action. Use @a pool 01724 * to operate on the fs. 01725 * 01726 * If @a use_history is set, then the parser will require relative 01727 * 'copyfrom' history to exist in the repository when it encounters 01728 * nodes that are added-with-history. 01729 * 01730 * If @a parent_dir is not null, then the parser will reparent all the 01731 * loaded nodes, from root to @a parent_dir. The directory @a parent_dir 01732 * must be an existing directory in the repository. 01733 * 01734 * Print all parsing feedback to @a outstream (if non-@c NULL). 01735 * 01736 * 01737 * @since New in 1.1. 01738 */ 01739 svn_error_t * 01740 svn_repos_get_fs_build_parser2(const svn_repos_parse_fns2_t **parser, 01741 void **parse_baton, 01742 svn_repos_t *repos, 01743 svn_boolean_t use_history, 01744 enum svn_repos_load_uuid uuid_action, 01745 svn_stream_t *outstream, 01746 const char *parent_dir, 01747 apr_pool_t *pool); 01748 01749 01750 /** 01751 * A vtable that is driven by svn_repos_parse_dumpstream(). 01752 * Similar to @c svn_repos_parse_fns2_t except that it lacks 01753 * the delete_node_property and apply_textdelta callbacks. 01754 * 01755 * @deprecated Provided for backward compatibility with the 1.0 API. 01756 */ 01757 typedef struct svn_repos_parse_fns_t 01758 { 01759 /** Same as the corresponding field in @c svn_repos_parse_fns2_t. */ 01760 svn_error_t *(*new_revision_record)(void **revision_baton, 01761 apr_hash_t *headers, 01762 void *parse_baton, 01763 apr_pool_t *pool); 01764 /** Same as the corresponding field in @c svn_repos_parse_fns2_t. */ 01765 svn_error_t *(*uuid_record)(const char *uuid, 01766 void *parse_baton, 01767 apr_pool_t *pool); 01768 /** Same as the corresponding field in @c svn_repos_parse_fns2_t. */ 01769 svn_error_t *(*new_node_record)(void **node_baton, 01770 apr_hash_t *headers, 01771 void *revision_baton, 01772 apr_pool_t *pool); 01773 /** Same as the corresponding field in @c svn_repos_parse_fns2_t. */ 01774 svn_error_t *(*set_revision_property)(void *revision_baton, 01775 const char *name, 01776 const svn_string_t *value); 01777 /** Same as the corresponding field in @c svn_repos_parse_fns2_t. */ 01778 svn_error_t *(*set_node_property)(void *node_baton, 01779 const char *name, 01780 const svn_string_t *value); 01781 /** Same as the corresponding field in @c svn_repos_parse_fns2_t. */ 01782 svn_error_t *(*remove_node_props)(void *node_baton); 01783 /** Same as the corresponding field in @c svn_repos_parse_fns2_t. */ 01784 svn_error_t *(*set_fulltext)(svn_stream_t **stream, 01785 void *node_baton); 01786 /** Same as the corresponding field in @c svn_repos_parse_fns2_t. */ 01787 svn_error_t *(*close_node)(void *node_baton); 01788 /** Same as the corresponding field in @c svn_repos_parse_fns2_t. */ 01789 svn_error_t *(*close_revision)(void *revision_baton); 01790 } svn_repos_parser_fns_t; 01791 01792 01793 /** 01794 * Similar to svn_repos_parse_dumpstream2(), but uses the more limited 01795 * @c svn_repos_parser_fns_t vtable type. 01796 * 01797 * @deprecated Provided for backward compatibility with the 1.0 API. 01798 */ 01799 svn_error_t * 01800 svn_repos_parse_dumpstream(svn_stream_t *stream, 01801 const svn_repos_parser_fns_t *parse_fns, 01802 void *parse_baton, 01803 svn_cancel_func_t cancel_func, 01804 void *cancel_baton, 01805 apr_pool_t *pool); 01806 01807 01808 /** 01809 * Similar to svn_repos_get_fs_build_parser2(), but yields the more 01810 * limited svn_repos_parser_fns_t vtable type. 01811 * 01812 * @deprecated Provided for backward compatibility with the 1.0 API. 01813 */ 01814 svn_error_t * 01815 svn_repos_get_fs_build_parser(const svn_repos_parser_fns_t **parser, 01816 void **parse_baton, 01817 svn_repos_t *repos, 01818 svn_boolean_t use_history, 01819 enum svn_repos_load_uuid uuid_action, 01820 svn_stream_t *outstream, 01821 const char *parent_dir, 01822 apr_pool_t *pool); 01823 01824 01825 /** @} */ 01826 01827 /** A data type which stores the authz information. 01828 * 01829 * @since New in 1.3. 01830 */ 01831 typedef struct svn_authz_t svn_authz_t; 01832 01833 /** Read authz configuration data from @a file (a file or registry 01834 * path) into @a *authz_p, allocated in @a pool. 01835 * 01836 * If @a file is not a valid authz rule file, then return 01837 * SVN_AUTHZ_INVALID_CONFIG. The contents of @a *authz_p is then 01838 * undefined. If @a must_exist is TRUE, a missing authz file is also 01839 * an error. 01840 * 01841 * @since New in 1.3. 01842 */ 01843 svn_error_t * 01844 svn_repos_authz_read(svn_authz_t **authz_p, const char *file, 01845 svn_boolean_t must_exist, apr_pool_t *pool); 01846 01847 /** 01848 * Check whether @a user can access @a path in the repository @a 01849 * repos_name with the @a required_access. @a authz lists the ACLs to 01850 * check against. Set @a *access_granted to indicate if the requested 01851 * access is granted. 01852 * 01853 * If @a path is NULL, then check whether @a user has the @a 01854 * required_access anywhere in the repository. Set @a *access_granted 01855 * to TRUE if at least one path is accessible with the @a 01856 * required_access. 01857 * 01858 * @since New in 1.3. 01859 */ 01860 svn_error_t * 01861 svn_repos_authz_check_access(svn_authz_t *authz, const char *repos_name, 01862 const char *path, const char *user, 01863 svn_repos_authz_access_t required_access, 01864 svn_boolean_t *access_granted, 01865 apr_pool_t *pool); 01866 01867 #ifdef __cplusplus 01868 } 01869 #endif /* __cplusplus */ 01870 01871 #endif /* SVN_REPOS_H */