Skip to content

Commit

Permalink
Merge pull request #952 from wolfgarnet/master
Browse files Browse the repository at this point in the history
[fixed JENKINS-19740] Added postCheckout for SCMs
  • Loading branch information
vjuranek committed Sep 27, 2013
2 parents 69ba2b8 + e4ba0b3 commit 4d352ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/main/java/hudson/model/AbstractBuild.java
Expand Up @@ -667,6 +667,10 @@ public void defaultCheckout() throws IOException, InterruptedException {
} catch (Exception e) {
throw new IOException2("Failed to parse changelog",e);
}

// Get a chance to do something after checkout and changelog is done
scm.postCheckout( build, launcher, build.getWorkspace(), listener );

return;
}
} catch (AbortException e) {
Expand Down
7 changes: 7 additions & 0 deletions core/src/main/java/hudson/scm/SCM.java
Expand Up @@ -420,6 +420,13 @@ private boolean is1_346OrLater() {
*/
public abstract boolean checkout(AbstractBuild<?,?> build, Launcher launcher, FilePath workspace, BuildListener listener, File changelogFile) throws IOException, InterruptedException;

/**
* Get a chance to do operations after the workspace i checked out and the changelog is written.
*/
public void postCheckout(AbstractBuild<?,?> build, Launcher launcher, FilePath workspace, BuildListener listener) throws IOException, InterruptedException {
/* Default implementation is noop */
}

/**
* Adds environmental variables for the builds to the given map.
*
Expand Down

0 comments on commit 4d352ab

Please sign in to comment.