D:/SvnRepositories/projects/hooks

 

在仓库的hooks目录下面建立一个pre-commit.bat:

 

@echo off
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
svnlook log "%REPOS%" -t "%TXN%" | findstr ".........." > nul
endlocal
if %errorlevel% gtr 0 goto err
exit 0
:err
echo please input log message ,at least 10 characters. Commit aborted! 1>&2
exit 1

这样,这个仓库下的文件提交时,就需要强制输入注释了。

从这里,也看到findstr这个dos命令还这么强大。

实际上findstr后面的引号里面是一个模式串,10个点代表十个字符串。

find /s代表在当前目录递归查找某个字符串

find /s hello *.txt