본문 바로가기
Management/SVN

[SVN] commit에 대한 comment log 수정하기 (pre-revprop-change hook 오류 해결)

by 썸머워즈 2019. 7. 26.
반응형

공동 작업을 할때 commit을 하게되면 comment를 작성할 수 있게되는데

가끔 나도모르게 바로 commit을 할 경우가 생긴다

 

하지만 SVN 커밋을 하고나서 comment log 를 수정하고자 하면 다음과 같은 에러가 발생한다.

 

에러와 SVN comment log 수정방법을 정리해보자

 

pre-revprop-change hook either failed or is non-existent

에러가 발생하는데 정확한 에러는 다음과 같다.


SVN: 'Set revision property' operation finished with error: svn: E175002: DAV request failed; it's possible that the repository's pre-revprop-change hook either failed or is non-existent
svn: E175002: Error setting property log:
Repository has not been enabled to accept revision propchanges;
ask the administrator to create a pre-revprop-change hook
svn: E175002: DAV request failed; it's possible that the repository's pre-revprop-change hook either failed or is non-existent
svn: E175002: Error setting property log:
Repository has not been enabled to accept revision propchanges;
ask the administrator to create a pre-revprop-change hook


기본적으로 설정되어있는게 commit을 완료한 것에 대한 comment log를 수정할 수 없게 해놓았다.

그래서 별도로 설정을 해주어야하는데 보통 관리자한테 요청을 하기 마련이다.

 

SVN같은경우 Repository 가 따로 존재하는데

 

해당 경로를 찾아가야한다.

 

나같은경우는 D드라이브에 위치하였다.

 

Repository 위치가 D:\Repository\test인 경우

hook 처리는 D:\Repository\test\hooks 디렉터리 아래의 파일들이 처리하도록 되어 있습니다. 

pre-revprop-change.tmpl 을 복사 붙여넣기해서

복사본을 메모장으로 열어서 다음과 같은 명령어를 넣어준다.

(기존 내용을 전부 지우고 아래 내용으로 채워주면 된다.)


rem Only allow log messages to be changed.

if "%4" == "svn:log" exit 0

echo Property '%4' cannot be changed >&2

exit 1


그리고 해당 복사본의 파일 확장자를

pre-revprop-change.bat

배치파일로 바꿔 저장하고나서

 

해당 폴더에 그대로 둔뒤

 

다시 commit한 대상의 comment log를 수정해보면 수정이 잘 되는것을 확인할 수 있다.

(수정된 log는 바뀌기 전으로 못돌리니 잘못 바꿨다가는 원상복구 못시키니 따로 백업을 해두자)

 

여기서 이제 혹시나 다른사람들이 실수할까봐 혹은 자기만 수정하고 다시 수정 못하게 막아두려면

 

간단하다

 

해당 bat파일을 다시 삭제해주면 된다.

 

그러면 다시 원래대로 수정이 불가한 에러가 발생하는것을 볼 수 있다.

(수정할때만 bat파일을 넣어서 하면 된다.)

 

반응형


댓글

TOP