svn 钩子开启
- - 运维技术的个人空间背景: 公司的Svn很多人在用,有不少人在作修改后不添加注释,所以需要强制用户填写注释. 重命名svn主目录中hooks的pre-commit.tmpl文件为pre-commit,并添加可执行权限. echo "【注释】$content" 1>&2. echo "【注意】注释不能为空,请重新填写注释!!!" 1>&2.
@echo off setlocal set REPOS=%1 set TXN=%2 rem check that logmessage contains at least 5 characters svnlook log "%REPOS%" -t "%TXN%" | findstr ".........." > nul if %errorlevel% gtr 0 goto err exit 0 :err echo that logmessage contains at least 10 alphanumeric characters. Commit aborted! 1>&2 exit 1
REM SVN pre-revprop-change hook allows edit of logmessages from TSVN setlocal set REPOS=%1 set REV=%2 set USER=%3 set PROPNAME=%4 set ACTION=%5 if not "%ACTION%"=="M" goto refuse if not "%PROPNAME%"=="svn:log" goto refuse goto OK :refuse echo Cann't set %PROPNAME%/%ACTION%, only svn:log is allowed 1>&2 endlocal exit 1 :OK endlocal exit 0