svn 服务器设置,提交时强制注释(Windows版)

svn服务器是安装在windows中

在SVN的Repositories路径中: Repositories\RedAndGreen\hooks     创建pre-commit.bat批处理文件,内容如下:

@echo off
rem SVN强制写注释的hooks脚本(Windows)
rem 文件名是: pre-commit.bat,放到repository/hooks目录下
setlocal
set SVN_BINDIR="C:\Program Files\VisualSVN Server\bin"
set REPOS=%1
set TXN=%2

rem check that logmessage contains at least 10 characters
rem .....代表5个字符
%SVN_BINDIR%\svnlook log "%REPOS%" -t "%TXN%" | findstr ".........." > nul

if %errorlevel% gtr 0 goto err
exit 0

:err
echo [Commit failed]: Empty log message not allowed. 1>&2
exit 1

注意,该脚本是假定svn安装路径为C:\Program Files\中
展开阅读全文

没有更多推荐了,返回首页