Skip to content

Commit

Permalink
Do integration on the first module regardless of the number of module…
Browse files Browse the repository at this point in the history
…s defined and the "Ignore externals" option (see [JENKINS-26280])
  • Loading branch information
hugueschabot committed Jan 10, 2015
1 parent e33bc18 commit 8eddd8f
Showing 1 changed file with 17 additions and 24 deletions.
41 changes: 17 additions & 24 deletions src/main/java/jenkins/plugins/svnmerge/IntegrateAction.java
Expand Up @@ -134,33 +134,26 @@ public SvnInfo getSvnInfo() {
if (!(scm instanceof SubversionSCM)) {
return null;
}

// TODO: check for multiple locations ?
SubversionSCM svn = (SubversionSCM) scm;
ModuleLocation[] locations = svn.getLocations();
if (locations.length == 1) {
TaskListener listener = new LogTaskListener(LOGGER, WARNING);
ModuleLocation firstLocation = svn.getLocations()[0];
// expand system and node environment variables as well as the
// project parameters
firstLocation = Utility.getExpandedLocation(firstLocation,
getProject());
if (!firstLocation.isIgnoreExternalsOption()) {
try {
SVNRevisionState state = build.getAction(SVNRevisionState.class);
long revision = state.getRevision(firstLocation.getURL());

return new SvnInfo(firstLocation.getSVNURL().toDecodedString(), revision);
} catch (SVNException e) {
LOGGER.log(WARNING, "Could not get SVN URL and revision", e);
} catch (IOException e) {
LOGGER.log(WARNING, "Could not get SVN URL and revision", e);
} catch (InterruptedException e) {
LOGGER.log(WARNING, "Could not get SVN URL and revision", e);
}
}
}

return null; // can't handle more than 1 URLs

ModuleLocation firstLocation = svn.getLocations()[0];
// expand system and node environment variables as well as the
// project parameters
firstLocation = Utility.getExpandedLocation(firstLocation, getProject());

try {
SVNRevisionState state = build.getAction(SVNRevisionState.class);
long revision = state.getRevision(firstLocation.getURL());

return new SvnInfo(firstLocation.getSVNURL().toDecodedString(), revision);
} catch (SVNException e) {
LOGGER.log(WARNING, "Could not get SVN URL and revision", e);
}

return null;
}

/**
Expand Down

0 comments on commit 8eddd8f

Please sign in to comment.