Skip to content

Commit

Permalink
[JENKINS-12202] adding substitution support for exclude User/Files fi…
Browse files Browse the repository at this point in the history
…elds
  • Loading branch information
Rob Petti committed Dec 22, 2011
1 parent 12242d4 commit aea3314
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/hudson/plugins/perforce/PerforceSCM.java
Expand Up @@ -1024,7 +1024,7 @@ private SCMRevisionState getCurrentDepotRevisionState(Workspace p4workspace, Abs
}
else {
for (int changeNumber : changeNumbers) {
if (isChangelistExcluded(depot.getChanges().getChangelist(changeNumber), logger)) {
if (isChangelistExcluded(depot.getChanges().getChangelist(changeNumber), project, logger)) {
logger.println("Changelist "+changeNumber+" is composed of file(s) and/or user(s) that are excluded.");
} else {
return new PerforceSCMRevisionState(changeNumber);
Expand All @@ -1041,14 +1041,14 @@ private SCMRevisionState getCurrentDepotRevisionState(Workspace p4workspace, Abs
* @param changelist the p4 changelist
* @return True if changelist only contains user(s) and/or file(s) that are denoted to be excluded
*/
private boolean isChangelistExcluded(Changelist changelist, PrintStream logger) {
private boolean isChangelistExcluded(Changelist changelist, AbstractProject project, PrintStream logger) {
if (changelist == null){
return false;
}

if (excludedUsers != null && !excludedUsers.trim().equals(""))
{
List<String> users = Arrays.asList(excludedUsers.split("\n"));
List<String> users = Arrays.asList(substituteParameters(excludedUsers,getDefaultSubstitutions(project)).split("\n"));

if ( users.contains(changelist.getUser()) ) {
logger.println("Excluded User ["+changelist.getUser()+"] found in changelist.");
Expand All @@ -1075,7 +1075,7 @@ private boolean isChangelistExcluded(Changelist changelist, PrintStream logger)

if (excludedFiles != null && !excludedFiles.trim().equals(""))
{
List<String> files = Arrays.asList(excludedFiles.split("\n"));
List<String> files = Arrays.asList(substituteParameters(excludedFiles,getDefaultSubstitutions(project)).split("\n"));
StringBuffer buff = null;
Matcher matcher = null;
boolean matchFound;
Expand Down

0 comments on commit aea3314

Please sign in to comment.