Subversion
Functions
Hook-sensitive wrappers for libsvn_fsroutines.

Functions

svn_error_tsvn_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 svn_fs_commit_txn(), but invoke the repos' pre- and post-commit hooks around the commit. More...
 
svn_error_tsvn_repos_fs_begin_txn_for_commit2 (svn_fs_txn_t **txn_p, svn_repos_t *repos, svn_revnum_t rev, apr_hash_t *revprop_table, apr_pool_t *pool)
 Like svn_fs_begin_txn(), but use revprop_table, a hash mapping const char * property names to svn_string_t values, to set the properties on transaction *txn_p. More...
 
svn_error_tsvn_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)
 Same as svn_repos_fs_begin_txn_for_commit2(), but with revprop_table set to a hash containing author and log_msg as the SVN_PROP_REVISION_AUTHOR and SVN_PROP_REVISION_LOG properties, respectively. More...
 
svn_error_tsvn_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)
 Like svn_fs_begin_txn(), but use author to set the corresponding property on transaction *txn_p. More...
 

Detailed Description

Function Documentation

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 
)

Same as svn_repos_fs_begin_txn_for_commit2(), but with revprop_table set to a hash containing author and log_msg as the SVN_PROP_REVISION_AUTHOR and SVN_PROP_REVISION_LOG properties, respectively.

author and log_msg may both be NULL.

Deprecated:
Provided for backward compatibility with the 1.4 API.
svn_error_t* svn_repos_fs_begin_txn_for_commit2 ( svn_fs_txn_t **  txn_p,
svn_repos_t repos,
svn_revnum_t  rev,
apr_hash_t *  revprop_table,
apr_pool_t *  pool 
)

Like svn_fs_begin_txn(), but use revprop_table, a hash mapping const char * property names to svn_string_t values, to set the properties on transaction *txn_p.

repos is the repository object which contains the filesystem. rev, *txn_p, and pool are as in 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, *txn_p is unaffected, and SVN_ERR_REPOS_HOOK_FAILURE is returned.

Note
revprop_table may contain an SVN_PROP_REVISION_DATE property, which will be set on the transaction, but that will be overwritten when the transaction is committed.
Since
New in 1.5.
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 
)

Like svn_fs_begin_txn(), but use author to set the corresponding property on transaction *txn_p.

repos is the repository object which contains the filesystem. rev, *txn_p, and pool are as in svn_fs_begin_txn().

Someday: before a txn is created, some kind of read-hook could

be called here.

Note
This function was never fully implemented, nor used. Ignore it.
Deprecated:
Provided for backward compatibility with the 1.7 API.
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 svn_fs_commit_txn(), but invoke the repos' pre- and post-commit hooks around the commit.

Use pool for any necessary allocations.

If the pre-commit hook fails, do not attempt to commit the transaction and throw the original error to the caller.

A successful commit is indicated by a valid revision value in *new_rev, not if svn_fs_commit_txn() returns an error, which can occur during its post commit FS processing. If the transaction was not committed, then return the associated error and do not execute the post-commit hook.

If the commit succeeds the post-commit hook is executed. If the post-commit hook returns an error, always wrap it with SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED; this allows the caller to find the post-commit hook error in the returned error chain. If both svn_fs_commit_txn() and the post-commit hook return errors, then svn_fs_commit_txn()'s error is the parent error and the SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED wrapped error is the child error.

conflict_p, new_rev, and txn are as in svn_fs_commit_txn().