add global revision number in php source files

大兔子大兔子 提交于 2019-12-25 04:39:17

问题


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 all 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 ?


回答1:


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/




回答2:


Create a pre-commit hook in your version control system that does a replace of $glbRevisionNumber$ in every committed file.



来源:https://stackoverflow.com/questions/3421665/add-global-revision-number-in-php-source-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!