Auto-build version numbering with Mercurial

We recently switched from SVN to Mercurial. We also have CruiseControl.NET, created to run automatic builds, which receives the latest data from the original control and creates the application.

In the CruiseControl.NET dashboard for automatic assembly, we want to show the version number. Mercurial seems to have these hexadecimal decimal version numbers.

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

+2
source share
2 answers

Great option:

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

What if you tag for releases, you get something like:

 1.0-10-0746c606103c 

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

I admit that I have no idea how to get this value in CruiseControl.NET, but if you can force it to call this command, you will have good value.

+3
source

If CruiseControl always uses the same source repo, and if you don't like rewriting history, you can try using another template keyword, {rev}

rev Integer. The revision number of the local repository set.

0
source

Source: https://habr.com/ru/post/1444109/


All Articles