source: revtreeplugin/0.11/hooks/svnstubs/post-revprop-change

Last change on this file was 3581, checked in by Emmanuel Blot, 15 years ago

Update hook scripts for the RevtreePlugin/LogEnhancer

  • Property svn:eol-style set to native
File size: 1.0 KB
RevLine 
[2638]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
14REPOS="$1"
15REV="$2"
16USER="$3"
17PROPNAME="$4"
18ACTION="$5"
19
[3581]20SELF=`readlink -f $0`
21CONF=`dirname ${SELF}`/hook.conf
22if [ -f ${CONF} ]; then
23    . ${CONF}
[2638]24else
[3581]25    echo "Missing hook configuration file" >&2
26    exit -1
[2638]27fi
28
[3581]29export PYTHONPATH=$TRACPATH:$GENSHIPATH
30export PYTHON_EGG_CACHE
31export PYTHON=`which python2.5`
[2638]32date >> "$LOGFILE"
33echo "Revprop: $REV $PROPNAME" >> $LOGFILE
[3581]34${PYTHON} ${HOOKPATH}/trac-revprop-hook -p "$TRAC_ENV" -u "$USER" \
[2638]35    -n "$PROPNAME" -d "$REPOS" -r "$REV" -a "$ACTION" post 2>> "$LOGFILE"
36if [ $? -ne 0 ]; then
37    tail -5 "$LOGFILE" | \
38      mail admin -s "[${REPOSNAME}] Unable to post-revprop revision ${REV}"
39fi
40
Note: See TracBrowser for help on using the repository browser.