我在我的SVN(Visual SVN服务器和Tortoise客户端)上使用预提交挂钩。它工作得很好。现在我们想通过企业架构师(我们提供svn.exe地址)提交。现在预提交挂钩阻止了提交。 下面是提交挂钩
REM Pre Commit hook for having a comment of at least 20 characters.
setlocal enabledelayedexpansion
set REPOS=%1
set TXN=%2
set SVNLOOK="%VISUALSVN_SERVER%\bin\svnlook.exe"
SET M=
REM Concatenate all the lines in the commit message
FOR /F "usebackq delims==" %%g IN (`%SVNLOOK% log -t %TXN% %REPOS%`) DO SET M=!M!%%g
REM Make sure M is defined
SET M=0%M%
REM Here the 20 is the length we require
IF NOT "%M:~20,1%"=="" goto NORMAL_EXIT
:ERROR_TOO_SHORT
echo "Commit note must be at least 20 letters" >&2
goto ERROR_EXIT
:ERROR_EXIT
exit /b 1
REM All checks passed, so allow the commit.
:NORMAL_EXIT
exit 0
请为此建议您的解决方案。
我得到的错误代码是E165001
答案 0 :(得分:1)
Enterprise Architect,在提交文件夹时添加了自己的评论。 "添加文件夹"。它只会在下一次提交添加内容。这就是上面挂钩失败的原因,因为它不是20个字符。