📄 svn_repos.h
字号:
* @since New in 1.1.
*
* Call @a history_func (with @a history_baton) for each interesting
* history location in the lifetime of @a path in @a fs, from the
* youngest of @a end and @ start to the oldest. Only cross
* filesystem copy history if @a cross_copies is @c TRUE. And do all
* of this in @a pool.
*
* If @a authz_read_func is non-NULL, then use it (and @a
* authz_read_baton) to verify that @a path in @a end is readable; if
* not, return SVN_ERR_AUTHZ_UNREADABLE. Also verify the readability
* of every ancestral path/revision pair before pushing them at @a
* history_func. If a pair is deemed unreadable, then do not send
* them; instead, immmediately stop traversing history and return
* SVN_NO_ERROR.
*/
svn_error_t *
svn_repos_history2 (svn_fs_t *fs,
const char *path,
svn_repos_history_func_t history_func,
void *history_baton,
svn_repos_authz_func_t authz_read_func,
void *authz_read_baton,
svn_revnum_t start,
svn_revnum_t end,
svn_boolean_t cross_copies,
apr_pool_t *pool);
/**
* @deprecated Provided for backward compatibility with the 1.0.0 API.
*
* Similar to svn_repos_history(), but with @a authz_read_func and
* @a authz_read_baton always set to NULL.
*/
svn_error_t *
svn_repos_history (svn_fs_t *fs,
const char *path,
svn_repos_history_func_t history_func,
void *history_baton,
svn_revnum_t start,
svn_revnum_t end,
svn_boolean_t cross_copies,
apr_pool_t *pool);
/**
* @since New in 1.1.
*
* Set @a *locations to be a mapping of the revisions to the paths of
* the file @a fs_path present at the repository in revision
* @a peg_revision, where the revisions are taken out of the array
* @a location_revisions.
*
* @a location_revisions is an array of svn_revnum_t's and @a *locations
* maps svn_revnum_t's to const char *.
*
* If optional @a authz_read_func is non-NULL, then use it (and @a
* authz_read_baton) to verify that the peg-object is readable. If not,
* return SVN_ERR_AUTHZ_UNREADABLE. Also use the @a authz_read_func
* to check that every path returned in the hash is readable. If an
* unreadable path is encountered, stop tracing and return
* SVN_NO_ERROR.
*
* @a pool is used for all allocations.
*/
svn_error_t *
svn_repos_trace_node_locations (svn_fs_t *fs,
apr_hash_t **locations,
const char *fs_path,
svn_revnum_t peg_revision,
apr_array_header_t *location_revisions,
svn_repos_authz_func_t authz_read_func,
void *authz_read_baton,
apr_pool_t *pool);
/* ### other queries we can do someday --
* fetch the last revision created by <user>
(once usernames become revision properties!)
* fetch the last revision where <path> was modified
*/
/* ---------------------------------------------------------------*/
/* Retrieving log messages. */
/** Invoke @a receiver with @a receiver_baton on each log message from
* @a start to @a end in @a repos's filesystem. @a start may be greater
* or less than @a end; this just controls whether the log messages are
* processed in descending or ascending revision number order.
*
* If @a start or @a end is @c SVN_INVALID_REVNUM, it defaults to youngest.
*
* If @a paths is non-null and has one or more elements, then only show
* revisions in which at least one of @a paths was changed (i.e., if
* file, text or props changed; if dir, props changed or an entry was
* added or deleted). Each path is an <tt>const char *</tt> representing
* an absolute path in the repository.
*
* ### todo: need to consider whether the above directory behavior is
* most useful, or if we should actually treat _any_ node change in a
* directory as a visible change for purposes of log... i.e., show
* bubble-up. The reason this might be useful is so that running log
* on a directory would give a msg for every change under that dir,
* no matter how far down. See the thread started on the dev list by
* Lars Kellogg-Stedman <lars@larsshack.org> with the subject
* "Single repository, multiple projects?" for more. We may simple
* need to offer a few different semantics for @a paths.
*
* If @a discover_changed_paths, then each call to @a receiver passes a
* <tt>const apr_hash_t *</tt> for the receiver's @a changed_paths
* argument; the hash's keys are all the paths committed in that revision.
* Otherwise, each call to @a receiver passes null for @a changed_paths.
*
* If @a strict_node_history is set, copy history (if any exists) will
* not be traversed while harvesting revision logs for each path.
*
* If any invocation of @a receiver returns error, return that error
* immediately and without wrapping it.
*
* If @a start or @a end is a non-existent revision, return the error
* @c SVN_ERR_FS_NO_SUCH_REVISION, without ever invoking @a receiver.
*
* If optional @a authz_read_func is non-NULL, then use this function
* (along with optional @a authz_read_baton) to check the readability
* of each changed-path in each revision about to be "pushed" at
* @a receiver. If a revision has all unreadable changed-paths, then
* don't push the revision at all. If a revision has a mixture of
* readable and unreadable changed-paths, then silently omit the
* unreadable changed-paths when pushing the revision.
*
* See also the documentation for @c svn_log_message_receiver_t.
*
* Use @a pool for temporary allocations.
*/
svn_error_t *
svn_repos_get_logs2 (svn_repos_t *repos,
const apr_array_header_t *paths,
svn_revnum_t start,
svn_revnum_t end,
svn_boolean_t discover_changed_paths,
svn_boolean_t strict_node_history,
svn_repos_authz_func_t authz_read_func,
void *authz_read_baton,
svn_log_message_receiver_t receiver,
void *receiver_baton,
apr_pool_t *pool);
/**
* @deprecated Provided for backward compatibility with the 1.0.0 API.
*
* Same as to svn_repos_dump_fs2(), but with @a authz_read_func and
* @a authz_read_baton always set to NULL.
*/
svn_error_t *
svn_repos_get_logs (svn_repos_t *repos,
const apr_array_header_t *paths,
svn_revnum_t start,
svn_revnum_t end,
svn_boolean_t discover_changed_paths,
svn_boolean_t strict_node_history,
svn_log_message_receiver_t receiver,
void *receiver_baton,
apr_pool_t *pool);
/* ---------------------------------------------------------------*/
/* Retreiving multiple revisions of a file. */
/** @since New in 1.1.
* Retrieve a subset of the interesting revisions of a file @a path in
* @a repos as seen in revision @a end. Invoke @a handler with
* @a handler_baton as its first argument for each such revision.
* @a pool is used for all allocations. See @c svn_fs_history_prev for
* a discussion of interesting revisions.
*
* If optional @a authz_read_func is non-NULL, then use this function
* (along with optional @a authz_read_baton) to check the readability
* of the rev-path in each interesting revision encountered.
*
* Revision discovery happens from @a end to @a start, and if an
* unreadable revision is encountered before @a start is reached, then
* revision discovery stops and only the revisions from @a end to the
* oldest readable revision are returned (So it will appear that @a
* path was added without history in the latter revision).
*
* If there is an interesting revision of the file that is less than or
* equal to start, the iteration will start at that revision. Else, the
* iteration will start at the first revision of the file in the repository,
* which has to be less than or equal to end. Note that if the function
* succeeds, @a handler will have been called at least once.
*
* In a series of calls, the file contents for the first interesting revision
* will be provided as a text delta against the empty file. In the following
* calls, the delta will be against the contents for the previous call. */
svn_error_t *svn_repos_get_file_revs (svn_repos_t *repos,
const char *path,
svn_revnum_t start,
svn_revnum_t end,
svn_repos_authz_func_t authz_read_func,
void *authz_read_baton,
svn_repos_file_rev_handler_t handler,
void *handler_baton,
apr_pool_t *pool);
/* ---------------------------------------------------------------*/
/**
* @defgroup svn_repos_hook_wrappers Hook-sensitive wrappers for libsvn_fs
* routines.
* @{
*/
/** Like @c svn_fs_commit_txn(), but invoke the @a repos's pre- and
* post-commit hooks around the commit. Use @a pool for any necessary
* allocations.
*
* If the pre-commit hook or svn_fs_commit_txn() fails, throw the
* original error to caller. If an error occurs when running the
* post-commit hook, return the original error wrapped with
* SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED. If the caller sees this
* error, it knows that the commit succeeded anyway.
*
* @a conflict_p, @a new_rev, and @a txn are as in @c svn_fs_commit_txn().
*/
svn_error_t *svn_repos_fs_commit_txn (const char **conflict_p,
svn_repos_t *repos,
svn_revnum_t *new_rev,
svn_fs_txn_t *txn,
apr_pool_t *pool);
/** Like @c svn_fs_begin_txn(), but use @a author and @a log_msg to set the
* corresponding properties on transaction @a *txn_p. @a repos is the
* repository object which contains the filesystem. @a rev, @a *txn_p, and
* @a pool are as in @c svn_fs_begin_txn().
*
* Before a txn is created, the repository's start-commit hooks are
* run; if any of them fail, no txn is created, @a *txn_p is unaffected,
* and @c SVN_ERR_REPOS_HOOK_FAILURE is returned.
*
* @a log_msg may be @c NULL to indicate the message is not (yet) available.
* The caller will need to attach it to the transaction at a later time.
*/
svn_error_t *svn_repos_fs_begin_txn_for_commit (svn_fs_txn_t **txn_p,
svn_repos_t *repos,
svn_revnum_t rev,
const char *author,
const char *log_msg,
apr_pool_t *pool);
/** Like @c svn_fs_begin_txn(), but use @a author to set the corresponding
* property on transaction @a *txn_p. @a repos is the repository object
* which contains the filesystem. @a rev, @a *txn_p, and @a pool are as in
* @c svn_fs_begin_txn().
*
* ### Someday: before a txn is created, some kind of read-hook could
* be called here.
*/
svn_error_t *svn_repos_fs_begin_txn_for_update (svn_fs_txn_t **txn_p,
svn_repos_t *repos,
svn_revnum_t rev,
const char *author,
apr_pool_t *pool);
/**
* @since New in 1.1.
*
* Like @c svn_fs_change_rev_prop(), but invoke the @a repos's pre- and
* post-revprop-change hooks around the change. Use @a pool for
* temporary allocations.
*
* @a rev is the revision whose property to change, @a name is the
* name of the property, and @a new_value is the new value of the
* property. @a author is the authenticated username of the person
* changing the property value, or null if not available.
*
* If @a authz_read_func is non-NULL, then use it (with @a
* authz_read_baton) to validate the changed-paths associated with @a
* rev. If the revision contains any unreadable changed paths, then
* return SVN_ERR_AUTHZ_UNREADABLE.
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -