在项目库的hooks目录下,添加一个pre-commit.bat文件
内容如下(注意其中的SVN_BINDIR路径,可能需要改一下)
用SVN几个问题的解决 [url]http://lanhy2000.blog.163.com/blog/static/436786082011766252052/[/url]
内容如下(注意其中的SVN_BINDIR路径,可能需要改一下)
@echo off
rem SVN强制写注释的hooks脚本(Windows)
rem 文件名是: pre-commit.bat,放到repository/hooks目录下
setlocal
set SVN_BINDIR="C:\Program Files\CollabNet\Subversion Server"
set REPOS=%1
set TXN=%2
rem check that logmessage contains at least 10 characters
%SVN_BINDIR%\svnlook log "%REPOS%" -t "%TXN%" | findstr "......" > nul
if %errorlevel% gtr 0 goto err
exit 0
:err
echo 提交时必须填写注释(Message)! 1>&2
echo "%REPOS%" -t "%TXN%" 1>&2
exit 1用SVN几个问题的解决 [url]http://lanhy2000.blog.163.com/blog/static/436786082011766252052/[/url]

本文介绍了一个用于Subversion (SVN) 的预提交检查批处理脚本,该脚本确保每次提交时都有至少十个字符的提交说明。通过设置特定的钩子(hooks),可以在提交之前强制执行这一规定。
1万+

被折叠的 条评论
为什么被折叠?



