Java: how to get mercurial current changeset number for use in program

Posted by Rabarberski on Stack Overflow See other posts from Stack Overflow or by Rabarberski
Published on 2010-05-10T19:53:50Z Indexed on 2010/05/10 22:24 UTC
Read the original article Hit count: 211

Filed under:
|
|
|

I've recently started using mercurial for version control in a Java project. When I run my program, the input parameters it has used to produce certain a output, are written to a specific file. It would be nice if I could add the current mercurial changeset number (indicating the version of my program) to that output file as well.

What would be the easiest way to do so on Windows? I could write a simple Java parser to fetch the output of the first line of the hg log -l 1 command, but perhaps there is an easier way (i.e., less code lines)?

© Stack Overflow or respective owner

Related posts about java

Related posts about mercurial