title: Mercurial Fetcher and AUTOREV
body: <p>I'm trying to get a bitbake file to pull down the latest revision of a mercurial repo when it builds. It's unfortunately undocumented (<a href="https://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake-user-manual.html#auto-revisions" rel="nofollow">https://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake-user-manual.html#auto-revisions</a>), though there are a few mailing list posts on the topic. None of my attempts to recreate their methods have panned out.</p>
  
  <p>This is what the .bb file looks like:</p>
  
  <pre><code>###############################################################################
  # Variables for locations.
  ###############################################################################
  SRC_URI = "hg://foo//bar/foobar/test;rev=${SRCREV};protocol=ssh;branch=default;module=root"
  SRCREV = "${AUTOREV}"
  
  # Sources are downloaded to an hg subdirectory when pulling a repo.
  S = "${WORKDIR}/hg"
  
  ###############################################################################
  # The version of the library we're going to install.
  ###############################################################################
  # Set PV to SRCPV so bitbake knows it should always check SRC_URI for a new
  # version of the application.
  PV = "${SRCPV}"
  PR = "r0"
  PE = "1"
  </code></pre>
  
  <p>And here's the relevant part of the output error:</p>
  
  <pre><code>/usr/bin/env hg up -C -r AUTOINC
  | DEBUG: Python function base_do_unpack finished
  | DEBUG: Python function do_unpack finished
  | ERROR: Function failed: Fetcher failure: Fetch command failed with exit code 255, output:
  | abort: unknown revision 'AUTOINC'!
  | 
  NOTE: recipe test-1_AUTOINC+AUTOINC-r0: task do_unpack: Failed
  DEBUG: Teardown for bitbake-worker
  NOTE: Tasks Summary: Attempted 361 tasks of which 359 didn't need to be rerun and 1 failed.
  
  Summary: 1 task failed:
    /home/intern/git/poky/meta/recipes-core/test/test_0.0.1.bb, do_unpack
  Summary: There was 1 ERROR message shown, returning a non-zero exit code.
  </code></pre>
  
  <p>The problem seems to be that AUTOREV is resolving to AUTOINC instead of a hash number. Any thoughts on what I can change to fix this?</p>