Skip to content

Commit

Permalink
Merge pull request #1 from espenhw/master
Browse files Browse the repository at this point in the history
Add support for specifying permalinks in from/to parameters
  • Loading branch information
wolfs committed Sep 18, 2011
2 parents 8eb8a2f + 486fa63 commit e2aba7a
Showing 1 changed file with 12 additions and 2 deletions.
Expand Up @@ -40,8 +40,8 @@ st = namespace("jelly:stapler")
l.layout(title: _("all.changes.title", my.project.name)) {
st.include(page: "sidepanel.jelly", it: my.project)
l.main_panel() {
def from = request.getParameter('from')
def to = request.getParameter('to')
def from = buildNumber(request.getParameter('from'));
def to = buildNumber(request.getParameter('to'));

h1(_("All Changes"))
def builds = Functions.filter(my.project.buildsAsMap, from, to).values()
Expand All @@ -53,6 +53,16 @@ l.layout(title: _("all.changes.title", my.project.name)) {
}
}

private buildNumber(String build) {
if (build?.isInteger()) {
return build
} else {
def permaLink = my.project.getPermalinks().get(build)
def run = permaLink?.resolve(my.project)
return run?.number?.toString()
}
}

private showChanges(Collection<AbstractBuild> builds) {
boolean hadChanges = false;
for (AbstractBuild build in builds) {
Expand Down

0 comments on commit e2aba7a

Please sign in to comment.