Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-10706

MERCURIAL_BRANCH environment variable

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Currently the plugin makes available only the variable MERCURIAL_REVISION.

      Would it make sense to add MERCURIAL_BRANCH?

      Please find attached the patch that does it.

        Attachments

          Activity

          Hide
          jenkinssmc Bob M added a comment - - edited

          I need MERCURIAL_BRANCH .
          I have many jobs that run based on branch "A".
          I have a new requirement to do the same jobs on branch "B".
          These jobs have many steps.
          Right now, I have to copy the jobs and change the branch name in every step.
          I cannot use something like "hg id --branch", because some of these cases are parameters to another plugin.
          For example, see the XCode plugin field: Technical version .
          It would help me a lot to have the branch name as an environment variable.

          Since there is already a patch for this attached to this bug, can you merge it into the plugin?
          I assume you have not done so yet due to some combination of time and community interest.

          Show
          jenkinssmc Bob M added a comment - - edited I need MERCURIAL_BRANCH . I have many jobs that run based on branch "A". I have a new requirement to do the same jobs on branch "B". These jobs have many steps. Right now, I have to copy the jobs and change the branch name in every step. I cannot use something like "hg id --branch", because some of these cases are parameters to another plugin. For example, see the XCode plugin field: Technical version . It would help me a lot to have the branch name as an environment variable. Since there is already a patch for this attached to this bug, can you merge it into the plugin? I assume you have not done so yet due to some combination of time and community interest.
          Hide
          jglick Jesse Glick added a comment -

          GH pull requests will be considered. The attached patch is undesirable since it does not keep the branch information in MercurialTagAction like the other bits of info (changeset node ID, and recently also revision number).

          Show
          jglick Jesse Glick added a comment - GH pull requests will be considered. The attached patch is undesirable since it does not keep the branch information in MercurialTagAction like the other bits of info (changeset node ID, and recently also revision number).
          Show
          misery A. Klitzing added a comment - https://github.com/jenkinsci/mercurial-plugin/pull/62
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: André Klitzing
          Path:
          src/main/java/hudson/plugins/mercurial/HgExe.java
          src/main/java/hudson/plugins/mercurial/MercurialSCM.java
          src/main/java/hudson/plugins/mercurial/MercurialTagAction.java
          src/main/resources/hudson/plugins/mercurial/Messages.properties
          src/test/java/hudson/plugins/mercurial/ChangeComparatorTest.java
          src/test/java/hudson/plugins/mercurial/MercurialSCMTest.java
          src/test/java/hudson/plugins/mercurial/MercurialTagActionTest.java
          http://jenkins-ci.org/commit/mercurial-plugin/1140b3b276bf0452ad009b2eef8200fd2c0f930e
          Log:
          JENKINS-10706 Add env variable MERCURIAL_REVISION_BRANCH

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: André Klitzing Path: src/main/java/hudson/plugins/mercurial/HgExe.java src/main/java/hudson/plugins/mercurial/MercurialSCM.java src/main/java/hudson/plugins/mercurial/MercurialTagAction.java src/main/resources/hudson/plugins/mercurial/Messages.properties src/test/java/hudson/plugins/mercurial/ChangeComparatorTest.java src/test/java/hudson/plugins/mercurial/MercurialSCMTest.java src/test/java/hudson/plugins/mercurial/MercurialTagActionTest.java http://jenkins-ci.org/commit/mercurial-plugin/1140b3b276bf0452ad009b2eef8200fd2c0f930e Log: JENKINS-10706 Add env variable MERCURIAL_REVISION_BRANCH
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/hudson/plugins/mercurial/HgExe.java
          src/main/java/hudson/plugins/mercurial/MercurialSCM.java
          src/main/java/hudson/plugins/mercurial/MercurialTagAction.java
          src/main/resources/hudson/plugins/mercurial/Messages.properties
          src/test/java/hudson/plugins/mercurial/ChangeComparatorTest.java
          src/test/java/hudson/plugins/mercurial/HgExeFunctionalTest.java
          src/test/java/hudson/plugins/mercurial/MercurialSCMTest.java
          src/test/java/hudson/plugins/mercurial/MercurialTagActionTest.java
          src/test/java/hudson/plugins/mercurial/SCMTestBase.java
          http://jenkins-ci.org/commit/mercurial-plugin/f3fd807f20d1ab1bd49698a389ad24fd061afa87
          Log:
          Merge pull request #62 from misery/master

          [FIXED JENKINS-10706] Add env variable MERCURIAL_REVISION_BRANCH
          A couple of minor comments outstanding, but those can be fixed up later or not at all.

          Compare: https://github.com/jenkinsci/mercurial-plugin/compare/5e5b7ca8b055...f3fd807f20d1

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/hudson/plugins/mercurial/HgExe.java src/main/java/hudson/plugins/mercurial/MercurialSCM.java src/main/java/hudson/plugins/mercurial/MercurialTagAction.java src/main/resources/hudson/plugins/mercurial/Messages.properties src/test/java/hudson/plugins/mercurial/ChangeComparatorTest.java src/test/java/hudson/plugins/mercurial/HgExeFunctionalTest.java src/test/java/hudson/plugins/mercurial/MercurialSCMTest.java src/test/java/hudson/plugins/mercurial/MercurialTagActionTest.java src/test/java/hudson/plugins/mercurial/SCMTestBase.java http://jenkins-ci.org/commit/mercurial-plugin/f3fd807f20d1ab1bd49698a389ad24fd061afa87 Log: Merge pull request #62 from misery/master [FIXED JENKINS-10706] Add env variable MERCURIAL_REVISION_BRANCH A couple of minor comments outstanding, but those can be fixed up later or not at all. Compare: https://github.com/jenkinsci/mercurial-plugin/compare/5e5b7ca8b055...f3fd807f20d1
          Hide
          datallah Daniel Atallah added a comment -

          Is there a reason why the MERCURIAL_REVISION_BRANCH env. variable isn't exposed when the revisionType is BRANCH?
          See https://github.com/jenkinsci/mercurial-plugin/compare/5e5b7ca8b055...f3fd807f20d1#diff-c31f4dd29af8cb912ee0613331c0e3c1R851

          This is problematic to me because I expect MERCURIAL_REVISION_BRANCH to be specified consistently and it's only there when the build wasn't triggered by a branch revision.

          Show
          datallah Daniel Atallah added a comment - Is there a reason why the MERCURIAL_REVISION_BRANCH env. variable isn't exposed when the revisionType is BRANCH? See https://github.com/jenkinsci/mercurial-plugin/compare/5e5b7ca8b055...f3fd807f20d1#diff-c31f4dd29af8cb912ee0613331c0e3c1R851 This is problematic to me because I expect MERCURIAL_REVISION_BRANCH to be specified consistently and it's only there when the build wasn't triggered by a branch revision.

            People

            • Assignee:
              kohsuke Kohsuke Kawaguchi
              Reporter:
              soveste Sergiu Ivasenco
            • Votes:
              5 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: