title: How to get revision number from Mercurial server only by date?
body: <p>I'm not very familiar with Python &amp; Django.
  We use Jenkins as the server of Continuous Integration. But when Jenkins cloned the repository, some revisions are ommited (it's automatic process).
  When we need to build a package for test/production purposes, we have to mark it with exactly the same revision number as we can check on Mercurial server (repository).
  We use Fabric. 
  I've tried to make a combination with Fabric &amp; Python in one script (Python's Paramiko will be used to connect third party Mercurial server and get proper revision number).
  The revision is taken from Jenkins' made package on the local server as the date of last commit. It was simple:</p>
  
  <pre><code>pipe = subprocess.Popen(
      ['hg', 'log', '-l', '1', '--template', '{date|isodatesec}', env.repo_dir],
      stdout=subprocess.PIPE,
  )
  </code></pre>
  
  <p>But the problem is to take the revision number from Mercurial server. I've tried:</p>
  
  <pre><code>stdin, stdout, stderr = ssh_conn.execute('hg log -l 1 --date /"%s to %s/" --template {rev}')
  </code></pre>
  
  <p>...but without expected result.</p>