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
16 OPTS=$(getopt -o c:i:f -l class:,instance:,full -n "$0" -- "$@") || exit $?
20 -c|--class) CLASS=$2; shift 2;;
21 -i|--instance) INSTANCE=$2; shift 2;;
22 -f|--full) FULL=1; shift;;
27 [ $# -ge 2 ] || exit 1
31 if [ "$INSTANCE" = "${INSTANCE%@}@" ]; then
32 INSTANCE=${INSTANCE%@}r$REV
35 dirs=$(svnlook dirs-changed "$REPOS" -r "$REV")
36 svnlook info "$REPOS" -r "$REV" | (
41 echo "r$REV by $author $datestamp"
43 svnlook changed "$REPOS" -r "$REV"
44 if [ "$FULL" -eq 1 ]; then
46 svnlook diff "$REPOS" -r "$REV"
48 echo svnlook diff "$REPOS" -r "$REV"
50 ) | zwrite -d -c "$CLASS" -i "$INSTANCE" -O "auto" -s "SVN: r$REV"