Skip to content
Permalink
Browse files

Slightly better version of JENKINS-30795, should work in all cases

  • Loading branch information
MadsNielsen committed Oct 28, 2015
1 parent bc5d766 commit 332154b58367fd6bc199e8932cac5c200e2f2676
Showing with 22 additions and 9 deletions.
  1. +6 −6 pom.xml
  2. +16 −3 src/main/java/net/praqma/hudson/scm/CCUCMScm.java
12 pom.xml
@@ -119,7 +119,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>javancss-maven-plugin</artifactId>
<version>2.0</version>
<version>2.1</version>
<executions>
<execution>
<phase>package</phase>
@@ -137,7 +137,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>javancss-maven-plugin</artifactId>
<version>2.0</version>
<version>2.1</version>
</plugin>
</plugins>
</reporting>
@@ -154,7 +154,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>javancss-maven-plugin</artifactId>
<version>2.0-beta-2</version>
<version>2.1</version>
</plugin>
</plugins>
</reporting>
@@ -187,7 +187,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.10</version>
<version>2.17</version>
<configuration>
<enableRulesSummary>false</enableRulesSummary>
</configuration>
@@ -387,8 +387,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>

@@ -29,6 +29,7 @@
import net.praqma.clearcase.exceptions.DeliverException;
import net.praqma.clearcase.exceptions.DeliverException.Type;
import net.praqma.clearcase.exceptions.UnableToInitializeEntityException;
import net.praqma.clearcase.exceptions.UnableToLoadEntityException;
import net.praqma.clearcase.ucm.entities.*;
import net.praqma.clearcase.ucm.entities.Project;
import net.praqma.clearcase.ucm.view.SnapshotView;
@@ -277,10 +278,22 @@ public boolean checkout(AbstractBuild<?, ?> build, Launcher launcher, FilePath w
} catch (CCUCMException e) {

logger.warning(e.getMessage());
/* If the promotion level is not set, ANY, use the last found Baseline, or the manual build was triggered */
if (mode.getPromotionLevel() == null || build.getCause(UserIdCause.class) != null) {
CCUCMBuildAction last = getLastAction(build.getProject());
Baseline updated = null;
if(last != null) {
try {
updated = Baseline.get(last.getBaseline().getFullyQualifiedName()).load(true);
} catch (UnableToInitializeEntityException | UnableToLoadEntityException ex) {
logger.log(Level.WARNING, "Unable to reload previous baseline", ex);
}
}

/*
If the promotion level is not set, ANY, use the last found Baseline. Alternatively, if the baseline that was last built has not been altered (Rejected/Promoted)
the we assume we can safely do the same again.
*/
if (mode.getPromotionLevel() == null || (updated != null && mode.getPromotionLevel().equals(updated.getPromotionLevel()))) {
logger.fine("Configured to use the latest always.");
CCUCMBuildAction last = getLastAction(build.getProject());
if (last != null) {
action.setBaseline(last.getBaseline());
} else {

0 comments on commit 332154b

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