SVN 设置
环境Windows
1. 禁止SVN提交空日志
在SVN工作目录hooks文件夹中新建文件pre-commit.bat,并将如下代码粘贴到文件中保存即可
1 @echo off 2 set SVN_BINDIR="C:\Program Files\VisualSVN Server\bin" 3 setlocal 4 set REPOS=%1 5 set TXN=%2 6 rem check that logmessage contains at least 5 characters 7 %SVN_BINDIR%\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
2. 编辑日志信息
在SVN工作目录hooks文件夹中新建文件pre-revprop-change.bat,并将如下代码粘贴到文件中保存即可
1 if "%4" == "svn:log" exit 0 2 echo Property '%4' cannot be changed >&2 3 exit 1