3 * ====================================================================
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
20 * ====================================================================
24 * @brief Tools built on top of the filesystem.
30 #include <apr_pools.h>
32 #include <apr_tables.h>
35 #include "svn_types.h"
36 #include "svn_string.h"
37 #include "svn_delta.h"
40 #include "svn_mergeinfo.h"
45 #endif /* __cplusplus */
47 /* ---------------------------------------------------------------*/
50 * Get libsvn_repos version information.
55 svn_repos_version(void);
58 /* Some useful enums. They need to be declared here for the notification
59 system to pick them up. */
60 /** The different "actions" attached to nodes in the dumpfile. */
63 svn_node_action_change,
65 svn_node_action_delete,
66 svn_node_action_replace
70 /** @defgroup svn_repos_authz_callbacks Repository authorization callbacks
74 /** Callback type for checking authorization on a path.
76 * Set @a *allowed to TRUE to indicate that some operation is
77 * authorized for @a path in @a root, or set it to FALSE to indicate
78 * unauthorized (presumably according to state stored in @a baton).
80 * Do not assume @a pool has any lifetime beyond this call.
82 * The exact operation being authorized depends on the callback
83 * implementation. For read authorization, for example, the caller
84 * would implement an instance that does read checking, and pass it as
85 * a parameter named [perhaps] 'authz_read_func'. The receiver of
86 * that parameter might also take another parameter named
87 * 'authz_write_func', which although sharing this type, would be a
88 * different implementation.
90 * @note If someday we want more sophisticated authorization states
91 * than just yes/no, @a allowed can become an enum type.
93 typedef svn_error_t *(*svn_repos_authz_func_t)(svn_boolean_t *allowed,
100 /** An enum defining the kinds of access authz looks up.
104 typedef enum svn_repos_authz_access_t
109 /** Path can be read. */
112 /** Path can be altered. */
115 /** The other access credentials are recursive. */
116 svn_authz_recursive = 4
117 } svn_repos_authz_access_t;
120 /** Callback type for checking authorization on paths produced by
121 * the repository commit editor.
123 * Set @a *allowed to TRUE to indicate that the @a required access on
124 * @a path in @a root is authorized, or set it to FALSE to indicate
125 * unauthorized (presumable according to state stored in @a baton).
127 * If @a path is NULL, the callback should perform a global authz
128 * lookup for the @a required access. That is, the lookup should
129 * check if the @a required access is granted for at least one path of
130 * the repository, and set @a *allowed to TRUE if so. @a root may
131 * also be NULL if @a path is NULL.
133 * This callback is very similar to svn_repos_authz_func_t, with the
134 * exception of the addition of the @a required parameter.
135 * This is due to historical reasons: when authz was first implemented
136 * for svn_repos_dir_delta2(), it seemed there would need only checks
137 * for read and write operations, hence the svn_repos_authz_func_t
138 * callback prototype and usage scenario. But it was then realized
139 * that lookups due to copying needed to be recursive, and that
140 * brute-force recursive lookups didn't square with the O(1)
141 * performances a copy operation should have.
143 * So a special way to ask for a recursive lookup was introduced. The
144 * commit editor needs this capability to retain acceptable
145 * performance. Instead of revving the existing callback, causing
146 * unnecessary revving of functions that don't actually need the
147 * extended functionality, this second, more complete callback was
148 * introduced, for use by the commit editor.
150 * Some day, it would be nice to reunite these two callbacks and do
151 * the necessary revving anyway, but for the time being, this dual
152 * callback mechanism will do.
154 typedef svn_error_t *(*svn_repos_authz_callback_t)
155 (svn_repos_authz_access_t required,
156 svn_boolean_t *allowed,
165 /** @defgroup svn_repos_notifications Repository notifications
169 /* Notification system. */
171 /** The type of action occurring.
175 typedef enum svn_repos_notify_action_t
177 /** A warning message is waiting. */
178 svn_repos_notify_warning = 0,
180 /** A revision has finished being dumped. */
181 svn_repos_notify_dump_rev_end,
183 /** A revision has finished being verified. */
184 svn_repos_notify_verify_rev_end,
186 /** All revisions have finished being dumped. */
187 svn_repos_notify_dump_end,
189 /** All revisions have finished being verified. */
190 svn_repos_notify_verify_end,
192 /** packing of an FSFS shard has commenced */
193 svn_repos_notify_pack_shard_start,
195 /** packing of an FSFS shard is completed */
196 svn_repos_notify_pack_shard_end,
198 /** packing of the shard revprops has commenced */
199 svn_repos_notify_pack_shard_start_revprop,
201 /** packing of the shard revprops has completed */
202 svn_repos_notify_pack_shard_end_revprop,
204 /** A revision has begun loading */
205 svn_repos_notify_load_txn_start,
207 /** A revision has finished loading */
208 svn_repos_notify_load_txn_committed,
210 /** A node has begun loading */
211 svn_repos_notify_load_node_start,
213 /** A node has finished loading */
214 svn_repos_notify_load_node_done,
216 /** A copied node has been encountered */
217 svn_repos_notify_load_copied_node,
219 /** Mergeinfo has been normalized */
220 svn_repos_notify_load_normalized_mergeinfo,
222 /** The operation has acquired a mutex for the repo. */
223 svn_repos_notify_mutex_acquired,
225 /** Recover has started. */
226 svn_repos_notify_recover_start,
228 /** Upgrade has started. */
229 svn_repos_notify_upgrade_start,
231 /** A revision was skipped during loading. @since New in 1.8. */
232 svn_repos_notify_load_skipped_rev,
234 /** The structure of a revision is being verified. @since New in 1.8. */
235 svn_repos_notify_verify_rev_structure,
237 /** A revprop shard got packed. @since New in 1.9. */
238 svn_repos_notify_pack_revprops,
240 /** A non-packed revprop shard got removed. @since New in 1.9. */
241 svn_repos_notify_cleanup_revprops,
243 /** The repository format got bumped. @since New in 1.9. */
244 svn_repos_notify_format_bumped,
246 /** A revision range was copied. @since New in 1.9. */
247 svn_repos_notify_hotcopy_rev_range
248 } svn_repos_notify_action_t;
250 /** The type of warning occurring.
254 typedef enum svn_repos_notify_warning_t
256 /** Referencing copy source data from a revision earlier than the
257 * first revision dumped. */
258 svn_repos_notify_warning_found_old_reference,
260 /** An #SVN_PROP_MERGEINFO property's encoded mergeinfo references a
261 * revision earlier than the first revision dumped. */
262 svn_repos_notify_warning_found_old_mergeinfo,
264 /** Found an invalid path in the filesystem.
265 * @see svn_fs.h:"Directory entry names and directory paths" */
266 /* ### TODO(doxygen): make that a proper doxygen link */
267 /* See svn_fs__path_valid(). */
268 svn_repos_notify_warning_invalid_fspath,
271 * Detected a name collision. Reported when the names of two or more
272 * entries in the same directory differ only in character
273 * representation (normalization), but are otherwise identical.
277 svn_repos_notify_warning_name_collision,
280 * Detected a mergeinfo path collision. Reported when the paths in
281 * two or more entries in the same svn:mergeinfo property differ
282 * only in character representation (normalization), but are
283 * otherwise identical.
287 svn_repos_notify_warning_mergeinfo_collision,
290 * Detected invalid mergeinfo.
294 svn_repos_notify_warning_invalid_mergeinfo
295 } svn_repos_notify_warning_t;
298 * Structure used by #svn_repos_notify_func_t.
300 * The only field guaranteed to be populated is @c action. Other fields are
301 * dependent upon the @c action. (See individual fields for more information.)
303 * @note Callers of notification functions should use
304 * svn_repos_notify_create() to create structures of this type to allow for
305 * future extensibility.
309 typedef struct svn_repos_notify_t
311 /** Action that describes what happened in the repository. */
312 svn_repos_notify_action_t action;
314 /** For #svn_repos_notify_dump_rev_end and #svn_repos_notify_verify_rev_end,
315 * the revision which just completed.
316 * For #svn_fs_upgrade_format_bumped, the new format version. */
317 svn_revnum_t revision;
319 /** For #svn_repos_notify_warning, the warning message. */
320 const char *warning_str;
321 /** For #svn_repos_notify_warning, the warning type. */
322 svn_repos_notify_warning_t warning;
324 /** For #svn_repos_notify_pack_shard_start,
325 #svn_repos_notify_pack_shard_end,
326 #svn_repos_notify_pack_revprops,
327 #svn_repos_notify_cleanup_revprops
328 #svn_repos_notify_pack_shard_start_revprop, and
329 #svn_repos_notify_pack_shard_end_revprop, the shard processed. */
332 /** For #svn_repos_notify_load_txn_committed, the revision committed. */
333 svn_revnum_t new_revision;
335 /** For #svn_repos_notify_load_txn_committed, the source revision, if
336 different from @a new_revision, otherwise #SVN_INVALID_REVNUM.
337 For #svn_repos_notify_load_txn_start and
338 #svn_repos_notify_load_skipped_rev, the source revision. */
339 svn_revnum_t old_revision;
341 /** For #svn_repos_notify_load_node_start, the action being taken on the
343 enum svn_node_action node_action;
345 /** For #svn_repos_notify_load_node_start, the path of the node. */
348 /** For #svn_repos_notify_hotcopy_rev_range, the start of the copied
350 @since New in 1.9. */
351 svn_revnum_t start_revision;
353 /** For #svn_repos_notify_hotcopy_rev_range, the end of the copied
354 revision range (might be the same as @a start_revision).
355 @since New in 1.9. */
356 svn_revnum_t end_revision;
358 /* NOTE: Add new fields at the end to preserve binary compatibility.
359 Also, if you add fields here, you have to update
360 svn_repos_notify_create(). */
361 } svn_repos_notify_t;
363 /** Callback for providing notification from the repository.
364 * Returns @c void. Justification: success of an operation is not dependent
365 * upon successful notification of that operation.
367 * @since New in 1.7. */
368 typedef void (*svn_repos_notify_func_t)(void *baton,
369 const svn_repos_notify_t *notify,
370 apr_pool_t *scratch_pool);
373 * Allocate an #svn_repos_notify_t structure in @a result_pool, initialize
379 svn_repos_notify_create(svn_repos_notify_action_t action,
380 apr_pool_t *result_pool);
385 /** The repository object. */
386 typedef struct svn_repos_t svn_repos_t;
388 /* Opening and creating repositories. */
391 /** Find the root path of the repository that contains @a path.
393 * If a repository was found, the path to the root of the repository
394 * is returned, else @c NULL. The pointer to the returned path may be
398 svn_repos_find_root_path(const char *path,
401 /** Set @a *repos_p to a repository object for the repository at @a path.
403 * Allocate @a *repos_p in @a result_pool.
405 * Acquires a shared lock on the repository, and attaches a cleanup
406 * function to @a result_pool to remove the lock. If no lock can be acquired,
407 * returns error, with undefined effect on @a *repos_p. If an exclusive
408 * lock is present, this blocks until it's gone. @a fs_config will be
409 * passed to the filesystem initialization function and may be @c NULL.
411 * Use @a scratch_pool for temporary allocations.
416 svn_repos_open3(svn_repos_t **repos_p,
418 apr_hash_t *fs_config,
419 apr_pool_t *result_pool,
420 apr_pool_t *scratch_pool);
422 /** Similar to svn_repos_open3() but without @a scratch_pool.
424 * @deprecated Provided for backward compatibility with 1.8 API.
429 svn_repos_open2(svn_repos_t **repos_p,
431 apr_hash_t *fs_config,
434 /** Similar to svn_repos_open2() with @a fs_config set to NULL.
436 * @deprecated Provided for backward compatibility with 1.6 API.
440 svn_repos_open(svn_repos_t **repos_p,
444 /** Create a new Subversion repository at @a path, building the necessary
445 * directory structure, creating the filesystem, and so on.
446 * Return the repository object in @a *repos_p, allocated in @a pool.
448 * @a config is a client configuration hash of #svn_config_t * items
449 * keyed on config category names, and may be NULL.
451 * @a fs_config is passed to the filesystem, and may be NULL.
453 * @a unused_1 and @a unused_2 are not used and should be NULL.
456 svn_repos_create(svn_repos_t **repos_p,
458 const char *unused_1,
459 const char *unused_2,
461 apr_hash_t *fs_config,
465 * Upgrade the Subversion repository (and its underlying versioned
466 * filesystem) located in the directory @a path to the latest version
467 * supported by this library. If the requested upgrade is not
468 * supported due to the current state of the repository or it
469 * underlying filesystem, return #SVN_ERR_REPOS_UNSUPPORTED_UPGRADE
470 * or #SVN_ERR_FS_UNSUPPORTED_UPGRADE (respectively) and make no
471 * changes to the repository or filesystem.
473 * Acquires an exclusive lock on the repository, upgrades the
474 * repository, and releases the lock. If an exclusive lock can't be
475 * acquired, returns error.
477 * If @a nonblocking is TRUE, an error of type EWOULDBLOCK is
478 * returned if the lock is not immediately available.
480 * If @a start_callback is not NULL, it will be called with @a
481 * start_callback_baton as argument before the upgrade starts, but
482 * after the exclusive lock has been acquired.
484 * Use @a pool for necessary allocations.
486 * @note This functionality is provided as a convenience for
487 * administrators wishing to make use of new Subversion functionality
488 * without a potentially costly full repository dump/load. As such,
489 * the operation performs only the minimum amount of work needed to
490 * accomplish this while maintaining the integrity of the repository.
491 * It does *not* guarantee the most optimized repository state as a
492 * dump and subsequent load would.
494 * @note On some platforms the exclusive lock does not exclude other
495 * threads in the same process so this function should only be called
496 * by a single threaded process, or by a multi-threaded process when
497 * no other threads are accessing the repository.
502 svn_repos_upgrade2(const char *path,
503 svn_boolean_t nonblocking,
504 svn_repos_notify_func_t notify_func,
509 * Similar to svn_repos_upgrade2(), but with @a start_callback and baton,
510 * rather than a notify_callback / baton
513 * @deprecated Provided for backward compatibility with the 1.6 API.
517 svn_repos_upgrade(const char *path,
518 svn_boolean_t nonblocking,
519 svn_error_t *(*start_callback)(void *baton),
520 void *start_callback_baton,
523 /** Destroy the Subversion repository found at @a path, using @a pool for any
524 * necessary allocations.
527 svn_repos_delete(const char *path,
531 /** @defgroup svn_repos_capabilities Repository capabilities
536 * Set @a *has to TRUE if @a repos has @a capability (one of the
537 * capabilities beginning with @c "SVN_REPOS_CAPABILITY_"), else set
540 * If @a capability isn't recognized, throw #SVN_ERR_UNKNOWN_CAPABILITY,
541 * with the effect on @a *has undefined.
543 * Use @a pool for all allocation.
548 svn_repos_has_capability(svn_repos_t *repos,
550 const char *capability,
554 * Return a set of @a capabilities supported by the running Subversion
555 * library and by @a repos. (Capabilities supported by this version of
556 * Subversion but not by @a repos are not listed. This may happen when
557 * svn_repos_upgrade2() has not been called after a software upgrade.)
559 * The set is represented as a hash whose const char * keys are the set
560 * members. The values are not defined.
562 * Allocate @a capabilities in @a result_pool and use @a scratch_pool for
563 * temporary allocations.
565 * @see svn_repos_info_format
570 svn_repos_capabilities(apr_hash_t **capabilities,
572 apr_pool_t *result_pool,
573 apr_pool_t *scratch_pool);
576 * The capability of doing the right thing with merge-tracking
577 * information, both storing it and responding to queries about it.
581 #define SVN_REPOS_CAPABILITY_MERGEINFO "mergeinfo"
582 /* *** PLEASE READ THIS IF YOU ADD A NEW CAPABILITY ***
584 * @c SVN_REPOS_CAPABILITY_foo strings should not include colons, to
585 * be consistent with @c SVN_RA_CAPABILITY_foo strings, which forbid
586 * colons for their own reasons. While this RA limitation has no
587 * direct impact on repository capabilities, there's no reason to be
588 * gratuitously different either.
590 * If you add a capability, update svn_repos_capabilities().
597 * Store in @a repos the client-reported capabilities @a capabilities,
598 * which must be allocated in memory at least as long-lived as @a repos.
600 * The elements of @a capabilities are 'const char *', a subset of
601 * the constants beginning with @c SVN_RA_CAPABILITY_.
602 * @a capabilities is not copied, so changing it later will affect
603 * what is remembered by @a repos.
605 * @note The capabilities are passed along to the start-commit hook;
606 * see that hook's template for details.
608 * @note As of Subversion 1.5, there are no error conditions defined,
609 * so this always returns SVN_NO_ERROR. In future releases it may
610 * return error, however, so callers should check.
615 svn_repos_remember_client_capabilities(svn_repos_t *repos,
616 const apr_array_header_t *capabilities);
619 /** Return the filesystem associated with repository object @a repos. */
621 svn_repos_fs(svn_repos_t *repos);
623 /** Return the type of filesystem associated with repository object
624 * @a repos allocated in @a result_pool.
626 * @see #svn_fs_backend_names
631 svn_repos_fs_type(svn_repos_t *repos,
632 apr_pool_t *result_pool);
634 /** Make a hot copy of the Subversion repository found at @a src_path
637 * Copy a possibly live Subversion repository from @a src_path to
638 * @a dst_path. If @a clean_logs is @c TRUE, perform cleanup on the
639 * source filesystem as part of the copy operation; currently, this
640 * means deleting copied, unused logfiles for a Berkeley DB source
643 * If @a incremental is TRUE, make an effort to not re-copy information
644 * already present in the destination. If incremental hotcopy is not
645 * implemented by the filesystem backend, raise SVN_ERR_UNSUPPORTED_FEATURE.
647 * For each revision range copied, the @a notify_func function will be
648 * called with the @a notify_baton and a notification structure containing
649 * appropriate values in @c start_revision and @c end_revision (both
650 * inclusive). @c start_revision might be equal to @c end_revision in
651 * case the copied range consists of a single revision. Currently, this
652 * notification is not triggered by the BDB backend. @a notify_func
653 * may be @c NULL if this notification is not required.
655 * The optional @a cancel_func callback will be invoked with
656 * @a cancel_baton as usual to allow the user to preempt this potentially
659 * Use @a scratch_pool for temporary allocations.
664 svn_repos_hotcopy3(const char *src_path,
665 const char *dst_path,
666 svn_boolean_t clean_logs,
667 svn_boolean_t incremental,
668 svn_repos_notify_func_t notify_func,
670 svn_cancel_func_t cancel_func,
672 apr_pool_t *scratch_pool);
675 * Like svn_repos_hotcopy3(), but with @a notify_func and @a notify_baton
676 * always passed as @c NULL.
679 * @deprecated Provided for backward compatibility with the 1.8 API.
683 svn_repos_hotcopy2(const char *src_path,
684 const char *dst_path,
685 svn_boolean_t clean_logs,
686 svn_boolean_t incremental,
687 svn_cancel_func_t cancel_func,
692 * Like svn_repos_hotcopy2(), but with @a incremental always passed as
693 * @c FALSE and without cancellation support.
695 * @deprecated Provided for backward compatibility with the 1.6 API.
699 svn_repos_hotcopy(const char *src_path,
700 const char *dst_path,
701 svn_boolean_t clean_logs,
706 * Possibly update the repository, @a repos, to use a more efficient
707 * filesystem representation. Use @a pool for allocations.
712 svn_repos_fs_pack2(svn_repos_t *repos,
713 svn_repos_notify_func_t notify_func,
715 svn_cancel_func_t cancel_func,
720 * Similar to svn_repos_fs_pack2(), but with a #svn_fs_pack_notify_t instead
721 * of a #svn_repos_notify_t.
724 * @deprecated Provided for backward compatibility with the 1.6 API.
728 svn_repos_fs_pack(svn_repos_t *repos,
729 svn_fs_pack_notify_t notify_func,
731 svn_cancel_func_t cancel_func,
736 * Run database recovery procedures on the repository at @a path,
737 * returning the database to a consistent state. Use @a pool for all
740 * Acquires an exclusive lock on the repository, recovers the
741 * database, and releases the lock. If an exclusive lock can't be
742 * acquired, returns error.
744 * If @a nonblocking is TRUE, an error of type EWOULDBLOCK is
745 * returned if the lock is not immediately available.
747 * If @a notify_func is not NULL, it will be called with @a
748 * notify_baton as argument before the recovery starts, but
749 * after the exclusive lock has been acquired.
751 * If @a cancel_func is not @c NULL, it is called periodically with
752 * @a cancel_baton as argument to see if the client wishes to cancel
755 * @note On some platforms the exclusive lock does not exclude other
756 * threads in the same process so this function should only be called
757 * by a single threaded process, or by a multi-threaded process when
758 * no other threads are accessing the repository.
763 svn_repos_recover4(const char *path,
764 svn_boolean_t nonblocking,
765 svn_repos_notify_func_t notify_func,
767 svn_cancel_func_t cancel_func,
772 * Similar to svn_repos_recover4(), but with @a start callback in place of
773 * the notify_func / baton.
776 * @deprecated Provided for backward compatibility with the 1.6 API.
780 svn_repos_recover3(const char *path,
781 svn_boolean_t nonblocking,
782 svn_error_t *(*start_callback)(void *baton),
783 void *start_callback_baton,
784 svn_cancel_func_t cancel_func,
789 * Similar to svn_repos_recover3(), but without cancellation support.
791 * @deprecated Provided for backward compatibility with the 1.4 API.
795 svn_repos_recover2(const char *path,
796 svn_boolean_t nonblocking,
797 svn_error_t *(*start_callback)(void *baton),
798 void *start_callback_baton,
802 * Similar to svn_repos_recover2(), but with nonblocking set to FALSE, and
803 * with no callbacks provided.
805 * @deprecated Provided for backward compatibility with the 1.0 API.
809 svn_repos_recover(const char *path,
813 * Callback for svn_repos_freeze.
817 typedef svn_error_t *(*svn_repos_freeze_func_t)(void *baton, apr_pool_t *pool);
820 * Take an exclusive lock on each of the repositories in @a paths to
821 * prevent commits and then while holding all the locks invoke @a
822 * freeze_func passing @a freeze_baton. Each repository may be readable by
823 * Subversion while frozen, or may be unreadable, depending on which
824 * FS backend the repository uses. Repositories are locked in the
825 * order in which they are specified in the array.
827 * @note @a freeze_func must not, directly or indirectly, call any function
828 * that attempts to take out a lock on the underlying repository. These
829 * include functions for packing, hotcopying, setting revprops and commits.
830 * Attempts to do so may result in a deadlock.
832 * @note On some platforms the exclusive lock does not exclude other
833 * threads in the same process so this function should only be called
834 * by a single threaded process, or by a multi-threaded process when
835 * no other threads are accessing the repositories.
840 svn_repos_freeze(apr_array_header_t *paths,
841 svn_repos_freeze_func_t freeze_func,
845 /** This function is a wrapper around svn_fs_berkeley_logfiles(),
846 * returning log file paths relative to the root of the repository.
848 * @copydoc svn_fs_berkeley_logfiles()
851 svn_repos_db_logfiles(apr_array_header_t **logfiles,
853 svn_boolean_t only_unused,
858 /* Repository Paths */
860 /** Return the top-level repository path allocated in @a pool. */
862 svn_repos_path(svn_repos_t *repos,
865 /** Return the path to @a repos's filesystem directory, allocated in
869 svn_repos_db_env(svn_repos_t *repos,
872 /** Return path to @a repos's config directory, allocated in @a pool. */
874 svn_repos_conf_dir(svn_repos_t *repos,
877 /** Return path to @a repos's svnserve.conf, allocated in @a pool. */
879 svn_repos_svnserve_conf(svn_repos_t *repos,
882 /** Return path to @a repos's lock directory, allocated in @a pool. */
884 svn_repos_lock_dir(svn_repos_t *repos,
887 /** Return path to @a repos's db lockfile, allocated in @a pool. */
889 svn_repos_db_lockfile(svn_repos_t *repos,
892 /** Return path to @a repos's db logs lockfile, allocated in @a pool. */
894 svn_repos_db_logs_lockfile(svn_repos_t *repos,
897 /** Return the path to @a repos's hook directory, allocated in @a pool. */
899 svn_repos_hook_dir(svn_repos_t *repos,
902 /** Return the path to @a repos's start-commit hook, allocated in @a pool. */
904 svn_repos_start_commit_hook(svn_repos_t *repos,
907 /** Return the path to @a repos's pre-commit hook, allocated in @a pool. */
909 svn_repos_pre_commit_hook(svn_repos_t *repos,
912 /** Return the path to @a repos's post-commit hook, allocated in @a pool. */
914 svn_repos_post_commit_hook(svn_repos_t *repos,
917 /** Return the path to @a repos's pre-revprop-change hook, allocated in
921 svn_repos_pre_revprop_change_hook(svn_repos_t *repos,
924 /** Return the path to @a repos's post-revprop-change hook, allocated in
928 svn_repos_post_revprop_change_hook(svn_repos_t *repos,
932 /** @defgroup svn_repos_lock_hooks Paths to lock hooks
934 * @since New in 1.2. */
936 /** Return the path to @a repos's pre-lock hook, allocated in @a pool. */
938 svn_repos_pre_lock_hook(svn_repos_t *repos,
941 /** Return the path to @a repos's post-lock hook, allocated in @a pool. */
943 svn_repos_post_lock_hook(svn_repos_t *repos,
946 /** Return the path to @a repos's pre-unlock hook, allocated in @a pool. */
948 svn_repos_pre_unlock_hook(svn_repos_t *repos,
951 /** Return the path to @a repos's post-unlock hook, allocated in @a pool. */
953 svn_repos_post_unlock_hook(svn_repos_t *repos,
956 /** Specify that Subversion should consult the configuration file
957 * located at @a hooks_env_path to determine how to setup the
958 * environment for hook scripts invoked for the repository @a repos.
959 * As a special case, if @a hooks_env_path is @c NULL, look for the
960 * file in its default location within the repository disk structure.
961 * If @a hooks_env_path is not absolute, it specifies a path relative
962 * to the parent of the file's default location.
964 * Use @a scratch_pool for temporary allocations.
966 * If this function is not called, or if the specified configuration
967 * file does not define any environment variables, hooks will run in
968 * an empty environment.
973 svn_repos_hooks_setenv(svn_repos_t *repos,
974 const char *hooks_env_path,
975 apr_pool_t *scratch_pool);
979 /* ---------------------------------------------------------------*/
981 /* Reporting the state of a working copy, for updates. */
985 * Construct and return a @a report_baton that will be passed to the
986 * other functions in this section to describe the state of a pre-existing
987 * tree (typically, a working copy). When the report is finished,
988 * @a editor/@a edit_baton will be driven in such a way as to transform the
989 * existing tree to @a revnum and, if @a tgt_path is non-NULL, switch the
990 * reported hierarchy to @a tgt_path.
992 * @a fs_base is the absolute path of the node in the filesystem at which
993 * the comparison should be rooted. @a target is a single path component,
994 * used to limit the scope of the report to a single entry of @a fs_base,
995 * or "" if all of @a fs_base itself is the main subject of the report.
997 * @a tgt_path and @a revnum is the fs path/revision pair that is the
998 * "target" of the delta. @a tgt_path should be provided only when
999 * the source and target paths of the report differ. That is, @a tgt_path
1000 * should *only* be specified when specifying that the resultant editor
1001 * drive be one that transforms the reported hierarchy into a pristine tree
1002 * of @a tgt_path at revision @a revnum. A @c NULL value for @a tgt_path
1003 * will indicate that the editor should be driven in such a way as to
1004 * transform the reported hierarchy to revision @a revnum, preserving the
1005 * reported hierarchy.
1007 * @a text_deltas instructs the driver of the @a editor to enable
1008 * the generation of text deltas.
1010 * @a ignore_ancestry instructs the driver to ignore node ancestry
1011 * when determining how to transmit differences.
1013 * @a send_copyfrom_args instructs the driver to send 'copyfrom'
1014 * arguments to the editor's add_file() and add_directory() methods,
1015 * whenever it deems feasible.
1017 * Use @a authz_read_func and @a authz_read_baton (if not @c NULL) to
1018 * avoid sending data through @a editor/@a edit_baton which is not
1019 * authorized for transmission.
1021 * @a zero_copy_limit controls the maximum size (in bytes) at which
1022 * data blocks may be sent using the zero-copy code path. On that
1023 * path, a number of in-memory copy operations have been eliminated to
1024 * maximize throughput. However, until the whole block has been
1025 * pushed to the network stack, other clients block, so be careful
1026 * when using larger values here. Pass 0 for @a zero_copy_limit to
1027 * disable this optimization altogether.
1029 * @note Never activate this optimization if @a editor might access
1030 * any FSFS data structures (and, hence, caches). So, it is basically
1031 * safe for networked editors only.
1033 * All allocation for the context and collected state will occur in
1036 * @a depth is the requested depth of the editor drive.
1038 * If @a depth is #svn_depth_unknown, the editor will affect only the
1039 * paths reported by the individual calls to svn_repos_set_path3() and
1040 * svn_repos_link_path3().
1042 * For example, if the reported tree is the @c A subdir of the Greek Tree
1043 * (see Subversion's test suite), at depth #svn_depth_empty, but the
1044 * @c A/B subdir is reported at depth #svn_depth_infinity, then
1045 * repository-side changes to @c A/mu, or underneath @c A/C and @c
1046 * A/D, would not be reflected in the editor drive, but changes
1047 * underneath @c A/B would be.
1049 * Additionally, the editor driver will call @c add_directory and
1050 * and @c add_file for directories with an appropriate depth. For
1051 * example, a directory reported at #svn_depth_files will receive
1052 * file (but not directory) additions. A directory at #svn_depth_empty
1053 * will receive neither.
1055 * If @a depth is #svn_depth_files, #svn_depth_immediates or
1056 * #svn_depth_infinity and @a depth is greater than the reported depth
1057 * of the working copy, then the editor driver will emit editor
1058 * operations so as to upgrade the working copy to this depth.
1060 * If @a depth is #svn_depth_empty, #svn_depth_files,
1061 * #svn_depth_immediates and @a depth is lower
1062 * than or equal to the depth of the working copy, then the editor
1063 * operations will affect only paths at or above @a depth.
1065 * @since New in 1.8.
1068 svn_repos_begin_report3(void **report_baton,
1069 svn_revnum_t revnum,
1071 const char *fs_base,
1073 const char *tgt_path,
1074 svn_boolean_t text_deltas,
1076 svn_boolean_t ignore_ancestry,
1077 svn_boolean_t send_copyfrom_args,
1078 const svn_delta_editor_t *editor,
1080 svn_repos_authz_func_t authz_read_func,
1081 void *authz_read_baton,
1082 apr_size_t zero_copy_limit,
1086 * The same as svn_repos_begin_report3(), but with @a zero_copy_limit
1087 * always passed as 0.
1089 * @since New in 1.5.
1090 * @deprecated Provided for backward compatibility with the 1.7 API.
1094 svn_repos_begin_report2(void **report_baton,
1095 svn_revnum_t revnum,
1097 const char *fs_base,
1099 const char *tgt_path,
1100 svn_boolean_t text_deltas,
1102 svn_boolean_t ignore_ancestry,
1103 svn_boolean_t send_copyfrom_args,
1104 const svn_delta_editor_t *editor,
1106 svn_repos_authz_func_t authz_read_func,
1107 void *authz_read_baton,
1111 * The same as svn_repos_begin_report2(), but taking a boolean
1112 * @a recurse flag, and sending FALSE for @a send_copyfrom_args.
1114 * If @a recurse is TRUE, the editor driver will drive the editor with
1115 * a depth of #svn_depth_infinity; if FALSE, then with a depth of
1118 * @note @a username is ignored, and has been removed in a revised
1119 * version of this API.
1121 * @deprecated Provided for backward compatibility with the 1.4 API.
1125 svn_repos_begin_report(void **report_baton,
1126 svn_revnum_t revnum,
1127 const char *username,
1129 const char *fs_base,
1131 const char *tgt_path,
1132 svn_boolean_t text_deltas,
1133 svn_boolean_t recurse,
1134 svn_boolean_t ignore_ancestry,
1135 const svn_delta_editor_t *editor,
1137 svn_repos_authz_func_t authz_read_func,
1138 void *authz_read_baton,
1143 * Given a @a report_baton constructed by svn_repos_begin_report3(),
1144 * record the presence of @a path, at @a revision with depth @a depth,
1145 * in the current tree.
1147 * @a path is relative to the anchor/target used in the creation of the
1150 * @a revision may be SVN_INVALID_REVNUM if (for example) @a path
1151 * represents a locally-added path with no revision number, or @a
1152 * depth is #svn_depth_exclude.
1154 * @a path may not be underneath a path on which svn_repos_set_path3()
1155 * was previously called with #svn_depth_exclude in this report.
1157 * The first call of this in a given report usually passes an empty
1158 * @a path; this is used to set up the correct root revision for the editor
1161 * A depth of #svn_depth_unknown is not allowed, and results in an
1164 * If @a start_empty is TRUE and @a path is a directory, then require the
1165 * caller to explicitly provide all the children of @a path - do not assume
1166 * that the tree also contains all the children of @a path at @a revision.
1167 * This is for 'low confidence' client reporting.
1169 * If the caller has a lock token for @a path, then @a lock_token should
1170 * be set to that token. Else, @a lock_token should be NULL.
1172 * All temporary allocations are done in @a pool.
1174 * @since New in 1.5.
1177 svn_repos_set_path3(void *report_baton,
1179 svn_revnum_t revision,
1181 svn_boolean_t start_empty,
1182 const char *lock_token,
1186 * Similar to svn_repos_set_path3(), but with @a depth set to
1187 * #svn_depth_infinity.
1189 * @deprecated Provided for backward compatibility with the 1.4 API.
1193 svn_repos_set_path2(void *report_baton,
1195 svn_revnum_t revision,
1196 svn_boolean_t start_empty,
1197 const char *lock_token,
1201 * Similar to svn_repos_set_path2(), but with @a lock_token set to @c NULL.
1203 * @deprecated Provided for backward compatibility with the 1.1 API.
1207 svn_repos_set_path(void *report_baton,
1209 svn_revnum_t revision,
1210 svn_boolean_t start_empty,
1214 * Given a @a report_baton constructed by svn_repos_begin_report3(),
1215 * record the presence of @a path in the current tree, containing the contents
1216 * of @a link_path at @a revision with depth @a depth.
1218 * A depth of #svn_depth_unknown is not allowed, and results in an
1221 * @a path may not be underneath a path on which svn_repos_set_path3()
1222 * was previously called with #svn_depth_exclude in this report.
1224 * Note that while @a path is relative to the anchor/target used in the
1225 * creation of the @a report_baton, @a link_path is an absolute filesystem
1228 * If @a start_empty is TRUE and @a path is a directory, then require the
1229 * caller to explicitly provide all the children of @a path - do not assume
1230 * that the tree also contains all the children of @a link_path at
1231 * @a revision. This is for 'low confidence' client reporting.
1233 * If the caller has a lock token for @a link_path, then @a lock_token
1234 * should be set to that token. Else, @a lock_token should be NULL.
1236 * All temporary allocations are done in @a pool.
1238 * @since New in 1.5.
1241 svn_repos_link_path3(void *report_baton,
1243 const char *link_path,
1244 svn_revnum_t revision,
1246 svn_boolean_t start_empty,
1247 const char *lock_token,
1251 * Similar to svn_repos_link_path3(), but with @a depth set to
1252 * #svn_depth_infinity.
1254 * @deprecated Provided for backward compatibility with the 1.4 API.
1258 svn_repos_link_path2(void *report_baton,
1260 const char *link_path,
1261 svn_revnum_t revision,
1262 svn_boolean_t start_empty,
1263 const char *lock_token,
1267 * Similar to svn_repos_link_path2(), but with @a lock_token set to @c NULL.
1269 * @deprecated Provided for backward compatibility with the 1.1 API.
1273 svn_repos_link_path(void *report_baton,
1275 const char *link_path,
1276 svn_revnum_t revision,
1277 svn_boolean_t start_empty,
1280 /** Given a @a report_baton constructed by svn_repos_begin_report3(),
1281 * record the non-existence of @a path in the current tree.
1283 * @a path may not be underneath a path on which svn_repos_set_path3()
1284 * was previously called with #svn_depth_exclude in this report.
1286 * (This allows the reporter's driver to describe missing pieces of a
1287 * working copy, so that 'svn up' can recreate them.)
1289 * All temporary allocations are done in @a pool.
1292 svn_repos_delete_path(void *report_baton,
1296 /** Given a @a report_baton constructed by svn_repos_begin_report3(),
1297 * finish the report and drive the editor as specified when the report
1298 * baton was constructed.
1300 * If an error occurs during the driving of the editor, do NOT abort the
1301 * edit; that responsibility belongs to the caller of this function, if
1302 * it happens at all.
1304 * After the call to this function, @a report_baton is no longer valid;
1305 * it should not be passed to any other reporting functions, including
1306 * svn_repos_abort_report(), even if this function returns an error.
1309 svn_repos_finish_report(void *report_baton,
1313 /** Given a @a report_baton constructed by svn_repos_begin_report3(),
1314 * abort the report. This function can be called anytime before
1315 * svn_repos_finish_report() is called.
1317 * After the call to this function, @a report_baton is no longer valid;
1318 * it should not be passed to any other reporting functions.
1321 svn_repos_abort_report(void *report_baton,
1325 /* ---------------------------------------------------------------*/
1327 /* The magical dir_delta update routines. */
1329 /** Use the provided @a editor and @a edit_baton to describe the changes
1330 * necessary for making a given node (and its descendants, if it is a
1331 * directory) under @a src_root look exactly like @a tgt_path under
1332 * @a tgt_root. @a src_entry is the node to update. If @a src_entry
1333 * is empty, then compute the difference between the entire tree
1334 * anchored at @a src_parent_dir under @a src_root and @a tgt_path
1335 * under @a tgt_root. Else, describe the changes needed to update
1336 * only that entry in @a src_parent_dir. Typically, callers of this
1337 * function will use a @a tgt_path that is the concatenation of @a
1338 * src_parent_dir and @a src_entry.
1340 * @a src_root and @a tgt_root can both be either revision or transaction
1341 * roots. If @a tgt_root is a revision, @a editor's set_target_revision()
1342 * will be called with the @a tgt_root's revision number, else it will
1343 * not be called at all.
1345 * If @a authz_read_func is non-NULL, invoke it before any call to
1347 * @a editor->open_root
1348 * @a editor->add_directory
1349 * @a editor->open_directory
1350 * @a editor->add_file
1351 * @a editor->open_file
1353 * passing @a tgt_root, the same path that would be passed to the
1354 * editor function in question, and @a authz_read_baton. If the
1355 * @a *allowed parameter comes back TRUE, then proceed with the planned
1356 * editor call; else if FALSE, then invoke @a editor->absent_file or
1357 * @a editor->absent_directory as appropriate, except if the planned
1358 * editor call was open_root, throw SVN_ERR_AUTHZ_ROOT_UNREADABLE.
1360 * If @a text_deltas is @c FALSE, send a single @c NULL txdelta window to
1361 * the window handler returned by @a editor->apply_textdelta().
1363 * If @a depth is #svn_depth_empty, invoke @a editor calls only on
1364 * @a src_entry (or @a src_parent_dir, if @a src_entry is empty).
1365 * If @a depth is #svn_depth_files, also invoke the editor on file
1366 * children, if any; if #svn_depth_immediates, invoke it on
1367 * immediate subdirectories as well as files; if #svn_depth_infinity,
1370 * If @a entry_props is @c TRUE, accompany each opened/added entry with
1371 * propchange editor calls that relay special "entry props" (this
1372 * is typically used only for working copy updates).
1374 * @a ignore_ancestry instructs the function to ignore node ancestry
1375 * when determining how to transmit differences.
1377 * Before completing successfully, this function calls @a editor's
1378 * close_edit(), so the caller should expect its @a edit_baton to be
1379 * invalid after its use with this function.
1381 * Do any allocation necessary for the delta computation in @a pool.
1382 * This function's maximum memory consumption is at most roughly
1383 * proportional to the greatest depth of the tree under @a tgt_root, not
1384 * the total size of the delta.
1386 * ### svn_repos_dir_delta2 is mostly superseded by the reporter
1387 * ### functionality (svn_repos_begin_report3 and friends).
1388 * ### svn_repos_dir_delta2 does allow the roots to be transaction
1389 * ### roots rather than just revision roots, and it has the
1390 * ### entry_props flag. Almost all of Subversion's own code uses the
1391 * ### reporter instead; there are some stray references to the
1392 * ### svn_repos_dir_delta[2] in comments which should probably
1393 * ### actually refer to the reporter.
1395 * @since New in 1.5.
1398 svn_repos_dir_delta2(svn_fs_root_t *src_root,
1399 const char *src_parent_dir,
1400 const char *src_entry,
1401 svn_fs_root_t *tgt_root,
1402 const char *tgt_path,
1403 const svn_delta_editor_t *editor,
1405 svn_repos_authz_func_t authz_read_func,
1406 void *authz_read_baton,
1407 svn_boolean_t text_deltas,
1409 svn_boolean_t entry_props,
1410 svn_boolean_t ignore_ancestry,
1414 * Similar to svn_repos_dir_delta2(), but if @a recurse is TRUE, pass
1415 * #svn_depth_infinity for @a depth, and if @a recurse is FALSE,
1416 * pass #svn_depth_files for @a depth.
1418 * @deprecated Provided for backward compatibility with the 1.4 API.
1422 svn_repos_dir_delta(svn_fs_root_t *src_root,
1423 const char *src_parent_dir,
1424 const char *src_entry,
1425 svn_fs_root_t *tgt_root,
1426 const char *tgt_path,
1427 const svn_delta_editor_t *editor,
1429 svn_repos_authz_func_t authz_read_func,
1430 void *authz_read_baton,
1431 svn_boolean_t text_deltas,
1432 svn_boolean_t recurse,
1433 svn_boolean_t entry_props,
1434 svn_boolean_t ignore_ancestry,
1438 /** Use the provided @a editor and @a edit_baton to describe the
1439 * skeletal changes made in a particular filesystem @a root
1440 * (revision or transaction).
1442 * Changes will be limited to those within @a base_dir, and if
1443 * @a low_water_mark is set to something other than #SVN_INVALID_REVNUM
1444 * it is assumed that the client has no knowledge of revisions prior to
1445 * @a low_water_mark. Together, these two arguments define the portion of
1446 * the tree that the client is assumed to have knowledge of, and thus any
1447 * copies of data from outside that part of the tree will be sent in their
1448 * entirety, not as simple copies or deltas against a previous version.
1450 * The @a editor passed to this function should be aware of the fact
1451 * that, if @a send_deltas is FALSE, calls to its change_dir_prop(),
1452 * change_file_prop(), and apply_textdelta() functions will not
1453 * contain meaningful data, and merely serve as indications that
1454 * properties or textual contents were changed.
1456 * If @a send_deltas is @c TRUE, the text and property deltas for changes
1457 * will be sent, otherwise NULL text deltas and empty prop changes will be
1460 * If @a authz_read_func is non-NULL, it will be used to determine if the
1461 * user has read access to the data being accessed. Data that the user
1462 * cannot access will be skipped.
1464 * @note This editor driver passes SVN_INVALID_REVNUM for all
1465 * revision parameters in the editor interface except the copyfrom
1466 * parameter of the add_file() and add_directory() editor functions.
1468 * @since New in 1.4.
1471 svn_repos_replay2(svn_fs_root_t *root,
1472 const char *base_dir,
1473 svn_revnum_t low_water_mark,
1474 svn_boolean_t send_deltas,
1475 const svn_delta_editor_t *editor,
1477 svn_repos_authz_func_t authz_read_func,
1478 void *authz_read_baton,
1482 * Similar to svn_repos_replay2(), but with @a base_dir set to @c "",
1483 * @a low_water_mark set to #SVN_INVALID_REVNUM, @a send_deltas
1484 * set to @c FALSE, and @a authz_read_func and @a authz_read_baton
1487 * @deprecated Provided for backward compatibility with the 1.3 API.
1491 svn_repos_replay(svn_fs_root_t *root,
1492 const svn_delta_editor_t *editor,
1496 /* ---------------------------------------------------------------*/
1498 /* Making commits. */
1501 * Return an @a editor and @a edit_baton to commit changes to the
1502 * filesystem of @a repos, beginning at location 'rev:@a base_path',
1503 * where "rev" is the argument given to open_root().
1505 * @a repos is a previously opened repository. @a repos_url_decoded is the
1506 * decoded URL to the base of the repository, and is used to check
1507 * copyfrom paths. @a txn is a filesystem transaction object to use
1508 * during the commit, or @c NULL to indicate that this function should
1509 * create (and fully manage) a new transaction.
1511 * Store the contents of @a revprop_table, a hash mapping <tt>const
1512 * char *</tt> property names to #svn_string_t values, as properties
1513 * of the commit transaction, including author and log message if
1516 * @note #SVN_PROP_REVISION_DATE may be present in @a revprop_table, but
1517 * it will be overwritten when the transaction is committed.
1519 * Iff @a authz_callback is provided, check read/write authorizations
1520 * on paths accessed by editor operations. An operation which fails
1521 * due to authz will return SVN_ERR_AUTHZ_UNREADABLE or
1522 * SVN_ERR_AUTHZ_UNWRITABLE.
1524 * Calling @a (*editor)->close_edit completes the commit.
1526 * If @a commit_callback is non-NULL, then before @c close_edit returns (but
1527 * after the commit has succeeded) @c close_edit will invoke
1528 * @a commit_callback with a filled-in #svn_commit_info_t *, @a commit_baton,
1529 * and @a pool or some subpool thereof as arguments. The @c repos_root field
1530 * of the #svn_commit_info_t is @c NULL. If @a commit_callback
1531 * returns an error, that error will be returned from @c close_edit,
1532 * otherwise if there was a post-commit hook failure, then that error
1533 * will be returned with code SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED.
1534 * (Note that prior to Subversion 1.6, @a commit_callback cannot be @c NULL;
1535 * if you don't need a callback, pass a dummy function.)
1537 * Calling @a (*editor)->abort_edit aborts the commit, and will also
1538 * abort the commit transaction unless @a txn was supplied (not @c
1539 * NULL). Callers who supply their own transactions are responsible
1540 * for cleaning them up (either by committing them, or aborting them).
1542 * @since New in 1.5. Since 1.6, @a commit_callback can be @c NULL.
1544 * @note Yes, @a repos_url_decoded is a <em>decoded</em> URL. We realize
1545 * that's sorta wonky. Sorry about that.
1547 * @note Like most commit editors, the returned editor requires that the
1548 * @c copyfrom_path parameter passed to its @c add_file and @c add_directory
1549 * methods is a full, URI-encoded URL, not a relative path.
1552 svn_repos_get_commit_editor5(const svn_delta_editor_t **editor,
1556 const char *repos_url_decoded,
1557 const char *base_path,
1558 apr_hash_t *revprop_table,
1559 svn_commit_callback2_t commit_callback,
1561 svn_repos_authz_callback_t authz_callback,
1566 * Similar to svn_repos_get_commit_editor5(), but with @a revprop_table
1567 * set to a hash containing @a user and @a log_msg as the
1568 * #SVN_PROP_REVISION_AUTHOR and #SVN_PROP_REVISION_LOG properties,
1569 * respectively. @a user and @a log_msg may both be @c NULL.
1571 * @since New in 1.4.
1573 * @deprecated Provided for backward compatibility with the 1.4 API.
1577 svn_repos_get_commit_editor4(const svn_delta_editor_t **editor,
1581 const char *repos_url,
1582 const char *base_path,
1584 const char *log_msg,
1585 svn_commit_callback2_t commit_callback,
1587 svn_repos_authz_callback_t authz_callback,
1592 * Similar to svn_repos_get_commit_editor4(), but
1593 * uses the svn_commit_callback_t type.
1595 * @since New in 1.3.
1597 * @deprecated Provided for backward compatibility with the 1.3 API.
1601 svn_repos_get_commit_editor3(const svn_delta_editor_t **editor,
1605 const char *repos_url,
1606 const char *base_path,
1608 const char *log_msg,
1609 svn_commit_callback_t callback,
1610 void *callback_baton,
1611 svn_repos_authz_callback_t authz_callback,
1616 * Similar to svn_repos_get_commit_editor3(), but with @a
1617 * authz_callback and @a authz_baton set to @c NULL.
1619 * @deprecated Provided for backward compatibility with the 1.2 API.
1623 svn_repos_get_commit_editor2(const svn_delta_editor_t **editor,
1627 const char *repos_url,
1628 const char *base_path,
1630 const char *log_msg,
1631 svn_commit_callback_t callback,
1632 void *callback_baton,
1637 * Similar to svn_repos_get_commit_editor2(), but with @a txn always
1640 * @deprecated Provided for backward compatibility with the 1.1 API.
1644 svn_repos_get_commit_editor(const svn_delta_editor_t **editor,
1647 const char *repos_url,
1648 const char *base_path,
1650 const char *log_msg,
1651 svn_commit_callback_t callback,
1652 void *callback_baton,
1655 /* ---------------------------------------------------------------*/
1657 /* Finding particular revisions. */
1659 /** Set @a *revision to the revision number in @a repos's filesystem that was
1660 * youngest at time @a tm.
1663 svn_repos_dated_revision(svn_revnum_t *revision,
1669 /** Given a @a root/@a path within some filesystem, return three pieces of
1670 * information allocated in @a pool:
1672 * - set @a *committed_rev to the revision in which the object was
1673 * last modified. (In fs parlance, this is the revision in which
1674 * the particular node-rev-id was 'created'.)
1676 * - set @a *committed_date to the date of said revision, or @c NULL
1679 * - set @a *last_author to the author of said revision, or @c NULL
1683 svn_repos_get_committed_info(svn_revnum_t *committed_rev,
1684 const char **committed_date,
1685 const char **last_author,
1686 svn_fs_root_t *root,
1692 * Set @a *dirent to an #svn_dirent_t associated with @a path in @a
1693 * root. If @a path does not exist in @a root, set @a *dirent to
1694 * NULL. Use @a pool for memory allocation.
1696 * @since New in 1.2.
1699 svn_repos_stat(svn_dirent_t **dirent,
1700 svn_fs_root_t *root,
1706 * Given @a path which exists at revision @a start in @a fs, set
1707 * @a *deleted to the revision @a path was first deleted, within the
1708 * inclusive revision range bounded by @a start and @a end. If @a path
1709 * does not exist at revision @a start or was not deleted within the
1710 * specified range, then set @a *deleted to SVN_INVALID_REVNUM.
1711 * Use @a pool for memory allocation.
1713 * @since New in 1.5.
1716 svn_repos_deleted_rev(svn_fs_t *fs,
1720 svn_revnum_t *deleted,
1724 /** Callback type for use with svn_repos_history(). @a path and @a
1725 * revision represent interesting history locations in the lifetime
1726 * of the path passed to svn_repos_history(). @a baton is the same
1727 * baton given to svn_repos_history(). @a pool is provided for the
1728 * convenience of the implementor, who should not expect it to live
1729 * longer than a single callback call.
1731 * Signal to callback driver to stop processing/invoking this callback
1732 * by returning the #SVN_ERR_CEASE_INVOCATION error code.
1734 * @note SVN_ERR_CEASE_INVOCATION is new in 1.5.
1736 typedef svn_error_t *(*svn_repos_history_func_t)(void *baton,
1738 svn_revnum_t revision,
1742 * Call @a history_func (with @a history_baton) for each interesting
1743 * history location in the lifetime of @a path in @a fs, from the
1744 * youngest of @a end and @a start to the oldest. Stop processing if
1745 * @a history_func returns #SVN_ERR_CEASE_INVOCATION. Only cross
1746 * filesystem copy history if @a cross_copies is @c TRUE. And do all
1747 * of this in @a pool.
1749 * If @a authz_read_func is non-NULL, then use it (and @a
1750 * authz_read_baton) to verify that @a path in @a end is readable; if
1751 * not, return SVN_ERR_AUTHZ_UNREADABLE. Also verify the readability
1752 * of every ancestral path/revision pair before pushing them at @a
1753 * history_func. If a pair is deemed unreadable, then do not send
1754 * them; instead, immediately stop traversing history and return
1757 * @since New in 1.1.
1759 * @note SVN_ERR_CEASE_INVOCATION is new in 1.5.
1762 svn_repos_history2(svn_fs_t *fs,
1764 svn_repos_history_func_t history_func,
1765 void *history_baton,
1766 svn_repos_authz_func_t authz_read_func,
1767 void *authz_read_baton,
1770 svn_boolean_t cross_copies,
1774 * Similar to svn_repos_history2(), but with @a authz_read_func
1775 * and @a authz_read_baton always set to NULL.
1777 * @deprecated Provided for backward compatibility with the 1.0 API.
1781 svn_repos_history(svn_fs_t *fs,
1783 svn_repos_history_func_t history_func,
1784 void *history_baton,
1787 svn_boolean_t cross_copies,
1792 * Set @a *locations to be a mapping of the revisions to the paths of
1793 * the file @a fs_path present at the repository in revision
1794 * @a peg_revision, where the revisions are taken out of the array
1795 * @a location_revisions.
1797 * @a location_revisions is an array of svn_revnum_t's and @a *locations
1798 * maps 'svn_revnum_t *' to 'const char *'.
1800 * If optional @a authz_read_func is non-NULL, then use it (and @a
1801 * authz_read_baton) to verify that the peg-object is readable. If not,
1802 * return SVN_ERR_AUTHZ_UNREADABLE. Also use the @a authz_read_func
1803 * to check that every path returned in the hash is readable. If an
1804 * unreadable path is encountered, stop tracing and return
1807 * @a pool is used for all allocations.
1809 * @since New in 1.1.
1812 svn_repos_trace_node_locations(svn_fs_t *fs,
1813 apr_hash_t **locations,
1814 const char *fs_path,
1815 svn_revnum_t peg_revision,
1816 const apr_array_header_t *location_revisions,
1817 svn_repos_authz_func_t authz_read_func,
1818 void *authz_read_baton,
1823 * Call @a receiver and @a receiver_baton to report successive
1824 * location segments in revisions between @a start_rev and @a end_rev
1825 * (inclusive) for the line of history identified by the peg-object @a
1826 * path in @a peg_revision (and in @a repos).
1828 * @a end_rev may be #SVN_INVALID_REVNUM to indicate that you want
1829 * to trace the history of the object to its origin.
1831 * @a start_rev may be #SVN_INVALID_REVNUM to indicate "the HEAD
1832 * revision". Otherwise, @a start_rev must be younger than @a end_rev
1833 * (unless @a end_rev is #SVN_INVALID_REVNUM).
1835 * @a peg_revision may be #SVN_INVALID_REVNUM to indicate "the HEAD
1836 * revision", and must evaluate to be at least as young as @a start_rev.
1838 * If optional @a authz_read_func is not @c NULL, then use it (and @a
1839 * authz_read_baton) to verify that the peg-object is readable. If
1840 * not, return #SVN_ERR_AUTHZ_UNREADABLE. Also use the @a
1841 * authz_read_func to check that every path reported in a location
1842 * segment is readable. If an unreadable path is encountered, report
1843 * a final (possibly truncated) location segment (if any), stop
1844 * tracing history, and return #SVN_NO_ERROR.
1846 * @a pool is used for all allocations.
1848 * @since New in 1.5.
1851 svn_repos_node_location_segments(svn_repos_t *repos,
1853 svn_revnum_t peg_revision,
1854 svn_revnum_t start_rev,
1855 svn_revnum_t end_rev,
1856 svn_location_segment_receiver_t receiver,
1857 void *receiver_baton,
1858 svn_repos_authz_func_t authz_read_func,
1859 void *authz_read_baton,
1863 /* ---------------------------------------------------------------*/
1865 /* Retrieving log messages. */
1869 * Invoke @a receiver with @a receiver_baton on each log message from
1870 * @a start to @a end in @a repos's filesystem. @a start may be greater
1871 * or less than @a end; this just controls whether the log messages are
1872 * processed in descending or ascending revision number order.
1874 * If @a start or @a end is #SVN_INVALID_REVNUM, it defaults to youngest.
1876 * If @a paths is non-NULL and has one or more elements, then only show
1877 * revisions in which at least one of @a paths was changed (i.e., if
1878 * file, text or props changed; if dir, props or entries changed or any node
1879 * changed below it). Each path is a <tt>const char *</tt> representing
1880 * an absolute path in the repository. If @a paths is NULL or empty,
1881 * show all revisions regardless of what paths were changed in those
1884 * If @a limit is greater than zero then only invoke @a receiver on the first
1887 * If @a discover_changed_paths, then each call to @a receiver passes a
1888 * hash mapping paths committed in that revision to information about them
1889 * as the receiver's @a changed_paths argument.
1890 * Otherwise, each call to @a receiver passes NULL for @a changed_paths.
1892 * If @a strict_node_history is set, copy history (if any exists) will
1893 * not be traversed while harvesting revision logs for each path.
1895 * If @a include_merged_revisions is set, log information for revisions
1896 * which have been merged to @a paths will also be returned, unless these
1897 * revisions are already part of @a start to @a end in @a repos's
1898 * filesystem, as limited by @a paths. In the latter case those revisions
1899 * are skipped and @a receiver is not invoked.
1901 * If @a revprops is NULL, retrieve all revision properties; else, retrieve
1902 * only the revision properties named by the (const char *) array elements
1903 * (i.e. retrieve none if the array is empty).
1905 * If any invocation of @a receiver returns error, return that error
1906 * immediately and without wrapping it.
1908 * If @a start or @a end is a non-existent revision, return the error
1909 * #SVN_ERR_FS_NO_SUCH_REVISION, without ever invoking @a receiver.
1911 * If optional @a authz_read_func is non-NULL, then use this function
1912 * (along with optional @a authz_read_baton) to check the readability
1913 * of each changed-path in each revision about to be "pushed" at
1914 * @a receiver. If a revision has some changed-paths readable and
1915 * others unreadable, unreadable paths are omitted from the
1916 * changed_paths field and only svn:author and svn:date will be
1917 * available in the revprops field. If a revision has no
1918 * changed-paths readable at all, then all paths are omitted and no
1919 * revprops are available.
1921 * See also the documentation for #svn_log_entry_receiver_t.
1923 * Use @a pool for temporary allocations.
1925 * @since New in 1.5.
1928 svn_repos_get_logs4(svn_repos_t *repos,
1929 const apr_array_header_t *paths,
1933 svn_boolean_t discover_changed_paths,
1934 svn_boolean_t strict_node_history,
1935 svn_boolean_t include_merged_revisions,
1936 const apr_array_header_t *revprops,
1937 svn_repos_authz_func_t authz_read_func,
1938 void *authz_read_baton,
1939 svn_log_entry_receiver_t receiver,
1940 void *receiver_baton,
1944 * Same as svn_repos_get_logs4(), but with @a receiver being
1945 * #svn_log_message_receiver_t instead of #svn_log_entry_receiver_t.
1946 * Also, @a include_merged_revisions is set to @c FALSE and @a revprops is
1947 * svn:author, svn:date, and svn:log. If @a paths is empty, nothing
1950 * @since New in 1.2.
1951 * @deprecated Provided for backward compatibility with the 1.4 API.
1955 svn_repos_get_logs3(svn_repos_t *repos,
1956 const apr_array_header_t *paths,
1960 svn_boolean_t discover_changed_paths,
1961 svn_boolean_t strict_node_history,
1962 svn_repos_authz_func_t authz_read_func,
1963 void *authz_read_baton,
1964 svn_log_message_receiver_t receiver,
1965 void *receiver_baton,
1970 * Same as svn_repos_get_logs3(), but with @a limit always set to 0.
1972 * @deprecated Provided for backward compatibility with the 1.1 API.
1976 svn_repos_get_logs2(svn_repos_t *repos,
1977 const apr_array_header_t *paths,
1980 svn_boolean_t discover_changed_paths,
1981 svn_boolean_t strict_node_history,
1982 svn_repos_authz_func_t authz_read_func,
1983 void *authz_read_baton,
1984 svn_log_message_receiver_t receiver,
1985 void *receiver_baton,
1989 * Same as svn_repos_get_logs2(), but with @a authz_read_func and
1990 * @a authz_read_baton always set to NULL.
1992 * @deprecated Provided for backward compatibility with the 1.0 API.
1996 svn_repos_get_logs(svn_repos_t *repos,
1997 const apr_array_header_t *paths,
2000 svn_boolean_t discover_changed_paths,
2001 svn_boolean_t strict_node_history,
2002 svn_log_message_receiver_t receiver,
2003 void *receiver_baton,
2008 /* ---------------------------------------------------------------*/
2010 /* Retrieving mergeinfo. */
2013 * Fetch the mergeinfo for @a paths at @a revision in @a repos, and
2014 * set @a *catalog to a catalog of this mergeinfo. @a *catalog will
2015 * never be @c NULL but may be empty.
2017 * The paths in @a paths, and the keys of @a catalog, start with '/'.
2019 * @a inherit indicates whether explicit, explicit or inherited, or
2020 * only inherited mergeinfo for @a paths is fetched.
2022 * If @a revision is #SVN_INVALID_REVNUM, it defaults to youngest.
2024 * If @a include_descendants is TRUE, then additionally return the
2025 * mergeinfo for any descendant of any element of @a paths which has
2026 * the #SVN_PROP_MERGEINFO property explicitly set on it. (Note
2027 * that inheritance is only taken into account for the elements in @a
2028 * paths; descendants of the elements in @a paths which get their
2029 * mergeinfo via inheritance are not included in @a *catalog.)
2031 * If optional @a authz_read_func is non-NULL, then use this function
2032 * (along with optional @a authz_read_baton) to check the readability
2033 * of each path which mergeinfo was requested for (from @a paths).
2034 * Silently omit unreadable paths from the request for mergeinfo.
2036 * Use @a pool for all allocations.
2038 * @since New in 1.5.
2041 svn_repos_fs_get_mergeinfo(svn_mergeinfo_catalog_t *catalog,
2043 const apr_array_header_t *paths,
2044 svn_revnum_t revision,
2045 svn_mergeinfo_inheritance_t inherit,
2046 svn_boolean_t include_descendants,
2047 svn_repos_authz_func_t authz_read_func,
2048 void *authz_read_baton,
2052 /* ---------------------------------------------------------------*/
2054 /* Retrieving multiple revisions of a file. */
2057 * Retrieve a subset of the interesting revisions of a file @a path in
2058 * @a repos as seen in revision @a end. Invoke @a handler with
2059 * @a handler_baton as its first argument for each such revision.
2060 * @a pool is used for all allocations. See svn_fs_history_prev() for
2061 * a discussion of interesting revisions.
2063 * If optional @a authz_read_func is non-NULL, then use this function
2064 * (along with optional @a authz_read_baton) to check the readability
2065 * of the rev-path in each interesting revision encountered.
2067 * Revision discovery happens from @a end to @a start, and if an
2068 * unreadable revision is encountered before @a start is reached, then
2069 * revision discovery stops and only the revisions from @a end to the
2070 * oldest readable revision are returned (So it will appear that @a
2071 * path was added without history in the latter revision).
2073 * If there is an interesting revision of the file that is less than or
2074 * equal to start, the iteration will start at that revision. Else, the
2075 * iteration will start at the first revision of the file in the repository,
2076 * which has to be less than or equal to end. Note that if the function
2077 * succeeds, @a handler will have been called at least once.
2079 * In a series of calls, the file contents for the first interesting revision
2080 * will be provided as a text delta against the empty file. In the following
2081 * calls, the delta will be against the contents for the previous call.
2083 * If @a include_merged_revisions is TRUE, revisions which a included as a
2084 * result of a merge between @a start and @a end will be included.
2086 * Since Subversion 1.8 this function has been enabled to support reversion
2087 * the revision range for @a include_merged_revision @c FALSE reporting by
2088 * switching @a start with @a end.
2090 * @note Prior to Subversion 1.9, this function may request delta handlers
2091 * from @a handler even for empty text deltas. Starting with 1.9, the
2092 * delta handler / baton return arguments passed to @a handler will be
2093 * #NULL unless there is an actual difference in the file contents between
2094 * the current and the previous call.
2096 * @since New in 1.5.
2099 svn_repos_get_file_revs2(svn_repos_t *repos,
2103 svn_boolean_t include_merged_revisions,
2104 svn_repos_authz_func_t authz_read_func,
2105 void *authz_read_baton,
2106 svn_file_rev_handler_t handler,
2107 void *handler_baton,
2111 * Similar to #svn_file_rev_handler_t, but without the @a
2112 * result_of_merge parameter.
2114 * @deprecated Provided for backward compatibility with 1.4 API.
2115 * @since New in 1.1.
2117 typedef svn_error_t *(*svn_repos_file_rev_handler_t)
2121 apr_hash_t *rev_props,
2122 svn_txdelta_window_handler_t *delta_handler,
2124 apr_array_header_t *prop_diffs,
2128 * Similar to svn_repos_get_file_revs2(), with @a include_merged_revisions
2131 * @deprecated Provided for backward compatibility with the 1.4 API.
2132 * @since New in 1.1.
2136 svn_repos_get_file_revs(svn_repos_t *repos,
2140 svn_repos_authz_func_t authz_read_func,
2141 void *authz_read_baton,
2142 svn_repos_file_rev_handler_t handler,
2143 void *handler_baton,
2147 /* ---------------------------------------------------------------*/
2150 * @defgroup svn_repos_hook_wrappers Hook-sensitive wrappers for libsvn_fs \
2155 /** Like svn_fs_commit_txn(), but invoke the @a repos' pre- and
2156 * post-commit hooks around the commit. Use @a pool for any necessary
2159 * If the pre-commit hook fails, do not attempt to commit the
2160 * transaction and throw the original error to the caller.
2162 * A successful commit is indicated by a valid revision value in @a
2163 * *new_rev, not if svn_fs_commit_txn() returns an error, which can
2164 * occur during its post commit FS processing. If the transaction was
2165 * not committed, then return the associated error and do not execute
2166 * the post-commit hook.
2168 * If the commit succeeds the post-commit hook is executed. If the
2169 * post-commit hook returns an error, always wrap it with
2170 * SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED; this allows the caller to
2171 * find the post-commit hook error in the returned error chain. If
2172 * both svn_fs_commit_txn() and the post-commit hook return errors,
2173 * then svn_fs_commit_txn()'s error is the parent error and the
2174 * SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED wrapped error is the child
2177 * @a conflict_p, @a new_rev, and @a txn are as in svn_fs_commit_txn().
2180 svn_repos_fs_commit_txn(const char **conflict_p,
2182 svn_revnum_t *new_rev,
2186 /** Like svn_fs_begin_txn(), but use @a revprop_table, a hash mapping
2187 * <tt>const char *</tt> property names to #svn_string_t values, to
2188 * set the properties on transaction @a *txn_p. @a repos is the
2189 * repository object which contains the filesystem. @a rev, @a
2190 * *txn_p, and @a pool are as in svn_fs_begin_txn().
2192 * Before a txn is created, the repository's start-commit hooks are
2193 * run; if any of them fail, no txn is created, @a *txn_p is unaffected,
2194 * and #SVN_ERR_REPOS_HOOK_FAILURE is returned.
2196 * @note @a revprop_table may contain an #SVN_PROP_REVISION_DATE property,
2197 * which will be set on the transaction, but that will be overwritten
2198 * when the transaction is committed.
2200 * @since New in 1.5.
2203 svn_repos_fs_begin_txn_for_commit2(svn_fs_txn_t **txn_p,
2206 apr_hash_t *revprop_table,
2211 * Same as svn_repos_fs_begin_txn_for_commit2(), but with @a revprop_table
2212 * set to a hash containing @a author and @a log_msg as the
2213 * #SVN_PROP_REVISION_AUTHOR and #SVN_PROP_REVISION_LOG properties,
2214 * respectively. @a author and @a log_msg may both be @c NULL.
2216 * @deprecated Provided for backward compatibility with the 1.4 API.
2220 svn_repos_fs_begin_txn_for_commit(svn_fs_txn_t **txn_p,
2224 const char *log_msg,
2228 /** Like svn_fs_begin_txn(), but use @a author to set the corresponding
2229 * property on transaction @a *txn_p. @a repos is the repository object
2230 * which contains the filesystem. @a rev, @a *txn_p, and @a pool are as in
2231 * svn_fs_begin_txn().
2233 * ### Someday: before a txn is created, some kind of read-hook could
2236 * @note This function was never fully implemented, nor used. Ignore it.
2237 * @deprecated Provided for backward compatibility with the 1.7 API.
2241 svn_repos_fs_begin_txn_for_update(svn_fs_txn_t **txn_p,
2250 /** @defgroup svn_repos_fs_locks Repository lock wrappers
2254 /** Like svn_fs_lock_many(), but invoke the @a repos's pre- and
2255 * post-lock hooks before and after the locking action.
2257 * The pre-lock is run for every path in @a targets. Those targets for
2258 * which the pre-lock is successful are passed to svn_fs_lock_many and
2259 * the post-lock is run for those that are successfully locked.
2260 * Pre-lock hook errors are passed to @a lock_callback.
2262 * For each path in @a targets @a lock_callback will be invoked
2263 * passing @a lock_baton and the lock and error that apply to path.
2264 * @a lock_callback can be NULL in which case it is not called and any
2265 * errors that would have been passed to the callback are not reported.
2267 * If an error occurs when running the post-lock hook the error is
2268 * returned wrapped with #SVN_ERR_REPOS_POST_LOCK_HOOK_FAILED. If the
2269 * caller sees this error, it knows that some locks succeeded.
2271 * The pre-lock hook may cause a different token to be used for the
2272 * lock, instead of the token supplied; see the pre-lock-hook
2273 * documentation for more.
2275 * The lock and path passed to @a lock_callback will be allocated in
2276 * @a result_pool. Use @a scratch_pool for temporary allocations.
2278 * @note This function is not atomic. If it returns an error, some targets
2279 * may remain unlocked while others may have been locked.
2281 * @see svn_fs_lock_many
2283 * @since New in 1.9.
2286 svn_repos_fs_lock_many(svn_repos_t *repos,
2287 apr_hash_t *lock_targets,
2288 const char *comment,
2289 svn_boolean_t is_dav_comment,
2290 apr_time_t expiration_date,
2291 svn_boolean_t steal_lock,
2292 svn_fs_lock_callback_t lock_callback,
2294 apr_pool_t *result_pool,
2295 apr_pool_t *scratch_pool);
2297 /** Similar to svn_repos_fs_lock_many() but locks only a single path.
2299 * @since New in 1.2.
2302 svn_repos_fs_lock(svn_lock_t **lock,
2306 const char *comment,
2307 svn_boolean_t is_dav_comment,
2308 apr_time_t expiration_date,
2309 svn_revnum_t current_rev,
2310 svn_boolean_t steal_lock,
2314 /** Like svn_fs_unlock_many(), but invoke the @a repos's pre- and
2315 * post-unlock hooks before and after the unlocking action.
2317 * The pre-unlock hook is run for every path in @a targets. Those
2318 * targets for which the pre-unlock is successful are passed to
2319 * svn_fs_unlock_many and the post-unlock is run for those that are
2320 * successfully unlocked. Pre-unlock hook errors are passed to @a
2323 * For each path in @a targets @a lock_callback will be invoked
2324 * passing @a lock_baton and error that apply to path. The lock
2325 * passed to the callback will be NULL. @a lock_callback can be NULL
2326 * in which case it is not called and any errors that would have been
2327 * passed to the callback are not reported.
2329 * If an error occurs when running the post-unlock hook, return the
2330 * original error wrapped with #SVN_ERR_REPOS_POST_UNLOCK_HOOK_FAILED.
2331 * If the caller sees this error, it knows that some unlocks
2334 * The path passed to @a lock_callback will be allocated in @a result_pool.
2335 * Use @a scratch_pool for temporary allocations.
2337 * @note This function is not atomic. If it returns an error, some targets
2338 * may remain locked while others may have been unlocked.
2340 * @see svn_fs_unlock_many
2342 * @since New in 1.9.
2345 svn_repos_fs_unlock_many(svn_repos_t *repos,
2346 apr_hash_t *unlock_targets,
2347 svn_boolean_t break_lock,
2348 svn_fs_lock_callback_t lock_callback,
2350 apr_pool_t *result_pool,
2351 apr_pool_t *scratch_pool);
2353 /** Similar to svn_repos_fs_unlock_many() but only unlocks a single path.
2355 * @since New in 1.2.
2358 svn_repos_fs_unlock(svn_repos_t *repos,
2361 svn_boolean_t break_lock,
2366 /** Look up all the locks in and under @a path in @a repos, setting @a
2367 * *locks to a hash which maps <tt>const char *</tt> paths to the
2368 * #svn_lock_t locks associated with those paths. Use @a
2369 * authz_read_func and @a authz_read_baton to "screen" all returned
2370 * locks. That is: do not return any locks on any paths that are
2371 * unreadable in HEAD, just silently omit them.
2373 * @a depth limits the returned locks to those associated with paths
2374 * within the specified depth of @a path, and must be one of the
2375 * following values: #svn_depth_empty, #svn_depth_files,
2376 * #svn_depth_immediates, or #svn_depth_infinity.
2378 * @since New in 1.7.
2381 svn_repos_fs_get_locks2(apr_hash_t **locks,
2385 svn_repos_authz_func_t authz_read_func,
2386 void *authz_read_baton,
2390 * Similar to svn_repos_fs_get_locks2(), but with @a depth always
2391 * passed as svn_depth_infinity.
2393 * @since New in 1.2.
2394 * @deprecated Provided for backward compatibility with the 1.6 API.
2398 svn_repos_fs_get_locks(apr_hash_t **locks,
2401 svn_repos_authz_func_t authz_read_func,
2402 void *authz_read_baton,
2407 /** @defgroup svn_repos_properties Versioned and Unversioned Properties
2409 * Prop-changing and prop-reading wrappers for libsvn_fs routines.
2414 * Like svn_fs_change_rev_prop2(), but validate the name and value of the
2415 * property and invoke the @a repos's pre- and post-revprop-change hooks
2416 * around the change as specified by @a use_pre_revprop_change_hook and
2417 * @a use_post_revprop_change_hook (respectively).
2419 * @a rev is the revision whose property to change, @a name is the
2420 * name of the property, and @a new_value is the new value of the
2421 * property. If @a old_value_p is not @c NULL, then @a *old_value_p
2422 * is the expected current (preexisting) value of the property (or @c NULL
2423 * for "unset"). @a author is the authenticated username of the person
2424 * changing the property value, or NULL if not available.
2426 * If @a authz_read_func is non-NULL, then use it (with @a
2427 * authz_read_baton) to validate the changed-paths associated with @a
2428 * rev. If the revision contains any unreadable changed paths, then
2429 * return #SVN_ERR_AUTHZ_UNREADABLE.
2431 * Validate @a name and @a new_value like the same way
2432 * svn_repos_fs_change_node_prop() does.
2434 * Use @a pool for temporary allocations.
2436 * @since New in 1.7.
2439 svn_repos_fs_change_rev_prop4(svn_repos_t *repos,
2443 const svn_string_t *const *old_value_p,
2444 const svn_string_t *new_value,
2445 svn_boolean_t use_pre_revprop_change_hook,
2446 svn_boolean_t use_post_revprop_change_hook,
2447 svn_repos_authz_func_t authz_read_func,
2448 void *authz_read_baton,
2452 * Similar to svn_repos_fs_change_rev_prop4(), but with @a old_value_p always
2453 * set to @c NULL. (In other words, it is similar to
2454 * svn_fs_change_rev_prop().)
2456 * @deprecated Provided for backward compatibility with the 1.6 API.
2457 * @since New in 1.5.
2461 svn_repos_fs_change_rev_prop3(svn_repos_t *repos,
2465 const svn_string_t *new_value,
2466 svn_boolean_t use_pre_revprop_change_hook,
2467 svn_boolean_t use_post_revprop_change_hook,
2468 svn_repos_authz_func_t authz_read_func,
2469 void *authz_read_baton,
2473 * Similar to svn_repos_fs_change_rev_prop3(), but with the @a
2474 * use_pre_revprop_change_hook and @a use_post_revprop_change_hook
2475 * always set to @c TRUE.
2477 * @deprecated Provided for backward compatibility with the 1.4 API.
2481 svn_repos_fs_change_rev_prop2(svn_repos_t *repos,
2485 const svn_string_t *new_value,
2486 svn_repos_authz_func_t authz_read_func,
2487 void *authz_read_baton,
2491 * Similar to svn_repos_fs_change_rev_prop2(), but with the
2492 * @a authz_read_func parameter always NULL.
2494 * @deprecated Provided for backward compatibility with the 1.0 API.
2498 svn_repos_fs_change_rev_prop(svn_repos_t *repos,
2502 const svn_string_t *new_value,
2508 * Set @a *value_p to the value of the property named @a propname on
2509 * revision @a rev in the filesystem opened in @a repos. If @a rev
2510 * has no property by that name, set @a *value_p to zero. Allocate
2511 * the result in @a pool.
2513 * If @a authz_read_func is non-NULL, then use it (with @a
2514 * authz_read_baton) to validate the changed-paths associated with @a
2515 * rev. If the changed-paths are all unreadable, then set @a *value_p
2516 * to zero unconditionally. If only some of the changed-paths are
2517 * unreadable, then allow 'svn:author' and 'svn:date' propvalues to be
2518 * fetched, but return 0 for any other property.
2520 * @since New in 1.1.
2523 svn_repos_fs_revision_prop(svn_string_t **value_p,
2526 const char *propname,
2527 svn_repos_authz_func_t authz_read_func,
2528 void *authz_read_baton,
2533 * Set @a *table_p to the entire property list of revision @a rev in
2534 * filesystem opened in @a repos, as a hash table allocated in @a
2535 * pool. The table maps <tt>char *</tt> property names to
2536 * #svn_string_t * values; the names and values are allocated in @a
2539 * If @a authz_read_func is non-NULL, then use it (with @a
2540 * authz_read_baton) to validate the changed-paths associated with @a
2541 * rev. If the changed-paths are all unreadable, then return an empty
2542 * hash. If only some of the changed-paths are unreadable, then return
2543 * an empty hash, except for 'svn:author' and 'svn:date' properties
2544 * (assuming those properties exist).
2546 * @since New in 1.1.
2549 svn_repos_fs_revision_proplist(apr_hash_t **table_p,
2552 svn_repos_authz_func_t authz_read_func,
2553 void *authz_read_baton,
2556 /** Validating wrapper for svn_fs_change_node_prop() (which see for
2557 * argument descriptions).
2559 * If @a name's kind is not #svn_prop_regular_kind, return
2560 * #SVN_ERR_REPOS_BAD_ARGS. If @a name is an "svn:" property, validate its
2561 * @a value and return SVN_ERR_BAD_PROPERTY_VALUE if it is invalid for the
2564 * @note Originally, the only properties validated were the "svn:" properties
2565 * #SVN_PROP_REVISION_LOG and #SVN_PROP_REVISION_DATE. For the current
2566 * validation rules see the private function svn_repos__validate_prop().
2569 svn_repos_fs_change_node_prop(svn_fs_root_t *root,
2572 const svn_string_t *value,
2576 * Set @a *inherited_values to a depth-first ordered array of
2577 * #svn_prop_inherited_item_t * structures (the path_or_url members of
2578 * which are relative filesystem paths) representing the properties
2579 * inherited by @a path in @a root. If no properties are inherited,
2580 * then set @a *inherited_values to an empty array.
2582 * if @a propname is NULL then retrieve all explicit and/or inherited
2583 * properties. Otherwise retrieve only the properties named @a propname.
2585 * If optional @a authz_read_func is non-NULL, then use this function
2586 * (along with optional @a authz_read_baton) to check the readability
2587 * of each parent path from which properties are inherited. Silently omit
2588 * properties for unreadable parent paths.
2590 * Allocate @a *inherited_props in @a result_pool. Use @a scratch_pool for
2591 * temporary allocations.
2593 * @since New in 1.8.
2596 svn_repos_fs_get_inherited_props(apr_array_header_t **inherited_props,
2597 svn_fs_root_t *root,
2599 const char *propname,
2600 svn_repos_authz_func_t authz_read_func,
2601 void *authz_read_baton,
2602 apr_pool_t *result_pool,
2603 apr_pool_t *scratch_pool);
2605 /** Validating wrapper for svn_fs_change_txn_prop() (which see for
2606 * argument descriptions). See svn_repos_fs_change_txn_props() for more
2610 svn_repos_fs_change_txn_prop(svn_fs_txn_t *txn,
2612 const svn_string_t *value,
2615 /** Validating wrapper for svn_fs_change_txn_props() (which see for
2616 * argument descriptions). Validate properties and their values the
2617 * same way svn_repos_fs_change_node_prop() does.
2619 * @since New in 1.5.
2622 svn_repos_fs_change_txn_props(svn_fs_txn_t *txn,
2623 const apr_array_header_t *props,
2629 /* ---------------------------------------------------------------*/
2632 * @defgroup svn_repos_inspection Data structures and editor things for \
2633 * repository inspection.
2636 * As it turns out, the svn_repos_replay2(), svn_repos_dir_delta2() and
2637 * svn_repos_begin_report3() interfaces can be extremely useful for
2638 * examining the repository, or more exactly, changes to the repository.
2639 * These drivers allows for differences between two trees to be
2640 * described using an editor.
2642 * By using the editor obtained from svn_repos_node_editor() with one of
2643 * the drivers mentioned above, the description of how to transform one
2644 * tree into another can be used to build an in-memory linked-list tree,
2645 * which each node representing a repository node that was changed.
2648 /** A node in the repository. */
2649 typedef struct svn_repos_node_t
2651 /** Node type (file, dir, etc.) */
2652 svn_node_kind_t kind;
2654 /** How this node entered the node tree: 'A'dd, 'D'elete, 'R'eplace */
2657 /** Were there any textual mods? (files only) */
2658 svn_boolean_t text_mod;
2660 /** Where there any property mods? */
2661 svn_boolean_t prop_mod;
2663 /** The name of this node as it appears in its parent's entries list */
2666 /** The filesystem revision where this was copied from (if any) */
2667 svn_revnum_t copyfrom_rev;
2669 /** The filesystem path where this was copied from (if any) */
2670 const char *copyfrom_path;
2672 /** Pointer to the next sibling of this node */
2673 struct svn_repos_node_t *sibling;
2675 /** Pointer to the first child of this node */
2676 struct svn_repos_node_t *child;
2678 /** Pointer to the parent of this node */
2679 struct svn_repos_node_t *parent;
2684 /** Set @a *editor and @a *edit_baton to an editor that, when driven by
2685 * a driver such as svn_repos_replay2(), builds an <tt>svn_repos_node_t *</tt>
2686 * tree representing the delta from @a base_root to @a root in @a
2687 * repos's filesystem.
2689 * The editor can also be driven by svn_repos_dir_delta2() or
2690 * svn_repos_begin_report3(), but unless you have special needs,
2691 * svn_repos_replay2() is preferred.
2693 * Invoke svn_repos_node_from_baton() on @a edit_baton to obtain the root
2696 * Note that the delta includes "bubbled-up" directories; that is,
2697 * many of the directory nodes will have no prop_mods.
2699 * Allocate the tree and its contents in @a node_pool; do all other
2700 * allocation in @a pool.
2703 svn_repos_node_editor(const svn_delta_editor_t **editor,
2706 svn_fs_root_t *base_root,
2707 svn_fs_root_t *root,
2708 apr_pool_t *node_pool,
2711 /** Return the root node of the linked-list tree generated by driving the
2712 * editor (associated with @a edit_baton) created by svn_repos_node_editor().
2713 * This is only really useful if used *after* the editor drive is completed.
2716 svn_repos_node_from_baton(void *edit_baton);
2719 * Return repository format information for @a repos.
2721 * Set @a *repos_format to the repository format number of @a repos, which is
2722 * an integer that increases when incompatible changes are made (such as
2723 * by #svn_repos_upgrade2).
2725 * Set @a *supports_version to the version number of the minimum Subversion
2726 * GA release that can read and write @a repos; allocate it in
2727 * @a result_pool. Use @a scratch_pool for temporary allocations.
2729 * @see svn_fs_info_format, svn_repos_capabilities
2731 * @since New in 1.9.
2734 svn_repos_info_format(int *repos_format,
2735 svn_version_t **supports_version,
2737 apr_pool_t *result_pool,
2738 apr_pool_t *scratch_pool);
2742 /* ---------------------------------------------------------------*/
2745 * @defgroup svn_repos_dump_load Dumping, loading and verifying filesystem data
2748 * The filesystem 'dump' format contains nothing but the abstract
2749 * structure of the filesystem -- independent of any internal node-id
2750 * schema or database back-end. All of the data in the dumpfile is
2751 * acquired by public function calls into svn_fs.h. Similarly, the
2752 * parser which reads the dumpfile is able to reconstruct the
2753 * filesystem using only public svn_fs.h routines.
2755 * Thus the dump/load feature's main purpose is for *migrating* data
2756 * from one svn filesystem to another -- presumably two filesystems
2757 * which have different internal implementations.
2759 * If you simply want to backup your filesystem, you're probably
2760 * better off using the built-in facilities of the DB backend (using
2761 * Berkeley DB's hot-backup feature, for example.)
2763 * For a description of the dumpfile format, see
2764 * /trunk/notes/fs_dumprestore.txt.
2767 /* The RFC822-style headers in our dumpfile format. */
2768 #define SVN_REPOS_DUMPFILE_MAGIC_HEADER "SVN-fs-dump-format-version"
2769 #define SVN_REPOS_DUMPFILE_FORMAT_VERSION 3
2770 #define SVN_REPOS_DUMPFILE_FORMAT_VERSION_DELTAS 3
2771 #define SVN_REPOS_DUMPFILE_UUID "UUID"
2772 #define SVN_REPOS_DUMPFILE_CONTENT_LENGTH "Content-length"
2774 #define SVN_REPOS_DUMPFILE_REVISION_NUMBER "Revision-number"
2776 #define SVN_REPOS_DUMPFILE_NODE_PATH "Node-path"
2777 #define SVN_REPOS_DUMPFILE_NODE_KIND "Node-kind"
2778 #define SVN_REPOS_DUMPFILE_NODE_ACTION "Node-action"
2779 #define SVN_REPOS_DUMPFILE_NODE_COPYFROM_PATH "Node-copyfrom-path"
2780 #define SVN_REPOS_DUMPFILE_NODE_COPYFROM_REV "Node-copyfrom-rev"
2781 /** @since New in 1.6. */
2782 #define SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_MD5 "Text-copy-source-md5"
2783 /** @since New in 1.6. */
2784 #define SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_SHA1 "Text-copy-source-sha1"
2785 #define SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_CHECKSUM \
2786 SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_MD5
2787 /** @since New in 1.6. */
2788 #define SVN_REPOS_DUMPFILE_TEXT_CONTENT_MD5 "Text-content-md5"
2789 /** @since New in 1.6. */
2790 #define SVN_REPOS_DUMPFILE_TEXT_CONTENT_SHA1 "Text-content-sha1"
2791 #define SVN_REPOS_DUMPFILE_TEXT_CONTENT_CHECKSUM \
2792 SVN_REPOS_DUMPFILE_TEXT_CONTENT_MD5
2794 #define SVN_REPOS_DUMPFILE_PROP_CONTENT_LENGTH "Prop-content-length"
2795 #define SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH "Text-content-length"
2797 /** @since New in 1.1. */
2798 #define SVN_REPOS_DUMPFILE_PROP_DELTA "Prop-delta"
2799 /** @since New in 1.1. */
2800 #define SVN_REPOS_DUMPFILE_TEXT_DELTA "Text-delta"
2801 /** @since New in 1.6. */
2802 #define SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_MD5 "Text-delta-base-md5"
2803 /** @since New in 1.6. */
2804 #define SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_SHA1 "Text-delta-base-sha1"
2805 /** @since New in 1.5. */
2806 #define SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_CHECKSUM \
2807 SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_MD5
2809 /** The different policies for processing the UUID in the dumpfile. */
2810 enum svn_repos_load_uuid
2812 /** only update uuid if the repos has no revisions. */
2813 svn_repos_load_uuid_default,
2814 /** never update uuid. */
2815 svn_repos_load_uuid_ignore,
2816 /** always update uuid. */
2817 svn_repos_load_uuid_force
2820 /** Callback type for use with svn_repos_verify_fs3(). @a revision
2821 * and @a verify_err are the details of a single verification failure
2822 * that occurred during the svn_repos_verify_fs3() call. @a baton is
2823 * the same baton given to svn_repos_verify_fs3(). @a scratch_pool is
2824 * provided for the convenience of the implementor, who should not
2825 * expect it to live longer than a single callback call.
2827 * @a verify_err will be cleared and becomes invalid after the callback
2828 * returns, use svn_error_dup() to preserve the error. If a callback uses
2829 * @a verify_err as the return value or as a part of the return value, it
2830 * should also call svn_error_dup() for @a verify_err. Implementors of this
2831 * callback are forbidden to call svn_error_clear() for @a verify_err.
2833 * @see svn_repos_verify_fs3
2835 * @since New in 1.9.
2837 typedef svn_error_t *(*svn_repos_verify_callback_t)(void *baton,
2838 svn_revnum_t revision,
2839 svn_error_t *verify_err,
2840 apr_pool_t *scratch_pool);
2843 * Verify the contents of the file system in @a repos.
2845 * Verify the revisions from @a start_rev to @a end_rev inclusive. If
2846 * @a start_rev is #SVN_INVALID_REVNUM, start at revision 0; if @a end_rev
2847 * is #SVN_INVALID_REVNUM, end at the head revision. @a start_rev must be
2848 * older than or equal to @a end_rev. If revision 0 is included in the
2849 * range, then also verify "global invariants" of the repository, as
2850 * described in svn_fs_verify().
2852 * If @a check_normalization is @c TRUE, report any name collisions
2853 * within the same directory or svn:mergeinfo property where the names
2854 * differ only in character representation, but are otherwise
2857 * If @a metadata_only is @c TRUE, backends that have a concept of separate
2858 * metadata verification will only perform that and skip the more expensive
2859 * file context reconstruction and verification. For FSFS format 7+ and
2860 * FSX, this allows for a very fast check against external corruption.
2862 * If @a verify_callback is not @c NULL, call it with @a verify_baton upon
2863 * receiving an FS-specific structure failure or a revision verification
2864 * failure. Set @c revision callback argument to #SVN_INVALID_REVNUM or
2865 * to the revision number respectively. Set @c verify_err to svn_error_t
2866 * describing the reason of the failure. @c verify_err will be cleared
2867 * after the callback returns, use svn_error_dup() to preserve the error.
2868 * If @a verify_callback returns an error different from #SVN_NO_ERROR,
2869 * stop verifying the repository and immediately return the error from
2870 * @a verify_callback.
2872 * If @a verify_callback is @c NULL, this function returns the first
2873 * encountered verification error or #SVN_NO_ERROR if there were no failures
2874 * during the verification. Errors that prevent the verification process
2875 * from continuing, such as #SVN_ERR_CANCELLED, are returned immediately
2876 * and do not trigger an invocation of @a verify_callback.
2878 * If @a notify_func is not null, then call it with @a notify_baton and
2879 * with a notification structure in which the fields are set as follows.
2880 * (For a warning that does not apply to a specific revision, the revision
2881 * number is #SVN_INVALID_REVNUM.)
2883 * For each FS-specific structure warning:
2884 * @c action = svn_repos_notify_verify_rev_structure
2885 * @c revision = the revision or #SVN_INVALID_REVNUM
2887 * For each revision verification warning:
2888 * @c action = #svn_repos_notify_warning
2889 * @c warning and @c warning_str fields set accordingly
2890 * ### TODO: Set @c revision = the revision?
2892 * For each successfully verified revision:
2893 * @c action = #svn_repos_notify_verify_rev_end
2894 * @c revision = the revision
2897 * @c action = svn_repos_notify_verify_end
2898 * ### Do we really need a callback to tell us the function we
2899 * called has reached its end and is about to return?
2900 * ### Not sent, currently, if a FS structure error is found.
2902 * If @a cancel_func is not @c NULL, call it periodically with @a
2903 * cancel_baton as argument to see if the caller wishes to cancel the
2906 * Use @a scratch_pool for temporary allocation.
2908 * @see svn_repos_verify_callback_t
2910 * @since New in 1.9.
2913 svn_repos_verify_fs3(svn_repos_t *repos,
2914 svn_revnum_t start_rev,
2915 svn_revnum_t end_rev,
2916 svn_boolean_t check_normalization,
2917 svn_boolean_t metadata_only,
2918 svn_repos_notify_func_t notify_func,
2920 svn_repos_verify_callback_t verify_callback,
2922 svn_cancel_func_t cancel,
2924 apr_pool_t *scratch_pool);
2927 * Like svn_repos_verify_fs3(), but with @a verify_callback and
2928 * @a verify_baton set to @c NULL and with @a check_normalization
2929 * and @a metadata_only set to @c FALSE.
2931 * @since New in 1.7.
2932 * @deprecated Provided for backward compatibility with the 1.8 API.
2936 svn_repos_verify_fs2(svn_repos_t *repos,
2937 svn_revnum_t start_rev,
2938 svn_revnum_t end_rev,
2939 svn_repos_notify_func_t notify_func,
2941 svn_cancel_func_t cancel,
2943 apr_pool_t *scratch_pool);
2946 * Similar to svn_repos_verify_fs2(), but with a feedback_stream instead of
2947 * handling feedback via the notify_func handler.
2949 * If @a feedback_stream is not @c NULL, write feedback to it (lines of
2950 * the form "* Verified revision %ld\n").
2952 * @since New in 1.5.
2953 * @deprecated Provided for backward compatibility with the 1.6 API.
2957 svn_repos_verify_fs(svn_repos_t *repos,
2958 svn_stream_t *feedback_stream,
2959 svn_revnum_t start_rev,
2960 svn_revnum_t end_rev,
2961 svn_cancel_func_t cancel_func,
2966 * Dump the contents of the filesystem within already-open @a repos into
2967 * writable @a dumpstream. If @a dumpstream is
2968 * @c NULL, this is effectively a primitive verify. It is not complete,
2969 * however; see instead svn_repos_verify_fs3().
2971 * Begin at revision @a start_rev, and dump every revision up through
2972 * @a end_rev. If @a start_rev is #SVN_INVALID_REVNUM, start at revision
2973 * 0. If @a end_rev is #SVN_INVALID_REVNUM, end at the head revision.
2975 * If @a incremental is @c TRUE, the first revision dumped will be a diff
2976 * against the previous revision (usually it looks like a full dump of
2979 * If @a use_deltas is @c TRUE, output only node properties which have
2980 * changed relative to the previous contents, and output text contents
2981 * as svndiff data against the previous contents. Regardless of how
2982 * this flag is set, the first revision of a non-incremental dump will
2983 * be done with full plain text. A dump with @a use_deltas set cannot
2984 * be loaded by Subversion 1.0.x.
2986 * If @a notify_func is not null, then call it with @a notify_baton and
2987 * with a notification structure in which the fields are set as follows.
2988 * (For a warning or error notification that does not apply to a specific
2989 * revision, the revision number is #SVN_INVALID_REVNUM.)
2992 * @c action = #svn_repos_notify_warning
2993 * @c warning and @c warning_str fields set accordingly
2994 * ### TODO: Set @c revision = the revision or #SVN_INVALID_REVNUM?
2996 * For each successfully dumped revision:
2997 * @c action = #svn_repos_notify_dump_rev_end
2998 * @c revision = the revision
3001 * @c action = svn_repos_notify_verify_end
3002 * ### Do we really need a callback to tell us the function we
3003 * called has reached its end and is about to return?
3005 * At the end, if there were certain warnings previously:
3006 * @c action = #svn_repos_notify_warning
3007 * @c warning and @c warning_str fields set accordingly,
3008 * reiterating the existence of previous warnings
3009 * ### This is a presentation issue. Caller could do this itself.
3011 * If @a cancel_func is not @c NULL, it is called periodically with
3012 * @a cancel_baton as argument to see if the client wishes to cancel
3015 * Use @a scratch_pool for temporary allocation.
3017 * @since New in 1.7.
3020 svn_repos_dump_fs3(svn_repos_t *repos,
3021 svn_stream_t *dumpstream,
3022 svn_revnum_t start_rev,
3023 svn_revnum_t end_rev,
3024 svn_boolean_t incremental,
3025 svn_boolean_t use_deltas,
3026 svn_repos_notify_func_t notify_func,
3028 svn_cancel_func_t cancel_func,
3030 apr_pool_t *scratch_pool);
3033 * Similar to svn_repos_dump_fs3(), but with a feedback_stream instead of
3034 * handling feedback via the notify_func handler
3036 * @since New in 1.1.
3037 * @deprecated Provided for backward compatibility with the 1.6 API.
3041 svn_repos_dump_fs2(svn_repos_t *repos,
3042 svn_stream_t *dumpstream,
3043 svn_stream_t *feedback_stream,
3044 svn_revnum_t start_rev,
3045 svn_revnum_t end_rev,
3046 svn_boolean_t incremental,
3047 svn_boolean_t use_deltas,
3048 svn_cancel_func_t cancel_func,
3053 * Similar to svn_repos_dump_fs2(), but with the @a use_deltas
3054 * parameter always set to @c FALSE.
3056 * @deprecated Provided for backward compatibility with the 1.0 API.
3060 svn_repos_dump_fs(svn_repos_t *repos,
3061 svn_stream_t *dumpstream,
3062 svn_stream_t *feedback_stream,
3063 svn_revnum_t start_rev,
3064 svn_revnum_t end_rev,
3065 svn_boolean_t incremental,
3066 svn_cancel_func_t cancel_func,
3072 * Read and parse dumpfile-formatted @a dumpstream, reconstructing
3073 * filesystem revisions in already-open @a repos, handling uuids in
3074 * accordance with @a uuid_action. Use @a pool for all allocation.
3076 * If the dumpstream contains copy history that is unavailable in the
3077 * repository, an error will be thrown.
3079 * The repository's UUID will be updated iff
3080 * the dumpstream contains a UUID and
3081 * @a uuid_action is not equal to #svn_repos_load_uuid_ignore and
3082 * either the repository contains no revisions or
3083 * @a uuid_action is equal to #svn_repos_load_uuid_force.
3085 * If the dumpstream contains no UUID, then @a uuid_action is
3086 * ignored and the repository UUID is not touched.
3088 * @a start_rev and @a end_rev act as filters, the lower and upper
3089 * (inclusive) range values of revisions in @a dumpstream which will
3090 * be loaded. Either both of these values are #SVN_INVALID_REVNUM (in
3091 * which case no revision-based filtering occurs at all), or both are
3092 * valid revisions (where @a start_rev is older than or equivalent to
3095 * If @a parent_dir is not NULL, then the parser will reparent all the
3096 * loaded nodes, from root to @a parent_dir. The directory @a parent_dir
3097 * must be an existing directory in the repository.
3099 * If @a use_pre_commit_hook is set, call the repository's pre-commit
3100 * hook before committing each loaded revision.
3102 * If @a use_post_commit_hook is set, call the repository's
3103 * post-commit hook after committing each loaded revision.
3105 * If @a validate_props is set, then validate Subversion revision and
3106 * node properties (those in the svn: namespace) against established
3107 * rules for those things.
3109 * If @a ignore_dates is set, ignore any revision datestamps found in
3110 * @a dumpstream, allowing the revisions created by the load process
3111 * to be stamped as if they were newly created via the normal commit
3114 * If non-NULL, use @a notify_func and @a notify_baton to send notification
3115 * of events to the caller.
3117 * If @a cancel_func is not @c NULL, it is called periodically with
3118 * @a cancel_baton as argument to see if the client wishes to cancel
3121 * @since New in 1.9.
3124 svn_repos_load_fs5(svn_repos_t *repos,
3125 svn_stream_t *dumpstream,
3126 svn_revnum_t start_rev,
3127 svn_revnum_t end_rev,
3128 enum svn_repos_load_uuid uuid_action,
3129 const char *parent_dir,
3130 svn_boolean_t use_pre_commit_hook,
3131 svn_boolean_t use_post_commit_hook,
3132 svn_boolean_t validate_props,
3133 svn_boolean_t ignore_dates,
3134 svn_repos_notify_func_t notify_func,
3136 svn_cancel_func_t cancel_func,
3140 /** Similar to svn_repos_load_fs5(), but with @a ignore_dates
3141 * always passed as FALSE.
3143 * @since New in 1.8.
3144 * @deprecated Provided for backward compatibility with the 1.8 API.
3148 svn_repos_load_fs4(svn_repos_t *repos,
3149 svn_stream_t *dumpstream,
3150 svn_revnum_t start_rev,
3151 svn_revnum_t end_rev,
3152 enum svn_repos_load_uuid uuid_action,
3153 const char *parent_dir,
3154 svn_boolean_t use_pre_commit_hook,
3155 svn_boolean_t use_post_commit_hook,
3156 svn_boolean_t validate_props,
3157 svn_repos_notify_func_t notify_func,
3159 svn_cancel_func_t cancel_func,
3163 /** Similar to svn_repos_load_fs4(), but with @a start_rev and @a
3164 * end_rev always passed as #SVN_INVALID_REVNUM.
3166 * @since New in 1.7.
3167 * @deprecated Provided for backward compatibility with the 1.7 API.
3171 svn_repos_load_fs3(svn_repos_t *repos,
3172 svn_stream_t *dumpstream,
3173 enum svn_repos_load_uuid uuid_action,
3174 const char *parent_dir,
3175 svn_boolean_t use_pre_commit_hook,
3176 svn_boolean_t use_post_commit_hook,
3177 svn_boolean_t validate_props,
3178 svn_repos_notify_func_t notify_func,
3180 svn_cancel_func_t cancel_func,
3185 * Similar to svn_repos_load_fs3(), but with @a feedback_stream in
3186 * place of the #svn_repos_notify_func_t and baton and with
3187 * @a validate_props always FALSE.
3189 * @since New in 1.2.
3190 * @deprecated Provided for backward compatibility with the 1.6 API.
3194 svn_repos_load_fs2(svn_repos_t *repos,
3195 svn_stream_t *dumpstream,
3196 svn_stream_t *feedback_stream,
3197 enum svn_repos_load_uuid uuid_action,
3198 const char *parent_dir,
3199 svn_boolean_t use_pre_commit_hook,
3200 svn_boolean_t use_post_commit_hook,
3201 svn_cancel_func_t cancel_func,
3206 * Similar to svn_repos_load_fs2(), but with @a use_pre_commit_hook and
3207 * @a use_post_commit_hook always @c FALSE.
3209 * @deprecated Provided for backward compatibility with the 1.1 API.
3213 svn_repos_load_fs(svn_repos_t *repos,
3214 svn_stream_t *dumpstream,
3215 svn_stream_t *feedback_stream,
3216 enum svn_repos_load_uuid uuid_action,
3217 const char *parent_dir,
3218 svn_cancel_func_t cancel_func,
3224 * A vtable that is driven by svn_repos_parse_dumpstream3().
3226 * @since New in 1.8.
3228 typedef struct svn_repos_parse_fns3_t
3230 /** The parser has discovered a new "magic header" record within the
3231 * parsing session represented by @a parse_baton. The dump-format
3232 * version number is @a version.
3234 svn_error_t *(*magic_header_record)(int version,
3238 /** The parser has discovered a new uuid record within the parsing
3239 * session represented by @a parse_baton. The uuid's value is
3240 * @a uuid, and it is allocated in @a pool.
3242 svn_error_t *(*uuid_record)(const char *uuid,
3246 /** The parser has discovered a new revision record within the
3247 * parsing session represented by @a parse_baton. All the headers are
3248 * placed in @a headers (allocated in @a pool), which maps <tt>const
3249 * char *</tt> header-name ==> <tt>const char *</tt> header-value.
3250 * The @a revision_baton received back (also allocated in @a pool)
3251 * represents the revision.
3253 svn_error_t *(*new_revision_record)(void **revision_baton,
3254 apr_hash_t *headers,
3258 /** The parser has discovered a new node record within the current
3259 * revision represented by @a revision_baton. All the headers are
3260 * placed in @a headers (as with @c new_revision_record), allocated in
3261 * @a pool. The @a node_baton received back is allocated in @a pool
3262 * and represents the node.
3264 svn_error_t *(*new_node_record)(void **node_baton,
3265 apr_hash_t *headers,
3266 void *revision_baton,
3269 /** For a given @a revision_baton, set a property @a name to @a value. */
3270 svn_error_t *(*set_revision_property)(void *revision_baton,
3272 const svn_string_t *value);
3274 /** For a given @a node_baton, set a property @a name to @a value. */
3275 svn_error_t *(*set_node_property)(void *node_baton,
3277 const svn_string_t *value);
3279 /** For a given @a node_baton, delete property @a name. */
3280 svn_error_t *(*delete_node_property)(void *node_baton, const char *name);
3282 /** For a given @a node_baton, remove all properties. */
3283 svn_error_t *(*remove_node_props)(void *node_baton);
3285 /** For a given @a node_baton, set @a stream to a writable stream
3286 * capable of receiving the node's fulltext. The parser will write
3287 * the fulltext to the stream and then close the stream to signal
3290 * If a @c NULL is returned instead of a stream, the vtable is
3291 * indicating that no text is desired, and the parser will not
3292 * attempt to send it.
3294 svn_error_t *(*set_fulltext)(svn_stream_t **stream,
3297 /** For a given @a node_baton, set @a handler and @a handler_baton
3298 * to a window handler and baton capable of receiving a delta
3299 * against the node's previous contents. The parser will send all
3300 * the windows of data to this handler, and will then send a NULL
3301 * window to signal completion.
3303 * If a @c NULL is returned instead of a handler, the vtable is
3304 * indicating that no delta is desired, and the parser will not
3305 * attempt to send it.
3307 svn_error_t *(*apply_textdelta)(svn_txdelta_window_handler_t *handler,
3308 void **handler_baton,
3311 /** The parser has reached the end of the current node represented by
3312 * @a node_baton, it can be freed.
3314 svn_error_t *(*close_node)(void *node_baton);
3316 /** The parser has reached the end of the current revision
3317 * represented by @a revision_baton. In other words, there are no more
3318 * changed nodes within the revision. The baton can be freed.
3320 svn_error_t *(*close_revision)(void *revision_baton);
3322 } svn_repos_parse_fns3_t;
3326 * Read and parse dumpfile-formatted @a stream, calling callbacks in
3327 * @a parse_fns/@a parse_baton, and using @a pool for allocations.
3329 * If @a deltas_are_text is @c TRUE, handle text-deltas with the @a
3330 * set_fulltext callback. This is useful when manipulating a dump
3331 * stream without loading it. Otherwise handle text-deltas with the
3332 * @a apply_textdelta callback.
3334 * If @a cancel_func is not @c NULL, it is called periodically with
3335 * @a cancel_baton as argument to see if the client wishes to cancel
3338 * This parser has built-in knowledge of the dumpfile format, but only
3339 * in a limited sense:
3341 * * it recognizes the "magic" format-version header.
3343 * * it recognizes the UUID header.
3345 * * it recognizes revision and node records by looking for either
3346 * a REVISION_NUMBER or NODE_PATH headers.
3348 * * it recognizes the CONTENT-LENGTH headers, so it knows if and
3349 * how to suck up the content body.
3351 * * it knows how to parse a content body into two parts: props
3352 * and text, and pass the pieces to the vtable.
3354 * This is enough knowledge to make it easy on vtable implementors,
3355 * but still allow expansion of the format: most headers do not have
3356 * to be handled explicitly.
3358 * ### [JAF] Wouldn't it be more efficient to support a start/end rev
3359 * range here than only supporting it in receivers such as
3360 * svn_repos_get_fs_build_parser4()? This parser could then skip over
3361 * chunks of the input stream before the oldest required rev, and
3362 * could stop reading entirely after the youngest required rev.
3364 * @since New in 1.8.
3367 svn_repos_parse_dumpstream3(svn_stream_t *stream,
3368 const svn_repos_parse_fns3_t *parse_fns,
3370 svn_boolean_t deltas_are_text,
3371 svn_cancel_func_t cancel_func,
3377 * Set @a *parser and @a *parse_baton to a vtable parser which commits new
3378 * revisions to the fs in @a repos. The constructed parser will treat
3379 * UUID records in a manner consistent with @a uuid_action. Use @a pool
3380 * to operate on the fs.
3382 * @a start_rev and @a end_rev act as filters, the lower and upper
3383 * (inclusive) range values of revisions which will
3384 * be loaded. Either both of these values are #SVN_INVALID_REVNUM (in
3385 * which case no revision-based filtering occurs at all), or both are
3386 * valid revisions (where @a start_rev is older than or equivalent to
3387 * @a end_rev). They refer to dump stream revision numbers rather than
3388 * committed revision numbers.
3390 * If @a use_history is true, then when the parser encounters a node that
3391 * is added-with-history, it will require 'copy-from' history to exist in
3392 * the repository at the relative (adjusted) copy-from revision and path.
3393 * It will perform a copy from that source location, and will fail if no
3394 * suitable source exists there. If @a use_history is false, then it will
3395 * instead convert every copy to a plain add.
3397 * ### The 'use_history=FALSE' case is unused and untested in Subversion.
3398 * It seems to me it would not work with a deltas dumpfile (a driver
3399 * that calls the @c apply_textdelta method), as it would not have
3400 * access to the delta base text.
3402 * If @a use_pre_commit_hook is set, call the repository's pre-commit
3403 * hook before committing each loaded revision.
3405 * If @a use_post_commit_hook is set, call the repository's
3406 * post-commit hook after committing each loaded revision.
3408 * If @a validate_props is set, then validate Subversion revision and
3409 * node properties (those in the svn: namespace) against established
3410 * rules for those things.
3412 * If @a ignore_dates is set, ignore any revision datestamps found in
3413 * @a dumpstream, allowing the revisions created by the load process
3414 * to be stamped as if they were newly created via the normal commit
3417 * If @a parent_dir is not NULL, then the parser will reparent all the
3418 * loaded nodes, from root to @a parent_dir. The directory @a parent_dir
3419 * must be an existing directory in the repository.
3421 * @since New in 1.9.
3424 svn_repos_get_fs_build_parser5(const svn_repos_parse_fns3_t **parser,
3427 svn_revnum_t start_rev,
3428 svn_revnum_t end_rev,
3429 svn_boolean_t use_history,
3430 svn_boolean_t validate_props,
3431 enum svn_repos_load_uuid uuid_action,
3432 const char *parent_dir,
3433 svn_boolean_t use_pre_commit_hook,
3434 svn_boolean_t use_post_commit_hook,
3435 svn_boolean_t ignore_dates,
3436 svn_repos_notify_func_t notify_func,
3441 * Similar to svn_repos_get_fs_build_parser5(), but with the
3442 * @c use_pre_commit_hook, @c use_post_commit_hook and @c ignore_dates
3443 * arguments all false.
3445 * @since New in 1.8.
3446 * @deprecated Provided for backward compatibility with the 1.8 API.
3450 svn_repos_get_fs_build_parser4(const svn_repos_parse_fns3_t **parser,
3453 svn_revnum_t start_rev,
3454 svn_revnum_t end_rev,
3455 svn_boolean_t use_history,
3456 svn_boolean_t validate_props,
3457 enum svn_repos_load_uuid uuid_action,
3458 const char *parent_dir,
3459 svn_repos_notify_func_t notify_func,
3466 * A vtable that is driven by svn_repos_parse_dumpstream2().
3467 * Similar to #svn_repos_parse_fns3_t except that it lacks
3468 * the magic_header_record callback.
3470 * @deprecated Provided for backward compatibility with the 1.7 API.
3472 typedef struct svn_repos_parse_fns2_t
3474 /** Same as #svn_repos_parse_fns3_t.new_revision_record. */
3475 svn_error_t *(*new_revision_record)(void **revision_baton,
3476 apr_hash_t *headers,
3479 /** Same as #svn_repos_parse_fns3_t.uuid_record. */
3480 svn_error_t *(*uuid_record)(const char *uuid,
3483 /** Same as #svn_repos_parse_fns3_t.new_node_record. */
3484 svn_error_t *(*new_node_record)(void **node_baton,
3485 apr_hash_t *headers,
3486 void *revision_baton,
3488 /** Same as #svn_repos_parse_fns3_t.set_revision_property. */
3489 svn_error_t *(*set_revision_property)(void *revision_baton,
3491 const svn_string_t *value);
3492 /** Same as #svn_repos_parse_fns3_t.set_node_property. */
3493 svn_error_t *(*set_node_property)(void *node_baton,
3495 const svn_string_t *value);
3496 /** Same as #svn_repos_parse_fns3_t.delete_node_property. */
3497 svn_error_t *(*delete_node_property)(void *node_baton,
3499 /** Same as #svn_repos_parse_fns3_t.remove_node_props. */
3500 svn_error_t *(*remove_node_props)(void *node_baton);
3501 /** Same as #svn_repos_parse_fns3_t.set_fulltext. */
3502 svn_error_t *(*set_fulltext)(svn_stream_t **stream,
3504 /** Same as #svn_repos_parse_fns3_t.apply_textdelta. */
3505 svn_error_t *(*apply_textdelta)(svn_txdelta_window_handler_t *handler,
3506 void **handler_baton,
3508 /** Same as #svn_repos_parse_fns3_t.close_node. */
3509 svn_error_t *(*close_node)(void *node_baton);
3510 /** Same as #svn_repos_parse_fns3_t.close_revision. */
3511 svn_error_t *(*close_revision)(void *revision_baton);
3512 } svn_repos_parse_fns2_t;
3514 /** @deprecated Provided for backward compatibility with the 1.7 API. */
3515 typedef svn_repos_parse_fns2_t svn_repos_parser_fns2_t;
3519 * A vtable that is driven by svn_repos_parse_dumpstream().
3520 * Similar to #svn_repos_parse_fns2_t except that it lacks
3521 * the delete_node_property and apply_textdelta callbacks.
3523 * @deprecated Provided for backward compatibility with the 1.0 API.
3525 typedef struct svn_repos_parse_fns_t
3527 /** Same as #svn_repos_parse_fns2_t.new_revision_record. */
3528 svn_error_t *(*new_revision_record)(void **revision_baton,
3529 apr_hash_t *headers,
3532 /** Same as #svn_repos_parse_fns2_t.uuid_record. */
3533 svn_error_t *(*uuid_record)(const char *uuid,
3536 /** Same as #svn_repos_parse_fns2_t.new_node_record. */
3537 svn_error_t *(*new_node_record)(void **node_baton,
3538 apr_hash_t *headers,
3539 void *revision_baton,
3541 /** Same as #svn_repos_parse_fns2_t.set_revision_property. */
3542 svn_error_t *(*set_revision_property)(void *revision_baton,
3544 const svn_string_t *value);
3545 /** Same as #svn_repos_parse_fns2_t.set_node_property. */
3546 svn_error_t *(*set_node_property)(void *node_baton,
3548 const svn_string_t *value);
3549 /** Same as #svn_repos_parse_fns2_t.remove_node_props. */
3550 svn_error_t *(*remove_node_props)(void *node_baton);
3551 /** Same as #svn_repos_parse_fns2_t.set_fulltext. */
3552 svn_error_t *(*set_fulltext)(svn_stream_t **stream,
3554 /** Same as #svn_repos_parse_fns2_t.close_node. */
3555 svn_error_t *(*close_node)(void *node_baton);
3556 /** Same as #svn_repos_parse_fns2_t.close_revision. */
3557 svn_error_t *(*close_revision)(void *revision_baton);
3558 } svn_repos_parser_fns_t;
3562 * Similar to svn_repos_parse_dumpstream3(), but uses the more limited
3563 * #svn_repos_parser_fns2_t vtable type.
3565 * @deprecated Provided for backward compatibility with the 1.7 API.
3569 svn_repos_parse_dumpstream2(svn_stream_t *stream,
3570 const svn_repos_parser_fns2_t *parse_fns,
3572 svn_cancel_func_t cancel_func,
3577 * Similar to svn_repos_parse_dumpstream2(), but uses the more limited
3578 * #svn_repos_parser_fns_t vtable type.
3580 * @deprecated Provided for backward compatibility with the 1.0 API.
3584 svn_repos_parse_dumpstream(svn_stream_t *stream,
3585 const svn_repos_parser_fns_t *parse_fns,
3587 svn_cancel_func_t cancel_func,
3592 * Similar to svn_repos_get_fs_build_parser4(), but with @a start_rev
3593 * and @a end_rev always passed as #SVN_INVALID_REVNUM, and yielding
3594 * the more limited svn_repos_parse_fns2_t.
3596 * @since New in 1.7.
3597 * @deprecated Provided for backward compatibility with the 1.7 API.
3601 svn_repos_get_fs_build_parser3(const svn_repos_parse_fns2_t **parser,
3604 svn_boolean_t use_history,
3605 svn_boolean_t validate_props,
3606 enum svn_repos_load_uuid uuid_action,
3607 const char *parent_dir,
3608 svn_repos_notify_func_t notify_func,
3613 * Similar to svn_repos_get_fs_build_parser3(), but with @a outstream
3614 * in place if a #svn_repos_notify_func_t and baton and with
3615 * @a validate_props always FALSE.
3617 * @since New in 1.1.
3618 * @deprecated Provided for backward compatibility with the 1.6 API.
3622 svn_repos_get_fs_build_parser2(const svn_repos_parse_fns2_t **parser,
3625 svn_boolean_t use_history,
3626 enum svn_repos_load_uuid uuid_action,
3627 svn_stream_t *outstream,
3628 const char *parent_dir,
3632 * Similar to svn_repos_get_fs_build_parser2(), but yields the more
3633 * limited svn_repos_parser_fns_t vtable type.
3635 * @deprecated Provided for backward compatibility with the 1.0 API.
3639 svn_repos_get_fs_build_parser(const svn_repos_parser_fns_t **parser,
3642 svn_boolean_t use_history,
3643 enum svn_repos_load_uuid uuid_action,
3644 svn_stream_t *outstream,
3645 const char *parent_dir,
3651 /** A data type which stores the authz information.
3653 * @since New in 1.3.
3655 typedef struct svn_authz_t svn_authz_t;
3658 * Read authz configuration data from @a path (a dirent, an absolute file url
3659 * or a registry path) into @a *authz_p, allocated in @a pool.
3661 * If @a groups_path (a dirent, an absolute file url, or a registry path) is
3662 * set, use the global groups parsed from it.
3664 * If @a path or @a groups_path is not a valid authz rule file, then return
3665 * #SVN_ERR_AUTHZ_INVALID_CONFIG. The contents of @a *authz_p is then
3666 * undefined. If @a must_exist is TRUE, a missing authz or groups file
3667 * is also an error other than #SVN_ERR_AUTHZ_INVALID_CONFIG (exact error
3668 * depends on the access type).
3670 * @since New in 1.8.
3673 svn_repos_authz_read2(svn_authz_t **authz_p,
3675 const char *groups_path,
3676 svn_boolean_t must_exist,
3681 * Similar to svn_repos_authz_read2(), but with @a groups_path and @a
3682 * repos_root always passed as @c NULL.
3684 * @since New in 1.3.
3685 * @deprecated Provided for backward compatibility with the 1.7 API.
3689 svn_repos_authz_read(svn_authz_t **authz_p,
3691 svn_boolean_t must_exist,
3695 * Read authz configuration data from @a stream into @a *authz_p,
3696 * allocated in @a pool.
3698 * If @a groups_stream is set, use the global groups parsed from it.
3700 * @since New in 1.8.
3703 svn_repos_authz_parse(svn_authz_t **authz_p,
3704 svn_stream_t *stream,
3705 svn_stream_t *groups_stream,
3709 * Check whether @a user can access @a path in the repository @a
3710 * repos_name with the @a required_access. @a authz lists the ACLs to
3711 * check against. Set @a *access_granted to indicate if the requested
3712 * access is granted.
3714 * If @a path is NULL, then check whether @a user has the @a
3715 * required_access anywhere in the repository. Set @a *access_granted
3716 * to TRUE if at least one path is accessible with the @a
3719 * For compatibility with 1.6, and earlier, @a repos_name can be NULL
3720 * in which case it is equivalent to a @a repos_name of "".
3722 * @note Presently, @a repos_name must byte-for-byte match the repos_name
3723 * specified in the authz file; it is treated as an opaque string, and not
3726 * @since New in 1.3.
3729 svn_repos_authz_check_access(svn_authz_t *authz,
3730 const char *repos_name,
3733 svn_repos_authz_access_t required_access,
3734 svn_boolean_t *access_granted,
3739 /** Revision Access Levels
3741 * Like most version control systems, access to versioned objects in
3742 * Subversion is determined on primarily path-based system. Users either
3743 * do or don't have the ability to read a given path.
3745 * However, unlike many version control systems where versioned objects
3746 * maintain their own distinct version information (revision numbers,
3747 * authors, log messages, change timestamps, etc.), Subversion binds
3748 * multiple paths changed as part of a single commit operation into a
3749 * set, calls the whole thing a revision, and hangs commit metadata
3750 * (author, date, log message, etc.) off of that revision. So, commit
3751 * metadata is shared across all the paths changed as part of a given
3754 * It is common (or, at least, we hope it is) for log messages to give
3755 * detailed information about changes made in the commit to which the log
3756 * message is attached. Such information might include a mention of all
3757 * the files changed, what was changed in them, and so on. But this
3758 * causes a problem when presenting information to readers who aren't
3759 * authorized to read every path in the repository. Simply knowing that
3760 * a given path exists may be a security leak, even if the user can't see
3761 * the contents of the data located at that path.
3763 * So Subversion does what it reasonably can to prevent the leak of this
3764 * information, and does so via a staged revision access policy. A
3765 * reader can be said to have one of three levels of access to a given
3766 * revision's metadata, based solely on the reader's access rights to the
3767 * paths changed or copied in that revision:
3769 * 'full access' -- Granted when the reader has access to all paths
3770 * changed or copied in the revision, or when no paths were
3771 * changed in the revision at all, this access level permits
3772 * full visibility of all revision property names and values,
3773 * and the full changed-paths information.
3775 * 'no access' -- Granted when the reader does not have access to any
3776 * paths changed or copied in the revision, this access level
3777 * denies the reader access to all revision properties and all
3778 * changed-paths information.
3780 * 'partial access' -- Granted when the reader has access to at least
3781 * one, but not all, of the paths changed or copied in the revision,
3782 * this access level permits visibility of the svn:date and
3783 * svn:author revision properties and only the paths of the
3784 * changed-paths information to which the reader has access.
3789 /** An enum defining levels of revision access.
3791 * @since New in 1.5.
3793 typedef enum svn_repos_revision_access_level_t
3795 /** no access allowed to the revision properties and all changed-paths
3797 svn_repos_revision_access_none,
3798 /** access granted to some (svn:date and svn:author) revision properties and
3799 * changed-paths information on paths the read has access to. */
3800 svn_repos_revision_access_partial,
3801 /** access granted to all revision properites and changed-paths
3803 svn_repos_revision_access_full
3805 svn_repos_revision_access_level_t;
3809 * Set @a access to the access level granted for @a revision in @a
3810 * repos, as determined by consulting the @a authz_read_func callback
3811 * function and its associated @a authz_read_baton.
3813 * @a authz_read_func may be @c NULL, in which case @a access will be
3814 * set to #svn_repos_revision_access_full.
3816 * @since New in 1.5.
3819 svn_repos_check_revision_access(svn_repos_revision_access_level_t *access_level,
3821 svn_revnum_t revision,
3822 svn_repos_authz_func_t authz_read_func,
3823 void *authz_read_baton,
3829 #endif /* __cplusplus */
3831 #endif /* SVN_REPOS_H */