Skip to content

Commit

Permalink
[JENKINS-26458] Guard against a workspace format of 100.
Browse files Browse the repository at this point in the history
  • Loading branch information
christ66 committed Jul 19, 2015
1 parent ad260ce commit 7fd8a5a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/hudson/scm/subversion/CheckoutUpdater.java
Expand Up @@ -39,6 +39,7 @@
import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.internal.util.DefaultSVNDebugLogger;
import org.tmatesoft.svn.core.internal.wc17.db.ISVNWCDb;
import org.tmatesoft.svn.core.internal.wc2.compat.SvnCodec;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc.SVNUpdateClient;
Expand Down Expand Up @@ -109,6 +110,11 @@ public List<External> perform() throws IOException, InterruptedException {
checkout.setIgnoreExternals(location.isIgnoreExternalsOption());
checkout.setExternalsHandler(SvnCodec.externalsHandler(svnuc.getExternalsHandler()));

// Statement to guard against JENKINS-26458.
if (SubversionWorkspaceSelector.workspaceFormat == 100) {
SubversionWorkspaceSelector.workspaceFormat = ISVNWCDb.WC_FORMAT_17;
}

// Workaround for SVNKIT-430 is to set the working copy format when
// a checkout is performed.
checkout.setTargetWorkingCopyFormat(SubversionWorkspaceSelector.workspaceFormat);
Expand Down
7 changes: 7 additions & 0 deletions src/test/java/hudson/scm/SVNWorkingCopyTest.java
Expand Up @@ -29,6 +29,7 @@
import hudson.model.queue.QueueTaskFuture;
import hudson.scm.subversion.WorkspaceUpdater;
import hudson.scm.subversion.WorkspaceUpdaterDescriptor;
import org.jvnet.hudson.test.Issue;
import org.tmatesoft.svn.core.internal.wc.SVNStatusUtil;
import org.tmatesoft.svn.core.internal.wc.admin.*;
import org.tmatesoft.svn.core.internal.wc17.db.ISVNWCDb;
Expand Down Expand Up @@ -69,6 +70,12 @@ public void testCheckoutWorkingCopyFormat18() throws Exception {
checkoutAndVerifyWithFormat(ISVNWCDb.WC_FORMAT_18);
}

@Issue("JENKINS-26458")
public void testCheckoutWorkingCopyFormat100() throws Exception {
assertEquals("Working copy of 100 should checkout 1.7",
ISVNWCDb.WC_FORMAT_17, checkoutWithFormat(100));
}

private void checkoutAndVerifyWithFormat(int format) throws Exception {
assertEquals("Checkout and workspace format do not match", format, checkoutWithFormat(format));
}
Expand Down

0 comments on commit 7fd8a5a

Please sign in to comment.