Skip to content

Commit

Permalink
Do not add a SCMRevisionState of type MultiSCMRevisionState
Browse files Browse the repository at this point in the history
to the MultiSCMRevisionState variable associated with the overal job.

When a MultiSCM.checkout() is done, the list of SCMs is iterated
over.  For each SCM in the list, we obtain the SCMRevisionState
for that SCM and pass it down to the checkout() method for each SCM.
For a Subversion checkout, the Subversion plugin
downcasts the revision revision state to SVNRevisionState.

Without this fix, a revision state of type MultiSCMRevisionState
was being passed down into the Subversion plugin.  This was
causing a ClassCastException to be thrown.

[FIXED JENKINS-26303]
  • Loading branch information
rodrigc committed Mar 8, 2015
1 parent 54e1c28 commit 1e7d7bd
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -115,11 +115,15 @@ public void checkout(Run<?, ?> build, Launcher launcher,

for(SCM scm : scms) {
File subChangeLog = changelogFile != null ? new File(changelogFile.getPath() + ".temp") : null;
scm.checkout(build, launcher, workspace, listener, subChangeLog, oldBaseline != null ? oldBaseline.get(scm, workspace, build instanceof AbstractBuild ? (AbstractBuild) build : null) : null);
SCMRevisionState workspaceRevision = null;
if (oldBaseline != null) {
workspaceRevision = oldBaseline.get(scm, workspace, build instanceof AbstractBuild ? (AbstractBuild) build : null);
}
scm.checkout(build, launcher, workspace, listener, subChangeLog, workspaceRevision);

List<Action> actions = build.getActions();
for(Action a : actions) {
if(!scmActions.contains(a) && a instanceof SCMRevisionState) {
if(!scmActions.contains(a) && a instanceof SCMRevisionState && !(a instanceof MultiSCMRevisionState)) {
scmActions.add(a);
revisionState.add(scm, workspace, build, (SCMRevisionState) a);
}
Expand Down

0 comments on commit 1e7d7bd

Please sign in to comment.