Subversion: Edit log message

@ECHO OFF
:: Set up the list of possible parameters.
set repository=%1
set revision=%2
set userName=%3
set propertyName=%4
set action=%5

:: Allow the log message itself to be changed.
if /I not "%propertyName%" == "svn:log" goto ERROR_PROPNAME

:: Allow modification of a log message, not addition or deletion.
if /I not "%action%" == "M" goto ERROR_ACTION

:: Make sure that the changed svn:log message is not null.
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

References:

Windows and SVN hooks
SVN pre-revprop-change hook scripts for Linux and Windows
pre-revprop-change hook using batch files on Windows
How do I change the log message for a revision after it’s been committed?
what is a pre-revprop-change hook in SVN and how do I create it?
Edit a subversion log message
How do I edit a log message that I already committed in Subversion?

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s

A %d blogueros les gusta esto: