在Windows环境
在SVN的Repositories路径,E:Repositoriesdemo20170408hooks;
创建pre-commit.bat批处理文件。
文件内容:
1 @echo off 2 set SVNLOOK="D:Program FilesVisualSVN Serverinsvnlook.exe" 3 setlocal 4 set REPOS=%1 5 set TXN=%2 6 rem check that logmessage contains at least 10 characters 7 %SVNLOOK% log "%REPOS%" -t "%TXN%" | findstr ".........." > nul 8 if %errorlevel% gtr 0 goto err 9 exit 0 10 :err 11 echo 请输入不少于5个字的备注! 1>&2 12 exit 1