Subversion as version-incrementor at each commit?

送分小仙女□ 提交于 2019-11-29 11:59:54

Sounds like you want some kind of $GlobalRev$ to get the global revision number into your files.

The appropriate tool you may want to look at would be svnversion

You can use it as post-commit hook or in your build/deployment process to create or modify a global version file.

Also see "Where's $GlobalRev$?" in this page

We don't do this on commit, we do this as part of our deployment process. The deployment pulls the latest code (or a particular revision) along with the SVN revision number, puts the version in the relvent places (AssemblyInfo, PHP version file etc.) then deploys it to test/UAT/live/whatever.

Hook scripts are the only option here. You have two options to accomplish that task: Either verify that the version.php is up-to-date in a pre-commit script, as suggested by the subversion handbook, or initiate another commit updating your version file in a post-commit script. You should not modify the commited files in hooks as pointed out by the handbook.

Subversion uses a repository-wide revision numbering system (see the "Global Revision Numbers" sidebar here), so your file is already being bumped.

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