How to get hg branch name in jenkins file

Viewed 138

I'm working with jenkins file pipeline and i want to show the hg branch name in the current build name ( instead of the build number ). I tried with this code: currentBuild.displayName = "${BRANCH_NAME}" but it returned null. Is there other solution ?

1 Answers

There is another environment variable for mercurial: ${MERCURIAL_REVISION_BRANCH}. This should not be null in case it is a branch being built. The feature got inserted by this pull request

Related