Version numbering for auto builds with Mercurial

霸气de小男生 提交于 2019-12-12 19:13:37

问题


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.

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

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?


回答1:


A great option is:

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

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

1.0-10-0746c606103c

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

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.




回答2:


If CruiseControl uses always the same source repo and if you are not fond of rewriting history, you can try to use another template-keyword, {rev}

rev Integer. The repository-local changeset revision number.



来源:https://stackoverflow.com/questions/9212435/version-numbering-for-auto-builds-with-mercurial

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