提交 ca6f4c38 编写于 作者: K kohsuke

choosing the default values bit more wisely


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@4569 71c3de6d-444a-0410-be80-ed276b4c234a
上级 54988bd6
......@@ -608,4 +608,14 @@ public class Functions {
public static String getResourcePath() {
return Hudson.RESOURCE_PATH;
}
/**
* Can be used to check a checkbox by default.
* Used from views like {@code h.defaultToTrue(scm.useUpdate)}.
* The expression will evaluate to true if scm is null.
*/
public static boolean defaultToTrue(Boolean b) {
if(b==null) return true;
return b;
}
}
......@@ -16,7 +16,7 @@
<f:textbox name="cvs.cvsRsh" value="${scm.cvsRsh}"/>
</f:entry>
<f:entry title="Use update" help="/help/_cvs/update.html">
<f:checkbox name="cvs.canUseUpdate" checked="${scm.canUseUpdate}"/>
<f:checkbox name="cvs.canUseUpdate" checked="${h.defaultToTrue(scm.canUseUpdate)}"/>
</f:entry>
<f:entry title="Legacy mode" help="/help/_cvs/legacy.html">
<f:checkbox name="cvs.legacy" checked="${scm!=null and !scm.flatten}"/>
......
......@@ -23,7 +23,7 @@
description="
If checked, Hudson will use 'svn update' whenever possible, making the build faster.
But this causes the artifacts from the previous build to remain when a new build starts.">
<f:checkbox name="svn_use_update" checked="${scm.useUpdate}"/>
<f:checkbox name="svn_use_update" checked="${h.defaultToTrue(scm.useUpdate)}"/>
</f:entry>
<t:listScmBrowsers name="svn.browser" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册