From d2eb155e577218bf6d8384643e5cf9a92ea18da5 Mon Sep 17 00:00:00 2001 From: mindless Date: Thu, 19 Feb 2009 00:49:40 +0000 Subject: [PATCH] Store axes used for matrix build in the MatrixBuild, so viewing build history will show matrix for that build, instead of axes for the project which may have changed. Also only tooltip attribute on status balls (as done elsewhere in Hudson), rather than both tooltip and title (firefox actually shows both). git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15447 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/matrix/Layouter.java | 2 +- core/src/main/java/hudson/matrix/MatrixBuild.java | 14 ++++++++++++-- .../hudson/matrix/MatrixBuild/ajaxMatrix.jelly | 6 +++--- .../hudson/matrix/MatrixProject/ajaxMatrix.jelly | 4 ++-- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/hudson/matrix/Layouter.java b/core/src/main/java/hudson/matrix/Layouter.java index ca54779019..474f3b0045 100644 --- a/core/src/main/java/hudson/matrix/Layouter.java +++ b/core/src/main/java/hudson/matrix/Layouter.java @@ -112,7 +112,7 @@ public abstract class Layouter { } /** - * Computes the width of n-th X-axis. + * Computes the width of n-th Y-axis. */ public int height(int n) { return calc(y,n); diff --git a/core/src/main/java/hudson/matrix/MatrixBuild.java b/core/src/main/java/hudson/matrix/MatrixBuild.java index b1aec5eeb5..046502c438 100644 --- a/core/src/main/java/hudson/matrix/MatrixBuild.java +++ b/core/src/main/java/hudson/matrix/MatrixBuild.java @@ -53,6 +53,8 @@ import org.kohsuke.stapler.StaplerResponse; * @author Kohsuke Kawaguchi */ public class MatrixBuild extends AbstractBuild { + private AxisList axes; + public MatrixBuild(MatrixProject job) throws IOException { super(job); } @@ -65,6 +67,13 @@ public class MatrixBuild extends AbstractBuild { super(project, buildDir); } + public Object readResolve() { + // MatrixBuild.axes added in 1.285; default to parent axes for old data + if (axes==null) + axes = getParent().getAxes(); + return this; + } + /** * Used by view to render a ball for {@link MatrixRun}. */ @@ -83,7 +92,7 @@ public class MatrixBuild extends AbstractBuild { } public Layouter getLayouter() { - return new Layouter(getParent().getAxes()) { + return new Layouter(axes) { protected RunPtr getT(Combination c) { return new RunPtr(c); } @@ -114,7 +123,7 @@ public class MatrixBuild extends AbstractBuild { try { MatrixRun item = getRun(Combination.fromString(token)); if(item!=null) - return item; + return item; } catch (IllegalArgumentException _) { // failed to parse the token as Combination. Must be something else } @@ -161,6 +170,7 @@ public class MatrixBuild extends AbstractBuild { } } + axes = p.getAxes(); Collection activeConfigurations = p.getActiveConfigurations(); final int n = getNumber(); diff --git a/core/src/main/resources/hudson/matrix/MatrixBuild/ajaxMatrix.jelly b/core/src/main/resources/hudson/matrix/MatrixBuild/ajaxMatrix.jelly index 38b2333fdd..5b56d89a35 100644 --- a/core/src/main/resources/hudson/matrix/MatrixBuild/ajaxMatrix.jelly +++ b/core/src/main/resources/hudson/matrix/MatrixBuild/ajaxMatrix.jelly @@ -29,13 +29,13 @@ THE SOFTWARE. - + ${b.iconColor.description} + tooltip="${p.tooltip}" alt="${p.tooltip}"/> ${p.combination.toString(o.z)} - \ No newline at end of file + diff --git a/core/src/main/resources/hudson/matrix/MatrixProject/ajaxMatrix.jelly b/core/src/main/resources/hudson/matrix/MatrixProject/ajaxMatrix.jelly index fef44af7c8..fb91fc091a 100644 --- a/core/src/main/resources/hudson/matrix/MatrixProject/ajaxMatrix.jelly +++ b/core/src/main/resources/hudson/matrix/MatrixProject/ajaxMatrix.jelly @@ -29,11 +29,11 @@ THE SOFTWARE. - ${p.iconColor.description} + ${p.iconColor.description} ${p.combination.toString(o.z)} - \ No newline at end of file + -- GitLab