Skip to content
Closed
Changes from all 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: 6 additions & 0 deletions src/main/java/hudson/scm/SubversionSCM.java
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ public void buildEnvVars(AbstractBuild<?, ?> build, Map<String, String> env) {
try {
Map<String,Long> revisions = parseSvnRevisionFile(build);
Set<String> knownURLs = revisions.keySet();
Long revHighest = new Long(0);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Use long instead of Long

if(svnLocations.length==1) {
// for backwards compatibility if there's only a single modulelocation, we also set
// SVN_REVISION and SVN_URL without '_n'
Expand All @@ -685,6 +686,7 @@ public void buildEnvVars(AbstractBuild<?, ?> build, Map<String, String> env) {
if(rev!=null) {
env.put("SVN_REVISION",rev.toString());
env.put("SVN_URL",url);
revHighest = rev;
} else if (!knownURLs.isEmpty()) {
LOGGER.log(WARNING, "no revision found corresponding to {0}; known: {1}", new Object[] {url, knownURLs});
}
Expand All @@ -696,10 +698,14 @@ public void buildEnvVars(AbstractBuild<?, ?> build, Map<String, String> env) {
if(rev!=null) {
env.put("SVN_REVISION_"+(i+1),rev.toString());
env.put("SVN_URL_"+(i+1),url);
if (rev > revHighest) {
revHighest = rev;
}
} else if (!knownURLs.isEmpty()) {
LOGGER.log(WARNING, "no revision found corresponding to {0}; known: {1}", new Object[] {url, knownURLs});
}
}
env.put("SVN_REVISION_HIGHEST", revHighest.toString());

} catch (IOException e) {
LOGGER.log(WARNING, "error building environment variables", e);
Expand Down