Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2228 - 1
#!/bin/sh
2
 
3
# POST-UNLOCK HOOK
4
#
5
# The post-unlock hook runs after a path is unlocked.  Subversion runs
6
# this hook by invoking a program (script, executable, binary, etc.)
7
# named 'post-unlock' (for which this file is a template) with the
8
# following ordered arguments:
9
#
10
#   [1] REPOS-PATH   (the path to this repository)
11
#   [2] USER         (the user who destroyed the lock)
12
#
13
# The paths that were just unlocked are passed to the hook via STDIN.
14
#
15
# Because the lock has already been destroyed and cannot be undone,
16
# the exit code of the hook program is ignored.
17
#
18
# The default working directory for the invocation is undefined, so
19
# the program should set one explicitly if it cares.
20
#
21
# On a Unix system, the normal procedure is to have 'post-unlock'
22
# invoke other programs to do the real work, though it may do the
23
# work itself too.
24
#
25
# Note that 'post-unlock' must be executable by the user(s) who will
26
# invoke it (typically the user httpd runs as), and that user must
27
# have filesystem-level permission to access the repository.
28
#
29
# On a Windows system, you should name the hook program
30
# 'post-unlock.bat' or 'post-unlock.exe',
31
# but the basic idea is the same.
32
#
33
# The hook program runs in an empty environment, unless the server is
34
# explicitly configured otherwise.  For example, a common problem is for
35
# the PATH environment variable to not be set to its usual value, so
36
# that subprograms fail to launch unless invoked via absolute path.
37
# If you're having unexpected problems with a hook program, the
38
# culprit may be unusual (or missing) environment variables.
39
#
40
# CAUTION:
41
# For security reasons, you MUST always properly quote arguments when
42
# you use them, as those arguments could contain whitespace or other
43
# problematic characters. Additionally, you should delimit the list
44
# of options with "--" before passing the arguments, so malicious
45
# clients cannot bootleg unexpected options to the commands your
46
# script aims to execute.
47
# For similar reasons, you should also add a trailing @ to URLs which
48
# are passed to SVN commands accepting URLs with peg revisions.
49
#
50
# Here is an example hook script, for a Unix /bin/sh interpreter.
51
# For more examples and pre-written hooks, see those in
52
# the Subversion repository at
53
# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and
54
# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/
55
 
56
 
57
REPOS="$1"
58
USER="$2"
59
 
60
# Send email to interested parties, let them know a lock was removed:
61
mailer.py unlock "$REPOS" "$USER" /path/to/mailer.conf