Subversion 在每次提交时作为版本增量器? [英] Subversion as version-incrementor at each commit?

查看:27
本文介绍了Subversion 在每次提交时作为版本增量器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在每次提交后将(最高)修订号更新到 subversion 存储库中的文件中.

I'd like to update the (highest) revision number to a file inside a subversion repository after each commit.

我想到了一个 svn version 关键字,但这不是只有在更改特定文件时才会更新吗?

I thought of a svn version keyword, but doesn't this only get updated if the specific file was changed?

即我有一个文件 version.php,其中有版本/修订号,但只在提交中更新 anotherfile.php - 这不会更改版本/修订版信息version.php 有.

i.e. I have a file version.php where i have the version/revision numbers, but only update anotherfile.php in my commit - this won't change the version/revision information version.php has.

提交钩子是我唯一的选择吗?如果是,有什么例子吗?

Is a commit hook my only option? If yes, any examples?

推荐答案

听起来您想要某种 $GlobalRev$ 来将全局修订号放入您的文件中.

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

您可能想要查看的适当工具是 svnversion

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.

另请参阅$GlobalRev$ 在哪里?"在本页

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

这篇关于Subversion 在每次提交时作为版本增量器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆