Issue
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 ?
Solution
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
Answered By - S.Spieker
Answer Checked By - Candace Johnson (JavaFixing Volunteer)