Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/main/java/hudson/scm/SubversionSCM.java
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ public boolean isFilterChangelog() {
public void buildEnvVars(AbstractBuild<?, ?> build, Map<String, String> env) {
super.buildEnvVars(build, env);

ModuleLocation[] svnLocations = getLocations(build);
ModuleLocation[] svnLocations = getLocations(new EnvVars(EnvVars.masterEnvVars), build);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this is wrong, because getLocations ignores build when env is set. Need to consider both combined.


try {
Map<String,Long> revisions = parseSvnRevisionFile(build);
Expand Down Expand Up @@ -1955,6 +1955,8 @@ public FormValidation doCheckRemote(StaplerRequest req, @AncestorInPath Abstract

if(isValidateRemoteUpToVar()) {
url = (url.indexOf('$') != -1) ? url.substring(0, url.indexOf('$')) : url;
} else {
url = new EnvVars(EnvVars.masterEnvVars).expand(url);
}

if(!URL_PATTERN.matcher(url).matches())
Expand Down Expand Up @@ -2169,7 +2171,7 @@ public FormValidation doCheckRevisionPropertiesSupported(@AncestorInPath Abstrac
return FormValidation.ok();

try {
SVNURL repoURL = SVNURL.parseURIDecoded(v);
SVNURL repoURL = SVNURL.parseURIDecoded(new EnvVars(EnvVars.masterEnvVars).expand(v));
if (checkRepositoryPath(context,repoURL)!=SVNNodeKind.NONE)
// something exists
return FormValidation.ok();
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/hudson/scm/SubversionSCMUnitTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void shouldSetEnvironmentVariablesWithSingleSvnModule() throws IOExceptio
SubversionSCM scm = mockSCMForBuildEnvVars();

ModuleLocation[] singleLocation = new ModuleLocation[] {new ModuleLocation("/remotepath", "")};
when(scm.getLocations(any(AbstractBuild.class))).thenReturn(singleLocation);
when(scm.getLocations(any(EnvVars.class), any(AbstractBuild.class))).thenReturn(singleLocation);

Map<String, Long> revisions = new HashMap<String, Long>();
revisions.put("/remotepath", 4711L);
Expand Down Expand Up @@ -83,7 +83,7 @@ public void shouldSetEnvironmentVariablesWithMultipleSvnModules() throws IOExcep
ModuleLocation[] locations = new ModuleLocation[] {
new ModuleLocation("/remotepath1", ""),
new ModuleLocation("/remotepath2", "")};
when(scm.getLocations(any(AbstractBuild.class))).thenReturn(locations);
when(scm.getLocations(any(EnvVars.class), any(AbstractBuild.class))).thenReturn(locations);

Map<String, Long> revisions = new HashMap<String, Long>();
revisions.put("/remotepath1", 4711L);
Expand Down