title: Get a single file from a remote mercurial repository
body: <p>Is there a way to programmatically download a single file from a remote Mercurial repository, in Java? I have asked a <a href="https://stackoverflow.com/questions/3642143/get-a-single-file-from-a-remote-git-repository">very similar question regarding git</a>; now I'm hoping I can do something similar with mercurial as well.</p>
  
  <ol>
  <li>I prefer a solution which uses as little bandwidth as possible, preferably only downloading that single file. I do not need to browse the repository, I already have the file's path.</li>
  <li>I am not concerned with the history of the file, I only want its latest version.</li>
  <li>A solution that only prints the file to the output is great as well, of course - it doesn't really have to save the file to disk, I can do that myself.</li>
  <li>I prefer a solution which does not depend on other applications (e.g. an installation of a mercurial client on the machine). A Java library which contains a mercurial client implementation itself would be optimal. However, I will happily invoke <code>hg</code> if there's no other way.</li>
  </ol>
  
  <p>From what I understand about how Mercurial works - allowing working only against local repositories - this could prove to be problematic; but as I was able to do this with the similar Git SCM I'm hoping there's a solution for Mercurial as well.</p>