Skip to content

[JENKINS-626] permanent url for svn revision of a build #389

Description

@jenkins-infra-bot

Provide a permanent download link for the svn revision of a build.

This allows you to do something like:

  1. svn update -r `wget http://hudson/job/foo/lastSuccessfullBuild/revision`
    and get a revision that is guaranteed to work.

Originally reported by huybrechts, imported from: permanent url for svn revision of a build
  • status: Reopened
  • priority: Major
  • component(s): subversion-plugin
  • resolution: Unresolved
  • votes: 2
  • watchers: 4
  • imported: 20251212-090250
Raw content of original issue

Provide a permanent download link for the svn revision of a build.

This allows you to do something like:

  1. svn update -r `wget http://hudson/job/foo/lastSuccessfullBuild/revision` and get a revision that is guaranteed to work.
  • environment: Platform: All, OS: All

Activity

  1. jenkins-infra-bot commented on Jul 1, 2007

    @jenkins-infra-bot
    Author
    kohsuke:

    Implemented in 1.115 as a combination of two generic features.

    1. I added svn revision info to the XML API of the build object. So now
    http://hudson/job/foo/lastSuccessfullBuild/api/xml will include the information
    you need.

    2. The XML API takes optional 'xpath' query parameter to allow you to specify
    which part of the information you'd like to retrieve. So you can request URL
    like
    http://localhost:8080/job/svn-test/lastSuccessfulBuild/api/xml?xpath=/*/changeSet/revision/revision/text()
    to just fetch the revision number (say "1234"), then feed that into wget.

  2. jenkins-infra-bot commented on Jul 16, 2010

    @jenkins-infra-bot
    Author
    elifarley:

    When you build twice in a row, the second build will probably have no changes. In that case, you won't be able to find out the working copy revision.

    I have tested this on my Mercurial-backed project using a URL like this:
    http://my-server/hudson/view/RC/job/My-job/102/api/xml?xpath=/*/changeSet/item[1]/node/text()

  3. jenkins-infra-bot commented on Feb 28, 2014

    @jenkins-infra-bot
    Author
    dannystaple:
    • Original comment link
    • Raw content of original comment:

      How does this now work since the "primitive XPath result sets now forbidden"? I can query without "text()" and have the surrounding XML - but that requires additional SED or other transformation to de-xml it.

    How does this now work since the "primitive XPath result sets now forbidden"? I can query without "text()" and have the surrounding XML - but that requires additional SED or other transformation to de-xml it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions