进入SVN项目目录下的hooks文件夹内
cd /svn-storage/platform-project/svn/test123123/hooks
修改hook
[root@FVS10-10-2-125 hooks]# mv pre-commit.tmpl pre-commit
[root@FVS10-10-2-125 hooks]# vim pre-commit
REPOS="$1"
TXN="$2"
SVNLOOK=/usr/bin/svnlook
log=`$SVNLOOK changed -t "$TXN" "$REPOS"`
echo "log --> $log"
#invalid="\.zip$|\.rar$|\/mp4"
invalid='\.(zip|rar|o|ibj|tar|gz)$'
echo $log | grep "^[AU]" | grep -E "$invalid" \
&& /bin/echo "The type is wrong and cannot be contained(zip|rar|mp4)" 1>&2 && exit 1
exit 0
修改权限
[root@FVS10-10-2-125 hooks]# chmod 755 pre-commit