TortoiseSVN에서 잘못된 메시지로 커밋을 했을 때, Log에서 마우스 오른쪽 버튼을 누르면 로그 메시지 편집 기능이 있다.

하지만, 해당 메뉴를 클릭하면 관리자에게 문의하라는 에러가 뜬다.

While handling the 'svn:log' property on '/svn/MyProject/!svn/bln/999':
Repository has not been enabled to accept revision propchanges;
ask the administrator to create a pre-revprop-change hook

 

단발성 수정 방법

다음의 콘솔 명령어를 이용하면 해당 로그의 메시지만 수정할 수 있다.

svn propedit -r {리비전번호} --revprop svn:log {SVN 저장소 URL}

다만, 이 명령어는 관리자 권한이 있는 유저만 사용할 수 있다.

 

항상 허용하는 방법

관리자가 한번 설정하면 이후 모든 유저가 로그 메시지를 편집할 수 있게 허용하는 방법이다.

 

VisualSVN 서버 관리 툴을 연다. 저장소를 선택하고, 마우스 오른쪽 버튼을 눌러 속성창을 연다.

Hooks 탭에서 Pre-revision property change hook을 선택하고 하단의 Edit 버튼을 누른다.

창이 열리면 다음의 내용을 붙여 넣고 저장한다.

@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

Hook 스크립트를 입력하고, OK를 눌러 속성창을 닫으면 된다.

 

참고#1: https://stackoverflow.com/questions/304383/how-to-edit-log-message-already-committed-in-subversion

 

How to edit log message already committed in Subversion?

Is there a way to edit the log message of a certain revision in Subversion? I accidentally wrote the wrong filename in my commit message which could be confusing later. I've seen How do I edit an

stackoverflow.com

참고#2: https://stackoverflow.com/questions/197224/what-is-a-pre-revprop-change-hook-in-svn-and-how-do-i-create-it

 

What is a pre-revprop-change hook in SVN, and how do I create it?

I wanted to edit a log comment in the repository browser and received an error message that no pre-revprop-change hook exists for the repository. Besides having a scary name, what is a pre-revprop-...

stackoverflow.com

 

+ Recent posts