Skip to content
Permalink
Browse files

[JENKINS-12202] adding substitution support for exclude User/Files fi…

…elds
  • Loading branch information...
Rob Petti
Rob Petti committed Dec 22, 2011
1 parent 12242d4 commit aea33143a487fb626c7c90a6dc24c5d200ead0f1
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/main/java/hudson/plugins/perforce/PerforceSCM.java
@@ -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);
@@ -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.");
@@ -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;

0 comments on commit aea3314

Please sign in to comment.
You can’t perform that action at this time.