Details | Compare with Previous | View Log
Line No. | Rev | Author | Line |
---|---|---|---|
1 | 3 | Ailae-78500 | #!/bin/sh |
2 | Ailae-78500 | ||
3 | Ailae-78500 | # POST-UNLOCK HOOK |
|
4 | Ailae-78500 | # |
|
5 | Ailae-78500 | # The post-unlock hook runs after a path is unlocked. Subversion runs |
|
6 | Ailae-78500 | # this hook by invoking a program (script, executable, binary, etc.) |
|
7 | Ailae-78500 | # named 'post-unlock' (for which this file is a template) with the |
|
8 | Ailae-78500 | # following ordered arguments: |
|
9 | Ailae-78500 | # |
|
10 | Ailae-78500 | # [1] REPOS-PATH (the path to this repository) |
|
11 | Ailae-78500 | # [2] USER (the user who destroyed the lock) |
|
12 | Ailae-78500 | # |
|
13 | Ailae-78500 | # The paths that were just unlocked are passed to the hook via STDIN |
|
14 | Ailae-78500 | # (as of Subversion 1.2, only one path is passed per invocation, but |
|
15 | Ailae-78500 | # the plan is to pass all unlocked paths at once, so the hook program |
|
16 | Ailae-78500 | # should be written accordingly). |
|
17 | Ailae-78500 | # |
|
18 | Ailae-78500 | # The default working directory for the invocation is undefined, so |
|
19 | Ailae-78500 | # the program should set one explicitly if it cares. |
|
20 | Ailae-78500 | # |
|
21 | Ailae-78500 | # Because the lock has already been destroyed and cannot be undone, |
|
22 | Ailae-78500 | # the exit code of the hook program is ignored. |
|
23 | Ailae-78500 | # |
|
24 | Ailae-78500 | # On a Unix system, the normal procedure is to have 'post-unlock' |
|
25 | Ailae-78500 | # invoke other programs to do the real work, though it may do the |
|
26 | Ailae-78500 | # work itself too. |
|
27 | Ailae-78500 | # |
|
28 | Ailae-78500 | # Note that 'post-unlock' must be executable by the user(s) who will |
|
29 | Ailae-78500 | # invoke it (typically the user httpd runs as), and that user must |
|
30 | Ailae-78500 | # have filesystem-level permission to access the repository. |
|
31 | Ailae-78500 | # |
|
32 | Ailae-78500 | # On a Windows system, you should name the hook program |
|
33 | Ailae-78500 | # 'post-unlock.bat' or 'post-unlock.exe', |
|
34 | Ailae-78500 | # but the basic idea is the same. |
|
35 | Ailae-78500 | # |
|
36 | Ailae-78500 | # Here is an example hook script, for a Unix /bin/sh interpreter: |
|
37 | Ailae-78500 | ||
38 | Ailae-78500 | REPOS="$1" |
|
39 | Ailae-78500 | USER="$2" |
|
40 | Ailae-78500 | ||
41 | Ailae-78500 | # Send email to interested parties, let them know a lock was removed: |
|
42 | Ailae-78500 | mailer.py unlock "$REPOS" "$USER" /path/to/mailer.conf |