Skip to content

Commit

Permalink
Use DEFAULT_FILE_LIMIT if max file limit is set to 0.
Browse files Browse the repository at this point in the history
JENKINS-49633
  • Loading branch information
p4paul committed Feb 22, 2018
1 parent 44298db commit 549aa7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Expand Up @@ -346,14 +346,16 @@ public String getCommitId() {
}

private int getFileCountLimit() {
int max = 0;
Jenkins j = Jenkins.getInstance();
if (j != null) {
Descriptor dsc = j.getDescriptor(PerforceScm.class);
if (dsc instanceof PerforceScm.DescriptorImpl) {
PerforceScm.DescriptorImpl p4scm = (PerforceScm.DescriptorImpl) dsc;
fileCountLimit = p4scm.getMaxFiles();
max = p4scm.getMaxFiles();
}
}
fileCountLimit = (max > 0) ? max : PerforceScm.DEFAULT_FILE_LIMIT;
return fileCountLimit;
}
}
Expand Up @@ -38,10 +38,10 @@

<f:section title="Perforce: Query limits">
<f:entry title="${%Maximum number of files shown in a changelist}" field="maxFiles">
<f:textbox default="50"/>
<f:textbox default="${descriptor.DEFAULT_FILE_LIMIT}"/>
</f:entry>
<f:entry title="${%Maximum number of changes shown in a build}" field="maxChanges">
<f:textbox default="20"/>
<f:textbox default="${descriptor.DEFAULT_CHANGE_LIMIT}"/>
</f:entry>
</f:section>

Expand Down

0 comments on commit 549aa7f

Please sign in to comment.