TortoiseSVN修改日志的设置

原文:http://ayria.livejournal.com/33438.html

If you ever need to allow edits to commit logs, all you need to do is create a pre-revprop-change hook.

Just save this as "pre-revprop-change.bat" and throw it in the \hooks directory(仓库里会有一个\hooks文件夹).

@ECHO OFF
:: Set all parameters. Even though most are not used, in case you want to add
:: changes that allow, for example, editing of the author or addition of log messages.
set repository=%1
set revision=%2
set userName=%3
set propertyName=%4
set action=%5

:: Only allow the log message to be changed, but not author, etc.
if /I not "%propertyName%" == "svn:log" goto ERROR_PROPNAME

:: Only allow modification of a log message, not addition or deletion.
if /I not "%action%" == "M" goto ERROR_ACTION

:: Make sure that the new svn:log message is not empty.
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 messages are not allowed. >&2
goto ERROR_EXIT

:ERROR_PROPNAME
echo Only changes to svn:log messages 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

 

版本库钩子:pre-revprop-change 修订版本属性修改的通知
描述:

pre-revprop-change钩子在修订版本属性修改之前,正常提交范围之外被执行,不象其他钩子,这个钩子默认是拒绝所有的属性修改,钩子必须实际存在并且返回一个零值,这样属性修改才能实现。
如果pre-revprop-change钩子没有实现或返回一个非零值,对属性的修改就不会成功,所以的标准错误输出会返回到客户端。
输入参数:

传递给你钩子程序的命令行参数,按照顺序是:

  1. 版本库路径
  2. 要修改属性的修订版本
  3. 企图修改属性的认证用户名
  4. 属性名称已修改
  5. 变更描述:A (添加的),D (删除的)或M (修改的)

此外,Subversion通过标准输入将属性值传递给钩子程序。

 

你可能感兴趣的:(html,SVN,F#,subversion)