This seems to be very basic question but I am knocked out. How to test those scripts which one has written for hooking purpose.
As we know that script is running in background and only error is throwing back on us by SVN console. I tried with breakpoint but there is nothing I can provide input to the script.
Does anyone got any idea about it. I am writing svn hook script on windows so many already written hook scripts either not running or not giving desired output for example check mime-type and eol script from apache.
I can give you some advice:
STDERR. That’s the only way your script will report errors to you. You can use this for actual testing.-tor an-rcommand line parameter. When executing as a pre-commit hook, I can use the-tparameter to pass in the transaction number. When running it from the command line, I can use the-rparameter and give it a revision number to run against.debugfunction that allowed me to print out information when I set a-debugcommand line parameter. I could turn this on and off.pre-commitshell script will fail by ending it with an exit code of2. You’ll never commit your transaction, but you’ll get messages in your pre-commit script what is going on (that is, if you print everything to STDERR).You can look at the hook scripts I’m developing to get some ideas. I use the
Data::DumperPerl module which can help print out data structures in my script.