1.强制提交时要写日志。复制下面代码,保存为pre-commit.bat文件,复制到hooks目录下。
@echo off
set SVN_BINDIR="C:\Program Files\Subversion\bin"
setlocal
set REPOS=%1
set TXN=%2
rem check that logmessage contains at least 10 characters
%SVN_BINDIR%\svnlook log "D:\RepositorySVN\M31" "%REPOS%" -t "%TXN%" | findstr ".........." > nul
if %errorlevel% gtr 0 goto err
exit 0
:err
echo 提交日志字符小于10个!退出提交! 1>&2
exit 1
2.修改日志信息。复制下面代码,保存为pre-revprop-change.bat文件,复制到hooks目录下。
#每人可以修改自己的log日志,而管理员li可以任意修改。
for /f "usebackq" %%k in (`svnlook author %1 -r%2`) do @set var=%%k
if "%3" == "%var%" goto test
if "%3" == "li" goto test
exit 1
:test
if "%4" == "svn:log" exit 0
echo Property '%4' cannot be changed >&2
exit 1
阅读(3785) | 评论(0) | 转发(0) |