i see that all I can set to is %repos% and %txn%
how can I use those to get to the commit message (in my case, so i can parse out the ticket number so i can see if it exists in the bug database before committing to it)
i see that all I can set to is %repos% and %txn%
how can I use those to get to the commit message (in my case, so i can parse out the ticket number so i can see if it exists in the bug database before committing to it)
I've just gone through the process of building a hooks app myself and SharpSVN isn't required for looking at commit messages. Assuming you've built yourself a console app already, try this code which calls svnlook.exe directly:
Make sure the location of svnlook.exe is added to the path environment variable of your machine so the above can be executed from any location.
I do not know SharpSVN, however if you create a hook script as you describe, you get as arguments %repos% and %txn%
With these data you can look into the transaction (%txn%) of the given repository. Usually you do this by using
Then you will get the log-message.
So you should look for an equivalent to svnlook in sharpSVN interface.
Some time ago I've written a C# wrapper for the svnlook.exe. I used this one to send commit messages to a bug tracker (if a ticket id was provided). Find it below, maybe it is useful for you.
Using a recent SharpSvn release you can use
to parse the arguments of a pre-commit hook and then use
to get to the log message, changed files, etc.