source: trunk/locker/sbin/commit-zephyr @ 1400

Last change on this file since 1400 was 1400, checked in by andersk, 14 years ago
Update commit-email.pl and commit-zephyr from upstream.
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 1.3 KB
Line 
1#!/bin/bash
2#
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.
5#
6# Use by putting something like the following in hooks/post-commit:
7# REPOS="$1"
8# REV="$2"
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
11
12export LC_ALL=en_US.UTF-8
13
14CLASS=test
15INSTANCE=@
16FULL=0
17
18OPTS=$(getopt -o c:i:f -l class:,instance:,full -n "$0" -- "$@") || exit $?
19eval set -- "$OPTS"
20while :; do
21    case "$1" in
22        -c|--class) CLASS=$2; shift 2;;
23        -i|--instance) INSTANCE=$2; shift 2;;
24        -f|--full) FULL=1; shift;;
25        --) shift; break;;
26        *) exit 1;;
27    esac
28done
29[ $# -ge 2 ] || exit 1
30REPOS=$1
31REV=$2
32
33if [ "$INSTANCE" = "${INSTANCE%@}@" ]; then
34    INSTANCE=${INSTANCE%@}r$REV
35fi
36
37dirs=$(svnlook dirs-changed "$REPOS" -r "$REV")
38svnlook info "$REPOS" -r "$REV" | (
39    read -r author
40    read -r datestamp
41    read -r logsize
42    log=$(cat)
43    echo "r$REV by $author $datestamp"
44    echo "$log"
45    svnlook changed "$REPOS" -r "$REV"
46    if [ "$FULL" -eq 1 ]; then
47        echo
48        svnlook diff "$REPOS" -r "$REV"
49    else
50        echo svnlook diff "$REPOS" -r "$REV"
51    fi
52) | zwrite -d -c "$CLASS" -i "$INSTANCE" -O "auto" -s "SVN: r$REV"
Note: See TracBrowser for help on using the repository browser.