Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use mercurial from nant

I have a little private Google code project. For a SCM I use Mercurial. And for the local build i would like to use nant.

So basically:

  1. I would like to download my source files from a known mercurial repository using a nant task
  2. I would like to somehow get the revision number of the repository so that I can assemble a nice little assembly version number

The build script will not be used for continuous integration but only for nightly builds and production builds.

Thanks for the help

like image 804
Dejan Avatar asked Sep 12 '09 23:09

Dejan


1 Answers

I don't know nant, but in (real) ant, we just use the <exec> task to invoke the hg binary. Depending clean you'd like to start you can clone or just pull and executing hg id -i gets you the revision number cleanly. Another thing to consider is using the archive links on the remote web interface (essentially the hg archive command via HTTP) and just use wget (not the equivalent nant task) to pull down the tip archive, which has an easy consistent link, and then you can get the revision id from inside the archive's hg_archival.txt file.

like image 132
Ry4an Brase Avatar answered Oct 17 '22 20:10

Ry4an Brase