3 # This is a script that can be called from a Subversion post-commit hook
4 # to zephyr a summary of the commit or the full commit.
6 # Use by putting something like the following in hooks/post-commit:
9 # /mit/snippets/svn-hooks/commit-zephyr "$REPOS" "$REV" -c scripts
10 # /mit/snippets/svn-hooks/commit-zephyr "$REPOS" "$REV" --full -c scripts-auto -i commits
12 export LC_ALL=en_US.UTF-8
18 OPTS=$(getopt -o c:i:f -l class:,instance:,full -n "$0" -- "$@") || exit $?
22 -c|--class) CLASS=$2; shift 2;;
23 -i|--instance) INSTANCE=$2; shift 2;;
24 -f|--full) FULL=1; shift;;
29 [ $# -ge 2 ] || exit 1
33 if [ "$INSTANCE" = "${INSTANCE%@}@" ]; then
34 INSTANCE=${INSTANCE%@}r$REV
37 dirs=$(svnlook dirs-changed "$REPOS" -r "$REV")
38 svnlook info "$REPOS" -r "$REV" | (
43 echo "r$REV by $author $datestamp"
45 svnlook changed "$REPOS" -r "$REV"
46 if [ "$FULL" -eq 1 ]; then
48 svnlook diff "$REPOS" -r "$REV"
50 echo svnlook diff "$REPOS" -r "$REV"
52 ) | zwrite -d -c "$CLASS" -i "$INSTANCE" -O "auto" -s "SVN: r$REV"