add global revision number in php source files
I want to replace a global revision no (head) in my PHP source files whenever I make a checkin (or update)
for example I have below code
<?php
print 'Rv no : $glbRevisionNumber$';
?>
in al开发者_StackOverflow中文版l the php files that have under one folder eg. myapp/* the $glbRevisionNumber$ should get replaced with the current head revision number.
How can I achieve this ?
Have a look at svn pre-commit-hooks:
http://wordaligned.org/articles/a-subversion-pre-commit-hook
Here are some example scripts:
http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/
Create a pre-commit hook in your version control system that does a replace of $glbRevisionNumber$ in every committed file.
精彩评论