Java: how to get mercurial current changeset number for use in program
- by Rabarberski
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)?