1. 强制添加注释信息
找到Respositories目录下对应项目里的hooks目录下建立pre-commit.bat文件,复制如下内容:

 

@echo off
exit 1

 

 

 

2. 允许用户修改注释信息

找到Respositories目录下对应项目里的hooks目录下建立pre-revpos-change.bat,复制如下内容:

@ECHO OFF
set repos=%1
set rev=%2
set user=%3
set propname=%4
set action=%5
 
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Only allow changes to svn:log. The author, date and other revision
:: properties cannot be changed
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
if /I not '%propname%'=='svn:log' goto ERROR_PROPNAME
 
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Only allow modifications to svn:log (no addition/overwrite or deletion)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
if /I not '%action%'=='M' goto ERROR_ACTION
 
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Make sure that the new svn:log message contains some text.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set bIsEmpty=true
for /f "tokens=*" %%g in ('find /V ""') do (
 set bIsEmpty=false
)
if '%bIsEmpty%'=='true' goto ERROR_EMPTY
 
goto :eof
 
 
 
:ERROR_EMPTY
echo Empty svn:log properties are not allowed. >&2
goto ERROR_EXIT
 
:ERROR_PROPNAME
echo Only changes to svn:log revision properties are allowed. >&2
goto ERROR_EXIT
 
:ERROR_ACTION
echo Only modifications to svn:log revision properties are allowed. >&2
goto ERROR_EXIT
 
:ERROR_EXIT
exit /b 1
 

 

相关文章:

  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
  • 2022-03-07
  • 2021-10-08
猜你喜欢
  • 2022-01-02
  • 2022-12-23
  • 2021-08-05
  • 2021-05-02
  • 2021-11-26
  • 2022-12-23
  • 2021-08-19
相关资源
相似解决方案