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

Support tags instead of branches

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When using a tag as the branch with mercurial, in some cases, the build will fail (example bellow).

      This is because the branch is used as a param to "hg incoming". Only the revisions up to the tagged one are pulled in the local clone. Since the tag is set in a changeset after the tagged revision itself, the tag name becomes unknown to the local clone -> The hg command that use the tag fails.

      The only solution I know is to avoid using "--rev" for the incoming command (same for pull).
      The drawback is that more changesets than needed will be retrieved, but at least we are sure to have the required ones.

      Example of log (TAG is set to "5.131-p18"):

      [Starform-6.0] $ hg incoming --quiet --bundle hg.bundle --template "<changeset node='

      {node}

      ' author='

      {author|xmlescape}

      ' rev='

      {rev}

      ' date='

      {date}

      '><msg>

      {desc|xmlescape}

      </msg><added>

      {file_adds|stringify|xmlescape}

      </added><deleted>

      {file_dels|stringify|xmlescape}

      </deleted><files>

      {files|stringify|xmlescape}

      </files><parents>

      {parents}

      </parents></changeset>\n" --rev ${TAG}
      [Starform-6.0] $ hg unbundle hg.bundle
      adding changesets
      adding manifests
      adding file changes
      added 12 changesets with 13 changes to 3 files (+1 heads)
      (run 'hg heads' to see heads, 'hg merge' to merge)
      [Starform-6.0] $ hg update --clean --rev ${TAG}
      abort: unknown revision '5.131-p18'!

      (jglick, I assigned you the issue since you seem to be maintaining the plugin)

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            It is currently only on the experimental update center. I can push a general 1.50 release, though; probably about time.

            Show
            jglick Jesse Glick added a comment - It is currently only on the experimental update center. I can push a general 1.50 release, though; probably about time.
            Hide
            cowwoc cowwoc added a comment -

            (Confused) Is this fix part of the public plugin? Or is it not released to the public yet? Last time I checked I didn't see a separate "tag" UI field.

            Show
            cowwoc cowwoc added a comment - (Confused) Is this fix part of the public plugin? Or is it not released to the public yet? Last time I checked I didn't see a separate "tag" UI field.
            Hide
            mienamoo Hermien Pellissier added a comment -

            I installed the experimental plugin with this change, and it works beautifully. Thanks Jesse!

            Show
            mienamoo Hermien Pellissier added a comment - I installed the experimental plugin with this change, and it works beautifully. Thanks Jesse!
            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/MercurialSCM.java
            src/main/resources/hudson/plugins/mercurial/MercurialSCM/config.jelly
            src/main/resources/hudson/plugins/mercurial/MercurialSCM/help-branch.html
            src/main/resources/hudson/plugins/mercurial/MercurialSCM/help-revision.html
            src/main/resources/hudson/plugins/mercurial/MercurialSCM/help-revisionType.html
            src/test/java/hudson/plugins/mercurial/SCMTestBase.java
            http://jenkins-ci.org/commit/mercurial-plugin/a1d636a76bbcd99a7ee11e6460da3c2240030d42
            Log:
            [FIXED JENKINS-5396] Added supported option to update to a tag rather than a branch.

            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/MercurialSCM.java src/main/resources/hudson/plugins/mercurial/MercurialSCM/config.jelly src/main/resources/hudson/plugins/mercurial/MercurialSCM/help-branch.html src/main/resources/hudson/plugins/mercurial/MercurialSCM/help-revision.html src/main/resources/hudson/plugins/mercurial/MercurialSCM/help-revisionType.html src/test/java/hudson/plugins/mercurial/SCMTestBase.java http://jenkins-ci.org/commit/mercurial-plugin/a1d636a76bbcd99a7ee11e6460da3c2240030d42 Log: [FIXED JENKINS-5396] Added supported option to update to a tag rather than a branch.
            Hide
            jglick Jesse Glick added a comment -

            No time this week. Still on my list.

            Show
            jglick Jesse Glick added a comment - No time this week. Still on my list.

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                cdevienne cdevienne
              • Votes:
                15 Vote for this issue
                Watchers:
                19 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: