Skip to content

Commit

Permalink
Merge pull request #182 from abayer/jenkins-26100
Browse files Browse the repository at this point in the history
[JENKINS-26100] Change buildEnvVars to Run.
  • Loading branch information
abayer committed Jun 16, 2017
2 parents 1ba2176 + e2b8bb4 commit 0613ef3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/java/hudson/scm/SubversionSCM.java
Expand Up @@ -665,13 +665,17 @@ public boolean isFilterChangelog() {
return filterChangelog;
}

// TODO: 2.60+ Delete this override.
@Override
public void buildEnvVars(AbstractBuild<?,?> build, Map<String,String> env) {
buildEnvironment(build, env);
}

/**
* TODO: 2.60+ - add @Override.
* Sets the <tt>SVN_REVISION_n</tt> and <tt>SVN_URL_n</tt> environment variables during the build.
*/
@Override
public void buildEnvVars(AbstractBuild<?, ?> build, Map<String, String> env) {
super.buildEnvVars(build, env);

public void buildEnvironment(Run<?, ?> build, Map<String, String> env) {
ModuleLocation[] svnLocations = getLocations(new EnvVars(env), build);

try {
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/hudson/scm/SubversionSCMUnitTest.java
Expand Up @@ -10,6 +10,7 @@
import hudson.EnvVars;
import hudson.FilePath;
import hudson.model.AbstractBuild;
import hudson.model.Run;
import hudson.remoting.VirtualChannel;
import hudson.scm.SubversionSCM.ModuleLocation;

Expand Down Expand Up @@ -108,6 +109,7 @@ public void shouldSetEnvironmentVariablesWithMultipleSvnModules() throws IOExcep
private SubversionSCM mockSCMForBuildEnvVars() {
SubversionSCM scm = mock(SubversionSCM.class);
doCallRealMethod().when(scm).buildEnvVars(any(AbstractBuild.class), anyMapOf(String.class, String.class));
doCallRealMethod().when(scm).buildEnvironment(any(Run.class), anyMapOf(String.class, String.class));
return scm;
}
}

0 comments on commit 0613ef3

Please sign in to comment.