TortoiseSVN client pre commit hook to check the contents of file being committed

Darshan Mehta picture Darshan Mehta · Sep 27, 2013 · Viewed 13.2k times · Source

I want to write a pre commit hook in windows batch file which will check for specific string in the file being committed. If the string exists, the commit will fail. I have TortoiseSVN client installed. As it's tortoisesvn client, it does not have commands like 'svnlook' to fetch the list of files etc. I want that script to be executed for each and every file being committed/added.

I am newbie to these hooks. Can anyone please guide me with this?

Answer

CrazyMORF picture CrazyMORF · Sep 27, 2013

May be this page will be helpful

  1. Client Side Hook Scripts
  2. TortoiseSVN pre-commit hook in C# - Save yourself some troubles!

Seems like you can use FIND batch command, because it produces errorcode when string in file is not found.