|

|
1#
发表于 09-4-15 14:40
| 只看该作者
[求助] Windows下修改注释的hooks文件对中文库名无效
操作系统:windows 2003
SVN和Tsvn都是1.4.6
apache 2.0.59
现在要实现修改历史注释的功能,将pre-revprop-change.bat放入版本库中hooks目录下,内容如下:
@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 1
经试验后发现只有在库名为英文且没有空格或数字的情况下可以成功修改注释,如果库名中含有中文,或者有数字或空格,就会报错:
DAV request failed; it's possible that the repository's pre-revprop-change hook either failed or is non-existent. At least one property change failed; repository is unchanged
但是我现在需要在中文名字的库和有空格及英文的库中修改注释的,怎么解决? |
|