使用Mercurial进行自动构建的版本编号 [英] Version numbering for auto builds with Mercurial

查看:70
本文介绍了使用Mercurial进行自动构建的版本编号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们最近从SVN切换到了Mercurial.我们还设置了一个CruiseControl.NET来运行自动构建,该构建从源代码管理中获取最新信息并构建应用程序.

We recently switched from SVN to Mercurial. We also have a CruiseControl.NET set up to run auto builds which gets the latest from the source control and builds the app.

在用于自动构建的CruiseControl.NET仪表板中,我们要显示版本号.显然,Mercurial具有此十六进制版本号.

In the CruiseControl.NET dashboard for auto builds, we want to show the version number. Apparently, mercurial has this hexa decimal version numbers.

在使用Mercurial源代码控制系统时,在CruiseControl.NET中处理版本号的通用标准是什么?十六进制值是否照原样使用?还有哪些其他选择?

What is the common standard for dealing with version numbers in CruiseControl.NET when working with Mercurial source control systems. Are the hexa decimal values used as is? What are the other options?

推荐答案

一个不错的选择是:

hg log -r . --template '{latesttag}-{latesttagdistance}-{node|short}'

如果您要标记发行版本,则会得到以下信息:

Which if you're tagging for releases gets you something like:

1.0-10-0746c606103c

读为自1.0以来,带有哈希0746c606103c的十个修订版".

which reads as "ten revisions since 1.0 with hash 0746c606103c".

我承认我不知道如何在CruiseControl.NET中获取该值,但是如果您能够获取它来调用该命令,那么您将具有很好的价值.

I'll admit I've no idea how to get that value into CruiseControl.NET, but if you can get it to invoke that command you'll have a good value.

这篇关于使用Mercurial进行自动构建的版本编号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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