Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-4547] Subversion checkout directory is now expanded (b…
…ased on build paramaters and global env variables)
  • Loading branch information
rseguy committed Sep 2, 2011
1 parent 2415429 commit 99c78ce
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/main/java/hudson/scm/SubversionSCM.java
Expand Up @@ -2288,6 +2288,21 @@ private String getExpandedRemote(AbstractBuild<?,?> build) {
return outRemote;
}

/**
* @deprecated This method is used by {@link #getExpandedLocation(AbstractBuild)}
* which is deprecated since it expands variables only based
* on build parameters.
*/
private String getExpandedLocalDir(AbstractBuild<?,?> build) {
String outLocalDir = getLocalDir();

ParametersAction parameters = build.getAction(ParametersAction.class);
if (parameters != null)
outLocalDir = parameters.substitute(build, getLocalDir());

return outLocalDir;
}

/**
* Expand location value based on Build parametric execution.
*
Expand All @@ -2297,7 +2312,7 @@ private String getExpandedRemote(AbstractBuild<?,?> build) {
* to be performed on all env vars rather than just build parameters.
*/
public ModuleLocation getExpandedLocation(AbstractBuild<?, ?> build) {
return new ModuleLocation(getExpandedRemote(build), getLocalDir());
return new ModuleLocation(getExpandedRemote(build), getExpandedLocalDir(build));
}

/**
Expand All @@ -2306,7 +2321,7 @@ public ModuleLocation getExpandedLocation(AbstractBuild<?, ?> build) {
* @return Output ModuleLocation expanded according to specified env vars.
*/
public ModuleLocation getExpandedLocation(EnvVars env) {
return new ModuleLocation(env.expand(remote), getLocalDir());
return new ModuleLocation(env.expand(remote), env.expand(getLocalDir()));
}

@Override
Expand Down

0 comments on commit 99c78ce

Please sign in to comment.