[轉貼][TortoiseSVN] TortoiseSVN 修改Log紀錄

當我們在用TortoiseSVN 的時,都會習慣紀錄一下每個版次的變化…

但是有的時候就是手殘…不小心打錯就送出了!!!結果造成訊息閱讀上的困擾!!

當我們嘗試要修改時,就會出現【檔案庫並未設定成可以接受修訂版性質更動;請要求管理員建立pre-revprop-change掛勾】

先找到你的SVN所存放的檔案位置…..
找到檔案下的hook資料夾。
在資料夾中找到pre-revprop-change.tmpl 複製一份。
將複製的pre-revprop-change的副檔名改為.bat。
編輯pre-revprop-change.bat的內容,替換如下:

@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

tortoisesvn change log message

內容出處: 炎龍牙

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *