This text is a work in progress—highly subject to change—and may not accurately describe any released version of the Apache™ Subversion® software. Bookmarking or otherwise referring others to this page is probably not such a smart idea. Please visit http://www.svnbook.com/ for stable versions of this book.

Name

pre-unlock — Notification of a path unlock attempt.

Synopsis

pre-unlock REPOS-PATH PATH USER TOKEN BREAK-UNLOCK

Description

The pre-unlock hook runs whenever someone attempts to remove a lock on a file. It can be used to create policies that specify which users are allowed to unlock particular paths. It's particularly important for determining policies about lock breakage. If user A locks a file, is user B allowed to break the lock? What if the lock is more than a week old? These sorts of things can be decided and enforced by the hook.

If the pre-unlock hook program returns a nonzero exit value, the unlock action is aborted and anything printed to stderr is marshalled back to the client.

Input parameter(s)

The command-line arguments passed to the hook program, in order, are:

  1. Repository path

  2. Versioned path which is to be unlocked

  3. Authenticated username of the person attempting the unlock

  4. Lock token associated with the lock which is to be removed

  5. 1 if the user is attempting to break the lock; 0 otherwise

Common uses

Access control