Last change
on this file since 2345 was
1400,
checked in by andersk, 15 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
|
Rev | Line | |
---|
[1400] | 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 |
---|
[375] | 11 | |
---|
[1400] | 12 | export LC_ALL=en_US.UTF-8 |
---|
| 13 | |
---|
| 14 | CLASS=test |
---|
[748] | 15 | INSTANCE=@ |
---|
[375] | 16 | FULL=0 |
---|
| 17 | |
---|
| 18 | OPTS=$(getopt -o c:i:f -l class:,instance:,full -n "$0" -- "$@") || exit $? |
---|
| 19 | eval set -- "$OPTS" |
---|
| 20 | while :; 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 |
---|
| 28 | done |
---|
| 29 | [ $# -ge 2 ] || exit 1 |
---|
| 30 | REPOS=$1 |
---|
| 31 | REV=$2 |
---|
| 32 | |
---|
[748] | 33 | if [ "$INSTANCE" = "${INSTANCE%@}@" ]; then |
---|
| 34 | INSTANCE=${INSTANCE%@}r$REV |
---|
| 35 | fi |
---|
| 36 | |
---|
[375] | 37 | dirs=$(svnlook dirs-changed "$REPOS" -r "$REV") |
---|
| 38 | svnlook 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" |
---|
[376] | 45 | svnlook changed "$REPOS" -r "$REV" |
---|
[375] | 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 |
---|
[1400] | 52 | ) | zwrite -d -c "$CLASS" -i "$INSTANCE" -O "auto" -s "SVN: r$REV" |
---|
Note: See
TracBrowser
for help on using the repository browser.