I am trying to set up a simple pre-commit hook script that rejects commits without a message. We use VisualSVN Server 2.5.8 and I have added a pre-commit hook that points to a .bat file.
The file is executed, but the parameters for REPOS-PATH and TXN-Name are empty. In my script I have tried logging %0 to a file, and i see that this is only returning the path to the script. So for some reason VisualSVN Server does not pass these parameters. What could be wrong?
The code for the test:
@echo off
setlocal enabledelayedexpansion
set REPOS=%1
set TXN=%2
set SVNLOOK="%VISUALSVN_SERVER%\bin\svnlook.exe"
echo "repos %REPOS%." >> C:\Repositories\Hooks\test.log
echo "txn %TXN%." >> C:\Repositories\Hooks\test.log
exit 0
After a commit, test.log contains:
"repos ."
"txn ."