Example script for the PRE-REVPROP-CHANGE HOOK
Subversion
Subversion invokes the pre-revprop-change hook before a revision property is modified.
Here is an example hook script, for a Unix /bin/sh interpreter:
#!/bin/sh
REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
if [ "$PROPNAME" = "svn:log" ]; then
AUTHOR="$(svnlook author $REPOS -r $REV)"
if [ "$USER" != "$AUTHOR" ]; then
# output on STDERR will be displayed by TortoiseSVN if the hook failes
echo "This log message can only be changed by '$AUTHOR'!" 1>&2
exit 1
fi
exit 0
fi
# non-zero = failure
exit 1