Gooday Note Scrap Source Android login
 
작성일 : 12-08-14 14:09
SVN 로그 수정
 글쓴이 : 기리 (123.♡.195.24)
조회 : 2,574  
   pre-revprop-change.bat (1.0K) [0] DATE : 2012-08-14 14:09:47
   http://blog.naver.com/intencelove?Redirect=Log&logNo=20140765642 [661]
[SVN] Pre-revprop-change훅(hook)을 생성해달라고 관리자에게 문의하십시오

가령 서버에 현재 수정된 파일을 커밋한 후 코멘트를 수정하려고 했는데 다음과 같은 에러가 발생한다면…

다음과 같은 방법으로 수정합니다.

현재 프로젝트의 Repository로 이동합니다. (참고로 필자는 test 폴더를 Repository로 사용하고 있습니다.)

Repository로 이동하면 아래 그림과 같은 설정 파일들이 보일 것입니다.

hooks라고 보이는 폴더를 클릭해서 들어갑니다.

다시 이 폴더로 들어가게 되면 아래 그림에서 1을 제외한 파일들이 보입니다.

이제 코멘트를 수정하거나 입력하기 위해서는 1의 파일을 생성해주어야 합니다. 이름은 pre-revprop-change.bat 파일로 되어야 합니다. (텍스트 파일을 만들어 확장자를 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

위의 파일을 생성하셨다면 이제 다시 코멘트를 수정하거나 추가해 보세요

P.S: 위의 방법으로 만들어진 bat 파일을 첨부하였습니다. 첨부파일을 repository/hooks/ 경로에 넣어 주시면 됩니다. (혹시나 파일명이 틀렸을 수도 있습니다... 안되실 경우 파일명을 다시 확인해주세요)