开发者

Inject the revision number in sourcecode (TortoiseSvn or SVN Shell)

I would like to inject the revision number in source code on commit. I found out that I could do it through svn shell by doing something like:

find . -name *.php -exec svn propset svn:keywords "Rev"

However someone else said that that would not work as there are no files in the repository (as they files are encrypted), and I should be able to do it in tortoiseSVN. I found the "Hook Scripts" section, but I have completely no experience with this stuff.

Could you give me some indication how the command should look like, if I would like to have the first lines of code look like开发者_运维问答:

/*
*    Version: 154
*    Last modified on revision: 150
*/

I know that you could inject by using $ver$ but how to do it so only files in certain directories with certain extensions get this changed.


Don't write your own method for injecting version numbers. Instead,

  • only introduce the replaced tags $Revision$, etc.) in the files you want the replacement to happen for
  • only enable replacement (using svn propset svn:keywords Revision or some such) for those files
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜