Saturday, December 10, 2011

Enable SVN log edit (Windows)

Create pre-revprop-change.bat and save it in the /hooks subdirectory for your repository.

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_EXIThttp://www.blogger.com/img/blank.gif

:ERROR_ACTION
echo Only modifications to svn:log revision properties are allowed. >&2http://www.blogger.com/img/blank.gif
goto ERROR_EXIT
http://www.blogger.com/img/blank.gif
:ERROR_EXIT
exit /b 1


references:

[1] http://stackoverflow.com/questions/692851/can-i-go-back-and-edit-comments-on-an-svn-checkin
[2] http://stackoverflow.com/questions/197224/what-is-a-pre-revprop-change-hook-in-svn-and-how-do-i-create-it

No comments:

Ubuntu Forware port 80

  #!/bin/bash iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8069 iptables -t nat -A PREROUTING -i eth0 -p tc...