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

Support tags instead of branches

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • mercurial-plugin
    • None

      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)

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

              Created:
              Updated:
              Resolved: