Skip to content

Commit 1178ed2

Browse files
committed
swapping order of param substitution when getting effective client name so build parameters are properly evaluated
1 parent 5707a77 commit 1178ed2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/hudson/plugins/perforce/PerforceSCM.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1713,20 +1713,20 @@ private String getEffectiveClientName(AbstractBuild build, Map<String,String> en
17131713
Node buildNode = build.getBuiltOn();
17141714
FilePath workspace = build.getWorkspace();
17151715
String p4Client = this.p4Client;
1716-
p4Client = MacroStringHelper.substituteParameters(p4Client, build, env);
17171716
try {
17181717
p4Client = getEffectiveClientName(p4Client, buildNode);
17191718
} catch (Exception e) {
17201719
new StreamTaskListener(System.out).getLogger().println(
17211720
"Could not get effective client name: " + e.getMessage());
17221721
}
1722+
p4Client = MacroStringHelper.substituteParameters(p4Client, build, env);
17231723
return p4Client;
17241724
}
17251725

17261726
private String getDefaultEffectiveClientName(AbstractProject project, Node buildNode, FilePath workspace)
17271727
throws IOException, InterruptedException {
1728-
String basename = MacroStringHelper.substituteParametersNoCheck(this.p4Client, getDefaultSubstitutions(project));
1729-
return getEffectiveClientName(basename, buildNode);
1728+
String basename = getEffectiveClientName(this.p4Client, buildNode);
1729+
return MacroStringHelper.substituteParametersNoCheck(basename, getDefaultSubstitutions(project));
17301730
}
17311731

17321732
private String getEffectiveClientName(String basename, Node buildNode)

0 commit comments

Comments
 (0)