Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/include/svn_fs.h view on Meta::CPAN
*/
/** Lock @a path in @a fs, and set @a *lock to a lock
* representing the new lock, allocated in @a pool.
*
* @warning You may prefer to use svn_repos_fs_lock() instead,
* which see.
*
* @a fs must have a username associated with it (see
* #svn_fs_access_t), else return #SVN_ERR_FS_NO_USER. Set the
* 'owner' field in the new lock to the fs username.
*
* @a comment is optional: it's either an xml-escapable UTF8 string
* which describes the lock, or it is @c NULL.
*
* @a is_dav_comment describes whether the comment was created by a
* generic DAV client; only mod_dav_svn's autoversioning feature needs
* to use it. If in doubt, pass 0.
*
* If path is already locked, then return #SVN_ERR_FS_PATH_ALREADY_LOCKED,
* unless @a steal_lock is TRUE, in which case "steal" the existing
* lock, even if the FS access-context's username does not match the
* current lock's owner: delete the existing lock on @a path, and
* create a new one.
*
* @a token is a lock token such as can be generated using
* svn_fs_generate_lock_token() (indicating that the caller wants to
* dictate the lock token used), or it is @c NULL (indicating that the
* caller wishes to have a new token generated by this function). If
* @a token is not @c NULL, and represents an existing lock, then @a
* path must match the path associated with that existing lock.
*
* If @a expiration_date is zero, then create a non-expiring lock.
* Else, the lock will expire at @a expiration_date.
*
* If @a current_rev is a valid revnum, then do an out-of-dateness
* check. If the revnum is less than the last-changed-revision of @a
* path (or if @a path doesn't exist in HEAD), return
* #SVN_ERR_FS_OUT_OF_DATE.
*
* @note At this time, only files can be locked.
*/
svn_error_t *
svn_fs_lock(svn_lock_t **lock,
svn_fs_t *fs,
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);
/** Generate a unique lock-token using @a fs. Return in @a *token,
* allocated in @a pool.
*
* This can be used in to populate lock->token before calling
* svn_fs_attach_lock().
*/
svn_error_t *
svn_fs_generate_lock_token(const char **token,
svn_fs_t *fs,
apr_pool_t *pool);
/** Remove the lock on @a path represented by @a token in @a fs.
*
* If @a token doesn't point to a lock, return #SVN_ERR_FS_BAD_LOCK_TOKEN.
* If @a token points to an expired lock, return #SVN_ERR_FS_LOCK_EXPIRED.
* If @a fs has no username associated with it, return #SVN_ERR_FS_NO_USER
* unless @a break_lock is specified.
*
* If @a token points to a lock, but the username of @a fs's access
* context doesn't match the lock's owner, return
* #SVN_ERR_FS_LOCK_OWNER_MISMATCH. If @a break_lock is TRUE, however, don't
* return error; allow the lock to be "broken" in any case. In the latter
* case, @a token shall be @c NULL.
*
* Use @a pool for temporary allocations.
*/
svn_error_t *
svn_fs_unlock(svn_fs_t *fs,
const char *path,
const char *token,
svn_boolean_t break_lock,
apr_pool_t *pool);
/** If @a path is locked in @a fs, set @a *lock to an svn_lock_t which
* represents the lock, allocated in @a pool.
*
* If @a path is not locked, set @a *lock to NULL.
*/
svn_error_t *
svn_fs_get_lock(svn_lock_t **lock,
svn_fs_t *fs,
const char *path,
apr_pool_t *pool);
/** The type of a lock discovery callback function. @a baton is the
* value specified in the call to svn_fs_get_locks(); the filesystem
* passes it through to the callback. @a lock is a lock structure.
* @a pool is a temporary subpool for use by the callback
* implementation -- it is cleared after invocation of the callback.
*/
typedef svn_error_t *(*svn_fs_get_locks_callback_t)(void *baton,
svn_lock_t *lock,
apr_pool_t *pool);
/** Report locks on or below @a path in @a fs using the @a
* get_locks_func / @a get_locks_baton. Use @a pool for necessary
* allocations.
*
* @a depth limits the reported locks to those associated with paths
* within the specified depth of @a path, and must be one of the
* following values: #svn_depth_empty, #svn_depth_files,
( run in 0.549 second using v1.01-cache-2.11-cpan-e1769b4cff6 )