Skip to content

Commit

Permalink
[FIXED JENKINS-14116] Update to older revision
Browse files Browse the repository at this point in the history
Added check to generation of change set between previous workspace
(prevRev) and current workspace (thisRev) to correctly handle case when
prevRev > thisRev. Change set covers commits [prevRev+1, thisRev], which
is backwards when updating to an older revision, resulting in an
incorrect summary and, if prevRev=HEAD, throwing exceptions and failing
the build since HEAD+1 does not exist. Solution: if prevRev > thisRev,
swap values before generating change set.
  • Loading branch information
gmjck committed Aug 22, 2012
1 parent 7f594bc commit 9a460b8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/hudson/scm/SubversionChangeLogBuilder.java
Expand Up @@ -151,6 +151,13 @@ private boolean buildModule(String url, SVNLogClient svnlc, SVNXMLLogHandler log
return false;
}

// handle case where previous workspace revision is newer than this revision
if (prevRev.compareTo(thisRev) > 0) {
long temp = thisRev.longValue();
thisRev = new Long(prevRev.longValue());
prevRev = new Long(temp);
}

try {
if(debug)
listener.getLogger().printf("Computing changelog of %1s from %2s to %3s\n",
Expand Down

0 comments on commit 9a460b8

Please sign in to comment.