我想在提交时在源代码中注入修订号。
我发现我可以通过 svn shell 通过执行以下操作来完成此操作:
find . -name *.php -exec svn propset svn:keywords "Rev"
但是其他人说这不起作用,因为存储库中没有文件(因为它们的文件已加密),我应该能够在乌龟SVN。我找到了“Hook Scripts”部分,但我完全没有这方面的经验。
如果我想让第一行代码看起来像这样,你能给我一些命令应该是什么样子的指示吗:
/*
* Version: 154
* Last modified on revision: 150
*/
我知道你可以使用 $ver$ 注入,但如何做到这一点,所以只有某些目录中的文件某些扩展程序会对此进行更改。
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.
发布评论
评论(1)
不要编写自己的方法来注入版本号。相反,
$Revision$
, etc.) 在您希望进行替换的文件中,Don't write your own method for injecting version numbers. Instead,
$Revision$
, etc.) in the files you want the replacement to happen forsvn propset svn:keywords Revision
or some such) for those files