From 73f3ae70f01aa900d654d091dd54860cb7214f71 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Mon, 10 Mar 2008 05:49:55 +0000 Subject: [PATCH] fixed "up" link git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@7482 71c3de6d-444a-0410-be80-ed276b4c234a --- core/pom.xml | 2 +- .../main/java/hudson/matrix/MatrixRun.java | 14 +++++++++++++ .../main/java/hudson/maven/MavenBuild.java | 17 +++++++++++++++ .../main/java/hudson/model/AbstractBuild.java | 21 +++++++++++++++++++ .../model/AbstractBuild/sidepanel.jelly | 2 +- 5 files changed, 54 insertions(+), 2 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 207c23746d..2df7c4190b 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -274,7 +274,7 @@ org.kohsuke.stapler stapler - 1.62 + 1.63 org.kohsuke diff --git a/core/src/main/java/hudson/matrix/MatrixRun.java b/core/src/main/java/hudson/matrix/MatrixRun.java index 08fca765f2..d8e7bb35d4 100644 --- a/core/src/main/java/hudson/matrix/MatrixRun.java +++ b/core/src/main/java/hudson/matrix/MatrixRun.java @@ -31,6 +31,20 @@ public class MatrixRun extends Build { super(project, buildDir); } + public String getUpUrl() { + StaplerRequest req = Stapler.getCurrentRequest(); + if(req!=null) { + List ancs = req.getAncestors(); + for( int i=1; i { super(project, buildDir); } + @Override + public String getUpUrl() { + StaplerRequest req = Stapler.getCurrentRequest(); + if(req!=null) { + List ancs = req.getAncestors(); + for( int i=1; i,R extends Abs return builtOn; } + /** + * Used to render the side panel "Back to project" link. + * + *

+ * In a rare situation where a build can be reached from multiple paths, + * returning different URLs from this method based on situations might + * be desirable. + * + *

+ * If you override this method, you'll most likely also want to override + * {@link #getDisplayName()}. + */ + public String getUpUrl() { + return Functions.getNearestAncestorUrl(Stapler.getCurrentRequest(),getParent())+'/'; + } + /** * List of users who committed a change since the last non-broken build till now. * diff --git a/core/src/main/resources/hudson/model/AbstractBuild/sidepanel.jelly b/core/src/main/resources/hudson/model/AbstractBuild/sidepanel.jelly index 89f8780b8f..5a5143f89f 100644 --- a/core/src/main/resources/hudson/model/AbstractBuild/sidepanel.jelly +++ b/core/src/main/resources/hudson/model/AbstractBuild/sidepanel.jelly @@ -6,7 +6,7 @@ - + -- GitLab