这个操作需要修改版本库中的一个钩子文件,在你创建的版本库中有一个hooks文件夹,初始的时候其中有一个文件叫pre-commit.tmpl
在windows下将其修改为pre-commit.bat,在linux下将其改为pre-commit
linux下(文件名是: pre-commit,放到版本库的/hooks目录下)
==========================================================#!/bin/shREPOS="$1"TXN="$2"SVNLOOK=/usr/bin/svnlook# check that logmessage contains at least 10 alphanumeric charactersLOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" | wc -c`if [ "$LOGMSG" -lt 10 ];thenecho -e "/nEmpty log message not allowed. Commit aborted!" 1>&2exit 1fiwindows下(保存到版本库下的hooks文件夹下/hooks/pri-commit.bat)=================================================================@echo offsetlocalset REPOS=%1set TXN=%2rem check that logmessage contains at least 10 characterssvnlook log "%REPOS%" -t "%TXN%" | findstr "....." > nulif %errorlevel% gtr 0 goto errexit 0:errecho 你必须输入至少5个字符! 1>&2exit 1