| 1 |
2102
|
Luisehahne
|
#!/bin/sh
|
| 2 |
|
|
|
| 3 |
|
|
# POST-COMMIT HOOK
|
| 4 |
|
|
#
|
| 5 |
|
|
# The post-commit hook is invoked after a commit. Subversion runs
|
| 6 |
|
|
# this hook by invoking a program (script, executable, binary, etc.)
|
| 7 |
|
|
# named 'post-commit' (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] REV (the number of the revision just committed)
|
| 12 |
|
|
# [3] TXN-NAME (the name of the transaction that has become REV)
|
| 13 |
|
|
#
|
| 14 |
|
|
# The default working directory for the invocation is undefined, so
|
| 15 |
|
|
# the program should set one explicitly if it cares.
|
| 16 |
|
|
#
|
| 17 |
|
|
# Because the commit has already completed and cannot be undone,
|
| 18 |
|
|
# the exit code of the hook program is ignored. The hook program
|
| 19 |
|
|
# can use the 'svnlook' utility to help it examine the
|
| 20 |
|
|
# newly-committed tree.
|
| 21 |
|
|
#
|
| 22 |
|
|
# On a Unix system, the normal procedure is to have 'post-commit'
|
| 23 |
|
|
# invoke other programs to do the real work, though it may do the
|
| 24 |
|
|
# work itself too.
|
| 25 |
|
|
#
|
| 26 |
|
|
# Note that 'post-commit' must be executable by the user(s) who will
|
| 27 |
|
|
# invoke it (typically the user httpd runs as), and that user must
|
| 28 |
|
|
# have filesystem-level permission to access the repository.
|
| 29 |
|
|
#
|
| 30 |
|
|
# On a Windows system, you should name the hook program
|
| 31 |
|
|
# 'post-commit.bat' or 'post-commit.exe',
|
| 32 |
|
|
# but the basic idea is the same.
|
| 33 |
|
|
#
|
| 34 |
|
|
# The hook program typically does not inherit the environment of
|
| 35 |
|
|
# its parent process. For example, a common problem is for the
|
| 36 |
|
|
# PATH environment variable to not be set to its usual value, so
|
| 37 |
|
|
# that subprograms fail to launch unless invoked via absolute path.
|
| 38 |
|
|
# If you're having unexpected problems with a hook program, the
|
| 39 |
|
|
# culprit may be unusual (or missing) environment variables.
|
| 40 |
|
|
#
|
| 41 |
|
|
# Here is an example hook script, for a Unix /bin/sh interpreter.
|
| 42 |
|
|
# For more examples and pre-written hooks, see those in
|
| 43 |
|
|
# the Subversion repository at
|
| 44 |
|
|
# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and
|
| 45 |
|
|
# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/
|
| 46 |
|
|
|
| 47 |
|
|
|
| 48 |
|
|
REPOS="$1"
|
| 49 |
|
|
REV="$2"
|
| 50 |
|
|
TXN_NAME="$3"
|
| 51 |
|
|
|
| 52 |
|
|
mailer.py commit "$REPOS" "$REV" /path/to/mailer.conf
|