Edit a SVN logmessage on windows

Lees voor met webReader

 

Editting logmessages of the Subversion repository on windows is not possible by default. But you can do it by adding a little batch file.

You need to add the following batch file to the \hooks folder of your SVN Repository…

I slightly had to change the file that I found on http://svn.haxx.se/users/archive-2006-03/0107.shtml

 DOS |  copy code |? 
01
02
 
03
rem @ECHO OFF
04
 
05
 
06
set repos=%1
07
set rev=%2
08
set user=%3
09
set propname=%4
10
set action=%5
11
 
12
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
13
:: Only allow changes to svn:log. The author, date and other revision
14
:: properties cannot be changed
15
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
16
if /I not %propname%==svn:log goto ERROR_PROPNAME
17
 
18
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
19
:: Only allow modifications to svn:log (no addition/overwrite or deletion)
20
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
21
if /I not %action%==M goto ERROR_ACTION
22
 
23
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
24
:: Make sure that the new svn:log message contains some text.
25
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
26
set bIsEmpty=true
27
for /f "tokens=*" %%g in ('find /V ""';) do (
28
set bIsEmpty=false
29
)
30
if %bIsEmpty%==true goto ERROR_EMPTY
31
 
32
goto :eof
33
 
34
 
35
 
36
:ERROR_EMPTY
37
echo Empty svn:log properties are not allowed. >&2
38
goto ERROR_EXIT
39
 
40
:ERROR_PROPNAME
41
echo Only changes to svn:log revision properties are allowed. >&2
42
goto ERROR_EXIT
43
 
44
:ERROR_ACTION
45
echo Only modifications to svn:log revision properties are allowed. >&2
46
goto ERROR_EXIT
47
 
48
:ERROR_EXIT
49
exit /b 1 
50