提交 5039e6ed 编写于 作者: K kohsuke

Fixed a bug in link generation from matrix build when the corresponding...

Fixed a bug in link generation from matrix build when the corresponding configuration builds don't exist yet.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@8059 71c3de6d-444a-0410-be80-ed276b4c234a
上级 4b98d032
......@@ -60,6 +60,9 @@ public final class Combination extends TreeMap<String,String> implements Compara
* Works like {@link #toString()} but only include the given axes.
*/
public String toString(Collection<Axis> subset) {
if(size()==1 && subset.size()==1)
return values().iterator().next();
StringBuilder buf = new StringBuilder();
for (Axis a : subset) {
if(buf.length()>0) buf.append(',');
......
......@@ -12,7 +12,7 @@ import java.util.HashMap;
* <p>
* {@link Axis Axes} are split into four groups.
* {@link #x Ones that are displayed as columns},
* {@link #x Ones that are displayed as rows},
* {@link #y Ones that are displayed as rows},
* {@link #z Ones that are listed as bullet items inside table cell},
* and those which only have one value, and therefore doesn't show up
* in the table.
......
......@@ -39,10 +39,16 @@ public class MatrixBuild extends AbstractBuild<MatrixProject,MatrixBuild> {
super(project, buildDir);
}
public Layouter<MatrixRun> getLayouter() {
return new Layouter<MatrixRun>(getParent().getAxes()) {
protected MatrixRun getT(Combination c) {
return getRun(c);
public final class RunPtr {
public final Combination combination;
private RunPtr(Combination c) { this.combination=c; }
public MatrixRun getRun() { return MatrixBuild.this.getRun(combination); }
}
public Layouter<RunPtr> getLayouter() {
return new Layouter<RunPtr>(getParent().getAxes()) {
protected RunPtr getT(Combination c) {
return new RunPtr(c);
}
};
}
......
......@@ -4,11 +4,12 @@
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:s="/lib/form" xmlns:p="/lib/hudson/project">
<l:ajax>
<p:matrix autoRefresh="${it.isBuilding()}">
<a href="${p.parent.combination}/">
<img src="${imagesURL}/24x24/${h.ifThenElse(p!=null,p.buildStatusUrl,'grey.gif')}"
title="${p.iconColor.description}"/>
<j:set var="b" value="${p.run}" />
<a href="${p.combination}">
<img src="${imagesURL}/24x24/${h.ifThenElse(b!=null,b.buildStatusUrl,'grey.gif')}"
title="${b.iconColor.description}"/>
<j:if test="${empty(o.x) and empty(o.y)}">
${p.parent.combination.toString(o.z)}
${p.combination.toString(o.z)}
</j:if>
</a>
</p:matrix>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册