title: Mercurial - Check sanity patch
body: <p>I'm using Mercurial and I have a diff thanks to this command : <code>hg diff</code></p>
  
  <p>Here's my diff (example) :</p>
  
  <pre><code>diff -r 17899716342e config.js
  --- a/config.js Sat Mar 17 14:01:53 2012 +0100
  +++ b/config.js Sat Mar 17 18:15:16 2012 +0100
  @@ -8,6 +8,6 @@
   ];
  
   config.hostname = 'localhost';
  -config.port = '3000';
  +config.port = '8080';
  
  -module.exports = canfig;
  +module.exports = config;
  </code></pre>
  
  <p>In another repository, I would like to test is this diff can be applied. I know that <code>hg import</code> can import the diff in my current repository.</p>
  
  <p>From the man :</p>
  
  <pre><code>-f --force                   skip check for outstanding uncommitted changes
      --no-commit              don't commit, just update the working directory
      --bypass                 apply patch without touching the working
                               directory
  </code></pre>
  
  <p>But there's no argument to just check if the patch can be applied <strong>without modify my repository (and my working tree)</strong>.</p>
  
  <p>How can I do that ?</p>