[英]Maintain and automatically update a file containing current revision
I'm currently writing a script to report which revision of the base framework each of our projects are using. 我当前正在编写一个脚本来报告我们每个项目正在使用的基本框架的修订版。 I'm trying to do this by creating a version.txt file in our framework trunk which gets automatically updated with the current revision after each commit.
我正在尝试通过在我们的框架主干中创建一个version.txt文件来做到这一点,该文件在每次提交后会自动以当前修订版本进行更新。 This is so each project that has a copy of this base framework know it's revision that it is using.
这样,每个拥有此基本框架副本的项目都可以知道它正在使用的修订版本。
The problem i'm having is getting the version.txt to get updated with the revision after every commit. 我遇到的问题是每次提交后都会获取version.txt以使用修订版进行更新。
I've tried using $Revision$ keyword substitution, but this will only update if version.txt is modified itself (which defeats the purpose). 我试过使用$ Revision $关键字替换,但这只会在version.txt本身被修改时更新(这违背了目的)。
I've thought about using a pre-commit hook to make a change to version.txt so it gets added to the list of files to commit but not sure how to add a file to the commit list during a pre-commit. 我已经考虑过使用预提交钩子对version.txt进行更改,以便将其添加到要提交的文件列表中,但不确定如何在预提交期间将文件添加到提交列表中。
Any better ways to go about this? 还有更好的方法吗?
Thanks 谢谢
You still can use keyword in version.txt and use single commit, if you before every commit join needed for commit files and version.txt in changelist 如果在更改列表中提交文件和version.txt所需的每次提交联接之前 ,仍可以在version.txt中使用关键字并使用单个提交。
svn info
in nested WC of framework inside WC of your projects svn info
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.