Subversion
|
Locking commands. More...
Functions | |
svn_error_t * | svn_client_lock (const apr_array_header_t *targets, const char *comment, svn_boolean_t steal_lock, svn_client_ctx_t *ctx, apr_pool_t *pool) |
Lock targets in the repository. | |
svn_error_t * | svn_client_unlock (const apr_array_header_t *targets, svn_boolean_t break_lock, svn_client_ctx_t *ctx, apr_pool_t *pool) |
Unlock targets in the repository. |
Locking commands.
svn_error_t* svn_client_lock | ( | const apr_array_header_t * | targets, |
const char * | comment, | ||
svn_boolean_t | steal_lock, | ||
svn_client_ctx_t * | ctx, | ||
apr_pool_t * | pool | ||
) |
Lock targets in the repository.
targets is an array of const char *
paths - either all working copy paths or URLs. All targets must be in the same repository.
If a target is already locked in the repository, no lock will be acquired unless steal_lock is TRUE, in which case the locks are stolen. comment, if non-NULL, is an xml-escapable description stored with each lock in the repository. Each acquired lock will be stored in the working copy if the targets are WC paths.
For each target ctx->notify_func2/notify_baton2 will be used to indicate whether it was locked. An action of svn_wc_notify_locked means that the path was locked. If the path was not locked because it was out of date or there was already a lock in the repository, the notification function will be called with svn_wc_notify_failed_lock, and the error passed in the notification structure.
Use pool for temporary allocations.
svn_error_t* svn_client_unlock | ( | const apr_array_header_t * | targets, |
svn_boolean_t | break_lock, | ||
svn_client_ctx_t * | ctx, | ||
apr_pool_t * | pool | ||
) |
Unlock targets in the repository.
targets is an array of const char *
paths - either all working copy paths or all URLs. All targets must be in the same repository.
If the targets are WC paths, and break_lock is FALSE, the working copy must contain a locks for each target. If this is not the case, or the working copy lock doesn't match the lock token in the repository, an error will be signaled.
If the targets are URLs, the locks may be broken even if break_lock is FALSE, but only if the lock owner is the same as the authenticated user.
If break_lock is TRUE, the locks will be broken in the repository. In both cases, the locks, if any, will be removed from the working copy if the targets are WC paths.
The notification functions in ctx will be called for each target. If the target was successfully unlocked, svn_wc_notify_unlocked will be used. Else, if the error is directly related to unlocking the path (see SVN_ERR_IS_UNLOCK_ERROR), svn_wc_notify_failed_unlock will be used and the error will be passed in the notification structure.
Use pool for temporary allocations.