Subversion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
Repository lock wrappers

Functions

svn_error_tsvn_repos_fs_lock_many (svn_repos_t *repos, apr_hash_t *lock_targets, const char *comment, svn_boolean_t is_dav_comment, apr_time_t expiration_date, svn_boolean_t steal_lock, svn_fs_lock_callback_t lock_callback, void *lock_baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
 Like svn_fs_lock_many(), but invoke the repos's pre- and post-lock hooks before and after the locking action.
 
svn_error_tsvn_repos_fs_lock (svn_lock_t **lock, svn_repos_t *repos, const char *path, const char *token, const char *comment, svn_boolean_t is_dav_comment, apr_time_t expiration_date, svn_revnum_t current_rev, svn_boolean_t steal_lock, apr_pool_t *pool)
 Similar to svn_repos_fs_lock_many() but locks only a single path.
 
svn_error_tsvn_repos_fs_unlock_many (svn_repos_t *repos, apr_hash_t *unlock_targets, svn_boolean_t break_lock, svn_fs_lock_callback_t lock_callback, void *lock_baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
 Like svn_fs_unlock_many(), but invoke the repos's pre- and post-unlock hooks before and after the unlocking action.
 
svn_error_tsvn_repos_fs_unlock (svn_repos_t *repos, const char *path, const char *token, svn_boolean_t break_lock, apr_pool_t *pool)
 Similar to svn_repos_fs_unlock_many() but only unlocks a single path.
 
svn_error_tsvn_repos_fs_get_locks2 (apr_hash_t **locks, svn_repos_t *repos, const char *path, svn_depth_t depth, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
 Look up all the locks in and under path in repos, setting *locks to a hash which maps const char * paths to the svn_lock_t locks associated with those paths.
 
svn_error_tsvn_repos_fs_get_locks (apr_hash_t **locks, svn_repos_t *repos, const char *path, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
 Similar to svn_repos_fs_get_locks2(), but with depth always passed as svn_depth_infinity.
 

Detailed Description

Function Documentation

svn_error_t* svn_repos_fs_get_locks ( apr_hash_t **  locks,
svn_repos_t repos,
const char *  path,
svn_repos_authz_func_t  authz_read_func,
void *  authz_read_baton,
apr_pool_t *  pool 
)

Similar to svn_repos_fs_get_locks2(), but with depth always passed as svn_depth_infinity.

Since
New in 1.2.
Deprecated:
Provided for backward compatibility with the 1.6 API.
svn_error_t* svn_repos_fs_get_locks2 ( apr_hash_t **  locks,
svn_repos_t repos,
const char *  path,
svn_depth_t  depth,
svn_repos_authz_func_t  authz_read_func,
void *  authz_read_baton,
apr_pool_t *  pool 
)

Look up all the locks in and under path in repos, setting *locks to a hash which maps const char * paths to the svn_lock_t locks associated with those paths.

Use authz_read_func and authz_read_baton to "screen" all returned locks. That is: do not return any locks on any paths that are unreadable in HEAD, just silently omit them.

depth limits the returned locks to those associated with paths within the specified depth of path, and must be one of the following values: svn_depth_empty, svn_depth_files, svn_depth_immediates, or svn_depth_infinity.

Since
New in 1.7.
svn_error_t* svn_repos_fs_lock ( svn_lock_t **  lock,
svn_repos_t repos,
const char *  path,
const char *  token,
const char *  comment,
svn_boolean_t  is_dav_comment,
apr_time_t  expiration_date,
svn_revnum_t  current_rev,
svn_boolean_t  steal_lock,
apr_pool_t *  pool 
)

Similar to svn_repos_fs_lock_many() but locks only a single path.

Since
New in 1.2.
svn_error_t* svn_repos_fs_lock_many ( svn_repos_t repos,
apr_hash_t *  lock_targets,
const char *  comment,
svn_boolean_t  is_dav_comment,
apr_time_t  expiration_date,
svn_boolean_t  steal_lock,
svn_fs_lock_callback_t  lock_callback,
void *  lock_baton,
apr_pool_t *  result_pool,
apr_pool_t *  scratch_pool 
)

Like svn_fs_lock_many(), but invoke the repos's pre- and post-lock hooks before and after the locking action.

The pre-lock is run for every path in targets. Those targets for which the pre-lock is successful are passed to svn_fs_lock_many and the post-lock is run for those that are successfully locked. Pre-lock hook errors are passed to lock_callback.

For each path in targets lock_callback will be invoked passing lock_baton and the lock and error that apply to path. lock_callback can be NULL in which case it is not called and any errors that would have been passed to the callback are not reported.

If an error occurs when running the post-lock hook the error is returned wrapped with SVN_ERR_REPOS_POST_LOCK_HOOK_FAILED. If the caller sees this error, it knows that some locks succeeded.

The pre-lock hook may cause a different token to be used for the lock, instead of the token supplied; see the pre-lock-hook documentation for more.

The lock and path passed to lock_callback will be allocated in result_pool. Use scratch_pool for temporary allocations.

Note
This function is not atomic. If it returns an error, some targets may remain unlocked while others may have been locked.
See Also
svn_fs_lock_many
Since
New in 1.9.
svn_error_t* svn_repos_fs_unlock ( svn_repos_t repos,
const char *  path,
const char *  token,
svn_boolean_t  break_lock,
apr_pool_t *  pool 
)

Similar to svn_repos_fs_unlock_many() but only unlocks a single path.

Since
New in 1.2.
svn_error_t* svn_repos_fs_unlock_many ( svn_repos_t repos,
apr_hash_t *  unlock_targets,
svn_boolean_t  break_lock,
svn_fs_lock_callback_t  lock_callback,
void *  lock_baton,
apr_pool_t *  result_pool,
apr_pool_t *  scratch_pool 
)

Like svn_fs_unlock_many(), but invoke the repos's pre- and post-unlock hooks before and after the unlocking action.

The pre-unlock hook is run for every path in targets. Those targets for which the pre-unlock is successful are passed to svn_fs_unlock_many and the post-unlock is run for those that are successfully unlocked. Pre-unlock hook errors are passed to lock_callback.

For each path in targets lock_callback will be invoked passing lock_baton and error that apply to path. The lock passed to the callback will be NULL. lock_callback can be NULL in which case it is not called and any errors that would have been passed to the callback are not reported.

If an error occurs when running the post-unlock hook, return the original error wrapped with SVN_ERR_REPOS_POST_UNLOCK_HOOK_FAILED. If the caller sees this error, it knows that some unlocks succeeded.

The path passed to lock_callback will be allocated in result_pool. Use scratch_pool for temporary allocations.

Note
This function is not atomic. If it returns an error, some targets may remain locked while others may have been unlocked.
See Also
svn_fs_unlock_many
Since
New in 1.9.