| Line | |
|---|
| 1 | #!/bin/sh |
|---|
| 2 | |
|---|
| 3 | # POST-REVPROP-CHANGE HOOK |
|---|
| 4 | # |
|---|
| 5 | # [1] REPOS-PATH (the path to this repository) |
|---|
| 6 | # [2] REV (the revision that was tweaked) |
|---|
| 7 | # [3] USER (the username of the person tweaking the property) |
|---|
| 8 | # [4] PROPNAME (the property that was changed) |
|---|
| 9 | # [5] ACTION (the property was 'A'dded, 'M'odified, or 'D'eleted) |
|---|
| 10 | # |
|---|
| 11 | # [STDIN] PROPVAL ** the old property value is passed via STDIN. |
|---|
| 12 | # |
|---|
| 13 | |
|---|
| 14 | REPOS="$1" |
|---|
| 15 | REV="$2" |
|---|
| 16 | USER="$3" |
|---|
| 17 | PROPNAME="$4" |
|---|
| 18 | ACTION="$5" |
|---|
| 19 | |
|---|
| 20 | SELF=`readlink -f $0` |
|---|
| 21 | CONF=`dirname ${SELF}`/hook.conf |
|---|
| 22 | if [ -f ${CONF} ]; then |
|---|
| 23 | . ${CONF} |
|---|
| 24 | else |
|---|
| 25 | echo "Missing hook configuration file" >&2 |
|---|
| 26 | exit -1 |
|---|
| 27 | fi |
|---|
| 28 | |
|---|
| 29 | export PYTHONPATH=$TRACPATH:$GENSHIPATH |
|---|
| 30 | export PYTHON_EGG_CACHE |
|---|
| 31 | export PYTHON=`which python2.5` |
|---|
| 32 | date >> "$LOGFILE" |
|---|
| 33 | echo "Revprop: $REV $PROPNAME" >> $LOGFILE |
|---|
| 34 | ${PYTHON} ${HOOKPATH}/trac-revprop-hook -p "$TRAC_ENV" -u "$USER" \ |
|---|
| 35 | -n "$PROPNAME" -d "$REPOS" -r "$REV" -a "$ACTION" post 2>> "$LOGFILE" |
|---|
| 36 | if [ $? -ne 0 ]; then |
|---|
| 37 | tail -5 "$LOGFILE" | \ |
|---|
| 38 | mail admin -s "[${REPOSNAME}] Unable to post-revprop revision ${REV}" |
|---|
| 39 | fi |
|---|
| 40 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.