views:

60

answers:

2

Hi , I need to know how to use pre commit hook of svn.
I need SVN revision number to be used in php files.

Please guide how does pre-commit hook work.

A: 

If you're using TortoiseSVN, you can create a post commit client-side hook which can call the tool SubWCRev.exe provided with TortoiseSVN.

This tool can replace a special token in files.

I use that in my .net projects as post compilation event to put the last revision in the AssemblyInfo of the application, adding it to the app version number.

Julien N
Although, if you need to put the revision in all your files it may not be the solution, but maybe it can give you ideas.If you only need to put that information in one (or some) file(s), this solution is for you !
Julien N
+1  A: 

I am not sure I understood correctly but I think you're asking about Keyword Substitution: http://svnbook.red-bean.com/en/1.4/svn.advanced.props.special.keywords.html

Omar