SubversionUpdateEventHandler eventHandler = new SubversionUpdateEventHandler(new PrintStream(pos), externals, local, location.getLocalDir());
svnuc.setEventHandler(eventHandler);
svnuc.setExternalsHandler(eventHandler);
svnuc.setIgnoreExternals(location.isIgnoreExternalsOption());
SVNDepth svnDepth = getSvnDepth(location.getDepthOption());
SvnCheckout checkout = svnuc.getOperationsFactory().createCheckout();
checkout.setSource(SvnTarget.fromURL(location.getSVNURL(), SVNRevision.HEAD));
checkout.setSingleTarget(SvnTarget.fromFile(local.getCanonicalFile()));
checkout.setDepth(svnDepth);
checkout.setRevision(r);
checkout.setAllowUnversionedObstructions(true);
checkout.setIgnoreExternals(location.isIgnoreExternalsOption());
checkout.setExternalsHandler(SvnCodec.externalsHandler(svnuc.getExternalsHandler()));
// Workaround for SVNKIT-430 is to set the working copy format when
// a checkout is performed.
checkout.setTargetWorkingCopyFormat(SubversionWorkspaceSelector.workspaceFormat);
checkout.run();
} catch (SVNCancelException e) {
if (isAuthenticationFailedError(e)) {
e.printStackTrace(listener.error("Failed to check out " + location.remote));
return null;
} else {