svn pre-commit.tmpl

分类:技术文档 - SVN | 阅读(1245) | 发布于:2016-04-26 16:07

#!/bin/sh

REPOS="$1"
TXN="$2"

SVNLOOK="svnlook"

LOGMSG=`$SVNLOOK log "$REPOS" -t "$TXN" | wc -c`
if [ "$LOGMSG" -lt 10 ];
then
echo -e "请至少输入10个字符的注释" 1>&2 
exit 1
fi
exit

# Make sure that the log message contains some text.
SVNLOOK=/usr/bin/svnlook
$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" > /dev/null || exit 1

# Check that the author of this commit has the rights to perform
# the commit on the files and directories being modified.
commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1

# All checks passed, so allow the commit.
exit 0

标签:pre-commitsvn