jenkinsci/mercurial-plugin — pull request #42 by timgifford (2013-07-09 15:43:07+00:00)
Title: added MERCURIAL_REVISION_SHORT environment variable

Our team has changed the build name using the [Build Name Setter Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Build+Name+Setter+Plugin), however the full node id provided by MERCURIAL_REVISION is too long and we avoid MERCURIAL_REVISION_NUMBER because it isn't unique across repositories.

I looked into 2 solutions:
1. Create a token macro using the [Token Macro Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Token+Macro+Plugin)
2. Add a new environment variable

I chose option 2 since it was a smaller change and didn't require any additional dependencies.

This patch adds a MERCURIAL_REVISION_SHORT environment variable that uses the first 12 characters of the MERCURIAL_REVISION.

If this pull request is accepted we'll need to update the [wiki page](https://wiki.jenkins-ci.org/display/JENKINS/Mercurial+Plugin) to include the MERCURIAL_REVISION_SHORT environmental variable.

Thanks,
Tim