Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-19800] Updating cool and loading only the baseline selected
  • Loading branch information
wolfgarnet committed Sep 27, 2013
1 parent 6be8eec commit 0b1a165
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -445,14 +445,14 @@
<dependency>
<groupId>net.praqma</groupId>
<artifactId>cool</artifactId>
<version>0.6.22</version>
<version>0.6.23</version>
<type>jar</type>
</dependency>

<dependency>
<groupId>net.praqma</groupId>
<artifactId>cool</artifactId>
<version>0.6.22</version>
<version>0.6.23</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
Expand Down
Expand Up @@ -5,6 +5,9 @@
import java.util.Date;
import java.util.logging.Logger;

import net.praqma.clearcase.exceptions.ClearCaseException;
import net.praqma.clearcase.exceptions.UnableToInitializeEntityException;
import net.praqma.clearcase.exceptions.UnableToLoadEntityException;
import net.praqma.clearcase.ucm.entities.Component;
import net.praqma.clearcase.ucm.entities.Project;
import net.praqma.clearcase.ucm.entities.Stream;
Expand Down Expand Up @@ -45,8 +48,7 @@ public BaselineList invoke( File f, VirtualChannel channel ) throws IOException,

baselines = new BaselineList( stream, component, plevel, multisitePolling ).
setSorting( new BaselineList.AscendingDateSort() ).
addFilter( new NoDeliver() ).
load();
addFilter( new NoDeliver() );

/* Only filter by date, if it is valid */
if( date != null ) {
Expand Down
13 changes: 8 additions & 5 deletions src/main/java/net/praqma/hudson/scm/CCUCMScm.java
Expand Up @@ -434,8 +434,8 @@ private void resolveBaseline( FilePath workspace, AbstractProject<?, ?> project,
throw new CCUCMException( "No valid Baselines found" );
}

//action.setBaselines( baselines );
action.setBaseline( selectBaseline( baselines, plevel ) );
/* Select and load baseline */
action.setBaseline( selectBaseline( baselines, plevel, workspace ) );

/* Print the baselines to jenkins out */
printBaselines( baselines, out );
Expand Down Expand Up @@ -785,13 +785,16 @@ public SCMRevisionState calcRevisionsFromBuild( AbstractBuild<?, ?> build, Launc
return scmRS;
}

private Baseline selectBaseline( List<Baseline> baselines, Project.PromotionLevel plevel ) {
private Baseline selectBaseline( List<Baseline> baselines, Project.PromotionLevel plevel, FilePath workspace ) throws IOException, InterruptedException {
Baseline selected = null;
if( baselines.size() > 0 ) {
if( plevel != null ) {
return baselines.get( 0 );
selected = baselines.get( 0 );
} else {
return baselines.get( baselines.size() - 1 );
selected = baselines.get( baselines.size() - 1 );
}

return (Baseline) RemoteUtil.loadEntity( workspace, selected, true );
} else {
return null;
}
Expand Down
Expand Up @@ -39,7 +39,7 @@
public class BaselinesFound extends BaseTestClass {

@Rule
public static ClearCaseRule ccenv = new ClearCaseRule( "ccucm" );
public static ClearCaseRule ccenv = new ClearCaseRule( "ccucm", "setup-bl-on-dev.xml" );

@Rule
public static DescriptionRule desc = new DescriptionRule();
Expand Down

0 comments on commit 0b1a165

Please sign in to comment.