[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Usefull hooks scripts for Windows

From: Michel Peterson <cooldown_at_gmail.com>
Date: 2005-06-13 06:51:26 CEST

I've made this hooks for Windows and because I haven't seen around a
pre-revprop-change that checks if the svn:log actually contains text on it I
decided to submit mine that does...

pre-revprop-change.bat

set REPOS=%1
set REV=%2
set USER=%3
set PROPNAME=%4
set ACTION=%5

rem Only allow log messages to be changed.
if "%PROPNAME%" NEQ "svn:log" goto ERR_CHANGE
more|findstr [a-zA-Z0-9] >NUL || goto ERR_EMPTY
exit 0

:ERR_EMPTY
echo Property '%PROPNAME%' cannot be empty. >&2
exit 1

:ERR_CHANGE
echo Property '%PROPNAME%' cannot be changed. >&2
exit 1

pre-commit.bat

set REPOS=%1
set TXN=%2

rem Make sure that the log message contains some text.
SVNLOOK log -t "%TXN%" "%REPOS%" | findstr [a-zA-Z0-9] >NUL || exit 1

rem All checks passed, so allow the commit.
exit 0

-- 
Michel Peterson aka C00I90WN
MSN: cooldown@fibertel.com.ar
M@IL: cooldown@gmail.com
Received on Mon Jun 13 06:53:31 2005

This is an archived mail posted to the Subversion Users mailing list.