conda/conda-build — pull request #207 by pigmej (2014-09-17 23:19:08+00:00)
Title: Added HG_* variables to environ when build

Added:

``HG_BRANCH`` - current branch
``HG_NUM_ID`` - commit num id
``HG_LATEST_TAG_DISTANCE`` commit distance from latest known tag (possibly follows ``GIT_DESCRIBE_NUMBER`` logic)
``HG_SHORT_ID`` - commit short id
``HG_BUILD_STR`` - similar to ``GIT_BUILD_STR`` so NUM + SHORT joined with `_`

Allows to create meta.yaml like:

```
package:
name: package_name
version: {{ environ.get('HG_LATEST_TAG', "current") }}

build:
number: {{ environ.get('HG_NUM_ID', 0) }}

string: {{ environ.get('HG_BUILD_STR', '') }}

source:
hg_url: /tmp/repo_path

```

Idea at first reported by me there: https://github.com/conda/conda/issues/916