#!/bin/sh
REPOS="$1"
REV="$2"
/usr/local/bin/svnnotify -r "$REV" -C -d -H Alternative \
--alt HTML::ColorDiff -p "$REPOS" -t "xxxx@xxxx.com" \
--from 'SVN @ xxxx.com <svn@xxxx.com>'
if svnnotify command is not present on your svn server then use following code in the post-commit file
#!/bin/sh
REPOS="$1"
REV="$2"
/usr/bin/svnlook diff -r "$REV" "$REPOS" | mutt -s "SVN Notify" xxxx@xxxx.com
A more detailed report can be achieved via following code
ReplyDelete#!/bin/sh
REPOS_NAME="$1"
REPOS="/path/to/svnroot/$1"
REV="$2"
AUTHOR=$(svnlook author -r $REV $REPOS)
DATE=$(svnlook date -r $REV $REPOS)
{
echo "REPOSITORY: $REPOS_NAME"
echo "REVISION: $REV"
echo "COMMITTED BY: $AUTHOR"
echo "DATE: $DATE"
echo ""
echo "DESCRIPTION:"
svnlook log -r $REV $REPOS
echo ""
echo "FILES:"
svnlook changed -r $REV $REPOS
} | mail -s "[SVN Notify] Check In Rev $REV by $AUTHOR" xxxx@xxxx.com
This script might not give your proper output, the output could be similar to
ReplyDeleteREPOSITORY: /extra/svn/armada
REVISION: 10641
COMMITTED BY:
DATE:
DESCRIPTION:
FILES:
The problem can be resolved by adding following code in the post-commit file
PATH=/usr/bin:/bin
The complete code of post-commit is as follows
#!/bin/sh
PATH=/usr/bin:/bin
REPOS="$1"
REV="$2"
AUTHOR=$(svnlook author -r $REV $REPOS)
DATE=$(svnlook date -r $REV $REPOS)
{
echo "REPOSITORY: $REPOS"
echo "REVISION: $REV"
echo "COMMITTED BY: $AUTHOR"
echo "DATE: $DATE"
echo ""
echo "DESCRIPTION:"
svnlook log -r $REV $REPOS
echo ""
echo "FILES:"
svnlook changed -r $REV $REPOS
} | mail -s "[SVN Notify] Check In Rev $REV by $AUTHOR" xxxx@xxxx.com