return config;
}
@NotNull
public ErrorCollection validate(@NotNull BuildConfiguration buildConfiguration) {
ErrorCollection errorCollection = super.validate(buildConfiguration);
String repName = buildConfiguration.getString(Constants.PLASTIC_REPOSITORY);
String repServer = buildConfiguration.getString(Constants.PLASTIC_REPOSITORYSERVER);
String branch = buildConfiguration.getString(Constants.PLASTIC_BRANCH_TO_TRACK);
if (repName == null || repName.trim().length() == 0) {
errorCollection.addError(Constants.PLASTIC_REPOSITORY, "The repository name must be specified");
}
try {
BranchInfo brInfo;
if (branch.equals(Constants.BR_NAME))
brInfo = Utils.getBranchInfo(Constants.MAIN, repName, repServer);
else
brInfo = Utils.getBranchInfo(branch, repName, repServer);
if (brInfo == null)
throw new Exception("Branch not found:" + branch);
}
catch(Exception ex) {
errorCollection.addError(Constants.PLASTIC_BRANCH_TO_TRACK,
"The specified branch does not exist in the specified repository and server.");
}
return errorCollection;
}