title: How can I get the current mercurial changeset revision not the hash
body: <p>I need to get the current mercurial changeset to return in a <strong>very simple webservice</strong>, just the incrementing revision number and not the hash.
  I know I can use</p>
  
  <pre><code> hg --cwd C:\repos\MyRepo parent
  </code></pre>
  
  <p>which will return me</p>
  
  <pre><code>changeset:   730:9d347e4a8d47
  tag:         tip
  user:        Simon Martin &lt;simon.martin@mydomain.com&gt;
  date:        Tue Jun 12 15:39:45 2012 +0100
  summary:     Fixed defect #244...
  </code></pre>
  
  <p>What I need though is just the 730 part of the changeset. The goal is to be able to write a very simple web service that will return that value - this will then be picked up by another application and displayed in the footer to give a quick reference as to which <em>local</em> revision is current. The testing process can then refer to that 'build' which can then be used to identify that.</p>