I want to prevent users of my SVN repository checking in changes to certain files. I have done this by using the following pre-commit hook script. However the number of restricted files is growing, and its becoming very slow to commit changes. I was wondering if there was a more efficient way of coding it, I've played with changelists but I can't make that work.
Thanks in advance
pre-commit hook script (windows based SVN repository):
setlocal
:: Inputs from Subversion
set REPOS=%1%
set TXN=%2%
:: Checks if one of the reference files
Rem Check if the commit contains reference files
svnlook changed %REPOS% -t %TXN% | findstr /r /i "^.*referenceparts/part1.txt" > nul
if %errorlevel%==0 (goto RefPart)
svnlook changed %REPOS% -t %TXN% | findstr /r /i "^.*referenceparts/part2.txt" > nul
if %errorlevel%==0 (goto RefPart)
......
.....
etc etc
exit 0
:: Blocks the commit if part are reference
: RefPart
echo. 1>&2
echo ---------------------------------------------------------------------- 1>&2
echo Your commit has been cancelled because you are trying to change a 1>&2
echo part for a reference turbine! Please make a copy of this part and 1>&2
echo save it under a different name. 1>&2
echo ---------------------------------------------------------------------- 1>&2
echo. 1>&2
exit 1
svnlook changed %REPOS% -t %TXN%
might help (I have no idea if that or the findstr are the bottleneck). – crashmstr