提交 6c57a3e4 编写于 作者: K kohsuke

adding a switch for using shorter path names.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5754 71c3de6d-444a-0410-be80-ed276b4c234a
上级 f76897de
package hudson.matrix;
import hudson.Util;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.Collection;
import java.util.Set;
import java.util.HashSet;
/**
* A particular combination of {@link Axis} values.
......@@ -90,6 +92,13 @@ public final class Combination extends TreeMap<String,String> implements Compara
return toString(',','=');
}
/**
* Gets the 8 character-wide hash code for this combination
*/
public String digest() {
return Util.getDigestOf(toString());
}
/**
* Reverse operation of {@link #toString()}.
*/
......
......@@ -112,7 +112,10 @@ public class MatrixConfiguration extends Project<MatrixConfiguration,MatrixRun>
if(node==null) node = Hudson.getInstance();
FilePath ws = node.getWorkspaceFor(getParent());
if(ws==null) return null;
return ws.child(getCombination().toString('/','/'));
if(useShortWorkspaceName)
return ws.child(getCombination().digest());
else
return ws.child(getCombination().toString('/','/'));
}
@Override
......@@ -226,4 +229,14 @@ public class MatrixConfiguration extends Project<MatrixConfiguration,MatrixRun>
public boolean isActiveConfiguration() {
return getParent().getActiveConfigurations().contains(this);
}
/**
* On Cygwin, path names cannot be longer than 256 chars.
* See http://cygwin.com/ml/cygwin/2005-04/msg00395.html and
* http://www.nabble.com/Windows-Filename-too-long-errors-t3161089.html for
* the background of this issue. Setting this flag to true would
* cause Hudson to use cryptic but short path name, giving more room for
* jobs to use longer path names.
*/
public static boolean useShortWorkspaceName = Boolean.getBoolean(MatrixConfiguration.class.getName()+".useShortWorkspaceName");
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册