Skip to content
Permalink
Browse files

Fixed JENKINS-22832

  • Loading branch information...
MadsNielsen committed Jun 2, 2014
1 parent d6dd530 commit c290f4773d04113a841f9d6c076d564dfe9f77f4
@@ -24,7 +24,7 @@

public abstract class AbstractConfigurationRotatorSCM implements Describable<AbstractConfigurationRotatorSCM>, ExtensionPoint {

private static Logger logger = Logger.getLogger(AbstractConfigurationRotatorSCM.class.getName());
private static final Logger logger = Logger.getLogger(AbstractConfigurationRotatorSCM.class.getName());
protected AbstractConfiguration projectConfiguration;

/**
@@ -87,7 +87,7 @@ public PollingResult poll(ConfigurationRotatorBuildAction action) throws AbortEx
return PollingResult.NO_CHANGES;
}

C configuration = action.getConfiguration();
AbstractConfiguration configuration = action.getConfiguration();

if (configuration != null) {
logger.fine("Resolving next configuration based on " + configuration);
@@ -17,14 +17,10 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import net.praqma.clearcase.PVob;
import net.praqma.clearcase.Rebase;
import net.praqma.clearcase.exceptions.CleartoolException;
import net.praqma.clearcase.exceptions.UCMEntityNotInitializedException;
import net.praqma.clearcase.exceptions.UnableToInitializeEntityException;
import net.praqma.clearcase.ucm.entities.Baseline;
import net.praqma.clearcase.ucm.entities.Component;
import net.praqma.clearcase.ucm.entities.Project;
import net.praqma.clearcase.ucm.entities.Stream;
import net.praqma.clearcase.ucm.view.SnapshotView;
import net.praqma.jenkins.configrotator.*;
import net.praqma.jenkins.configrotator.scm.ConfigRotatorChangeLogEntry;
@@ -6,8 +6,8 @@
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.util.HashMap;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.praqma.clearcase.ConfigSpec;
import net.praqma.clearcase.Rebase;
@@ -24,11 +24,11 @@

public class PrepareWorkspace implements FileCallable<SnapshotView> {

private Project project;
private final Project project;
private static final Logger log = Logger.getLogger(PrepareWorkspace.class.getName());
private TaskListener listener;
private String jenkinsProjectName;
private List<Baseline> baselines;
private final TaskListener listener;
private final String jenkinsProjectName;
private final List<Baseline> baselines;

public PrepareWorkspace(Project project, List<Baseline> baselines, String jenkinsProjectName, TaskListener listener) {
this.project = project;
@@ -63,12 +63,15 @@ public SnapshotView invoke(File workspace, VirtualChannel channel) throws IOExce
out.println(ConfigurationRotator.LOGGERNAME + "Stream exists");

try {
view = new GetView(viewroot, viewtag).get();
/**
* FogBugz 11220, when we get the view, we must make sure that the view is present.
*/
view = new GetView(viewroot, viewtag).createIfAbsent().setStream(devStream).get();
} catch (ClearCaseException e) {
throw new IOException("Could not get view", e);
}
try {
Rebase rb = new Rebase(devStream);
Rebase rb = new Rebase(devStream);
out.println(ConfigurationRotator.LOGGERNAME + "Rebasing stream to " + devStream.getNormalizedName());
rb.setViewTag(viewtag).addBaselines(baselines).dropFromStream().rebase(true, true);
} catch (RebaseException e) {
@@ -99,6 +102,7 @@ public SnapshotView invoke(File workspace, VirtualChannel channel) throws IOExce
view = new GetView(viewroot, viewtag).setStream(devStream).createIfAbsent().get();
new UpdateView(view).setLoadRules(new SnapshotView.LoadRules(view, SnapshotView.Components.ALL)).generate().update();
} catch (ClearCaseException e) {
log.log(Level.WARNING, "Failed to update view, exception to follow", e);
throw new IOException("Unable to create view", e);
}
}

0 comments on commit c290f47

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