/** * @param checkoutdir the directory where the checkout will be done * @throws SVNException if the checkout could not be done */ public void checkout(File checkoutdir) throws SVNException { SVNUpdateClient upclient = new SVNUpdateClient(manager, svnOption); if (log.isDebugEnabled()) { log.debug("Do Checkout of " + remoteUrl); } upclient.doCheckout(remoteUrl, checkoutdir, SVNRevision.HEAD, SVNRevision.HEAD, SVNDepth.FILES, false); }
private static long checkout( SVNURL url , SVNRevision revision , File destPath , boolean isRecursive ) throws SVNException { SVNUpdateClient updateClient = ourClientManager.getUpdateClient( ); /* * sets externals not to be ignored during the checkout */ updateClient.setIgnoreExternals( false ); /* * returns the number of the revision at which the working copy is */ return updateClient.doCheckout( url , destPath , revision , revision , isRecursive );
/** * @param url * @param dstPath * @param pegRevision * @param revision * @param recursive * @param force * @return actual revision number * @throws SVNException * @deprecated use {@link #doCheckout(SVNURL, File, SVNRevision, SVNRevision, SVNDepth, boolean)} instead */ public long doCheckout(SVNURL url, File dstPath, SVNRevision pegRevision, SVNRevision revision, boolean recursive, boolean force) throws SVNException { return doCheckout(url, dstPath, pegRevision, revision, SVNDepth.fromRecurse(recursive), force); }
/** * @param url * @param dstPath * @param pegRevision * @param revision * @param recursive * @param force * @return actual revision number * @throws SVNException * @deprecated use {@link #doCheckout(SVNURL, File, SVNRevision, SVNRevision, SVNDepth, boolean)} instead */ public long doCheckout(SVNURL url, File dstPath, SVNRevision pegRevision, SVNRevision revision, boolean recursive, boolean force) throws SVNException { return doCheckout(url, dstPath, pegRevision, revision, SVNDepth.fromRecurse(recursive), force); }
/** * @param url * @param dstPath * @param pegRevision * @param revision * @param recursive * @param force * @return actual revision number * @throws SVNException * @deprecated use * {@link #doCheckout(SVNURL, File, SVNRevision, SVNRevision, SVNDepth, boolean)} * instead */ public long doCheckout(SVNURL url, File dstPath, SVNRevision pegRevision, SVNRevision revision, boolean recursive, boolean force) throws SVNException { return doCheckout(url, dstPath, pegRevision, revision, SVNDepth.fromRecurse(recursive), force); }
return doCheckout(url, dstPath, pegRevision, revision, SVNDepth.fromRecurse(recursive), false);
/** * Method description * * * @throws RepositoryClientException */ @Override public void checkout() throws RepositoryClientException { try { SVNUpdateClient updateClient = client.getUpdateClient(); updateClient.doCheckout(remoteRepositoryURL, localRepository, SVNRevision.UNDEFINED, SVNRevision.HEAD, SVNDepth.FILES, false); } catch (SVNException ex) { throw new RepositoryClientException(ex); } }
clnt.doCheckout(url, p.toFile(), revision, revision, SVNDepth.FILES, false); //IMMEDIATES, FILES, INFINITY
/** * Fetches the content from the SVN repository and creates the local working copy. * * @return the revision of the fetched content * * @throws IOException thrown if there is a problem checking out the content from the repository */ private SVNRevision checkoutResourceDirectory() throws IOException { try { final long newRevision = clientManager.getUpdateClient().doCheckout(remoteRepository, workingCopyDirectory, retrievalRevision, retrievalRevision, SVNDepth.INFINITY, true); log.debug( "Checked out revision {} from remote repository {} and stored it in local working directory {}", new Object[] {newRevision, remoteRepository.toDecodedString(), workingCopyDirectory.getAbsolutePath(),}); return SVNRevision.create(newRevision); } catch (final SVNException e) { final String errMsg = "Unable to check out revsion " + retrievalRevision.toString() + " from remote repository " + remoteRepository.toDecodedString() + " to local working directory " + workingCopyDirectory.getAbsolutePath(); log.error(errMsg, e); throw new IOException(errMsg, e); } }
/** * Fetches the content from the SVN repository and creates the local working copy. * * @return the revision of the fetched content * * @throws ResourceException thrown if there is a problem checking out the content from the repository */ private SVNRevision checkoutResourceDirectory() throws ResourceException { try { long newRevision = clientManager.getUpdateClient().doCheckout(remoteRepository, workingCopyDirectory, retrievalRevision, retrievalRevision, SVNDepth.INFINITY, true); log.debug( "Checked out revision {} from remote repository {} and stored it in local working directory {}", new Object[] { newRevision, remoteRepository.toDecodedString(), workingCopyDirectory.getAbsolutePath(), }); return SVNRevision.create(newRevision); } catch (SVNException e) { String errMsg = "Unable to check out revsion " + retrievalRevision.toString() + " from remote repository " + remoteRepository.toDecodedString() + " to local working directory " + workingCopyDirectory.getAbsolutePath(); log.error(errMsg, e); throw new ResourceException(errMsg, e); } }
public void checkout(FileNode dest, long revision) throws IOException, SVNException { checkDirectory(); dest.checkDirectory(); SVNUpdateClient client = getRoot().getClientMananger().getUpdateClient(); client.doCheckout(getSvnurl(), dest.toPath().toFile(), SVNRevision.UNDEFINED, SVNRevision.create(revision), SVNDepth.INFINITY, false); }
public long checkout(String moduleName, String destPath, Revision revision, Revision pegRevision, boolean recurse, boolean ignoreExternals) throws ClientException { SVNUpdateClient updater = getSVNUpdateClient(); boolean oldIgnoreExternals = updater.isIgnoreExternals(); updater.setIgnoreExternals(ignoreExternals); try { File path = new File(destPath).getAbsoluteFile(); return updater.doCheckout(SVNURL.parseURIEncoded(moduleName), path, JavaHLObjectFactory.getSVNRevision(pegRevision), JavaHLObjectFactory.getSVNRevision(revision), recurse); } catch (SVNException e) { throwException(e); } finally { updater.setIgnoreExternals(oldIgnoreExternals); } return -1; }
@Override public void switchToVersion(String version) throws Exception { Log.logInfoRB("SVN_START", "checkout to " + version); filesForCommit.clear(); SVNURL url = SVNURL.parseURIEncoded(SVNEncodingUtil.autoURIEncode(config.getUrl())); SVNRevision toRev; if (version != null) { toRev = SVNRevision.create(Long.parseLong(version)); } else { toRev = SVNRevision.HEAD; } try { ourClientManager.getUpdateClient().doCheckout(url, baseDirectory, SVNRevision.HEAD, toRev, SVNDepth.INFINITY, false); Log.logInfoRB("SVN_FINISH", "checkout"); } catch (Exception ex) { Log.logErrorRB("SVN_ERROR", "checkout", ex.getMessage()); checkNetworkException(ex); throw ex; } }
@Override public void reset() { SVNRepository repository = null; try { SVNRevision revision = SVNRevision.HEAD; SVNURL url = SVNURL.parseURIEncoded(path); repository = SVNRepositoryFactory.create(url); authenticateIfNecessary(repository); SVNClientManager ourClientManager = SVNClientManager.newInstance(null, repository.getAuthenticationManager()); SVNUpdateClient updateClient = ourClientManager.getUpdateClient(); updateClient.setIgnoreExternals(false); updateClient.doCheckout(url, new File(workingCopyPath), revision, revision, SVNDepth.INFINITY, true); } catch (Exception e) { throw new RuntimeException(e); } finally { if (repository != null) repository.closeSession(); } }
@Override public void checkout(String id) { SVNRepository repository = null; try { clearWorkingCopy(); SVNRevision revision = SVNRevision.create(Integer.parseInt(id)); SVNURL url = SVNURL.parseURIEncoded(path); repository = SVNRepositoryFactory.create(url); authenticateIfNecessary(repository); SVNClientManager ourClientManager = SVNClientManager.newInstance(null, repository.getAuthenticationManager()); SVNUpdateClient updateClient = ourClientManager.getUpdateClient(); updateClient.setIgnoreExternals(false); updateClient.doCheckout(url, new File(workingCopyPath), revision, revision, SVNDepth.INFINITY, true); } catch (Exception e) { throw new RuntimeException(e); } finally { if (repository != null) repository.closeSession(); } }
public long checkout(String moduleName, String destPath, Revision revision, Revision pegRevision, int depth, boolean ignoreExternals, boolean allowUnverObstructions) throws ClientException { SVNUpdateClient updater = getSVNUpdateClient(); boolean oldIgnoreExternals = updater.isIgnoreExternals(); updater.setIgnoreExternals(ignoreExternals); try { File path = new File(destPath).getAbsoluteFile(); return updater.doCheckout(SVNURL.parseURIEncoded(moduleName), path, JavaHLObjectFactory.getSVNRevision(pegRevision), JavaHLObjectFactory.getSVNRevision(revision), JavaHLObjectFactory.getSVNDepth(depth), allowUnverObstructions); } catch (SVNException e) { throwException(e); } finally { updater.setIgnoreExternals(oldIgnoreExternals); resetLog(); } return -1; }
public long checkout(String moduleName, String destPath, Revision revision, Revision pegRevision, int depth, boolean ignoreExternals, boolean allowUnverObstructions) throws ClientException { SVNUpdateClient updater = getSVNUpdateClient(); boolean oldIgnoreExternals = updater.isIgnoreExternals(); updater.setIgnoreExternals(ignoreExternals); try { File path = new File(destPath).getAbsoluteFile(); return updater.doCheckout(SVNURL.parseURIEncoded(moduleName), path, JavaHLObjectFactory.getSVNRevision(pegRevision), JavaHLObjectFactory.getSVNRevision(revision), JavaHLObjectFactory.getSVNDepth(depth), allowUnverObstructions); } catch (SVNException e) { throwException(e); } finally { updater.setIgnoreExternals(oldIgnoreExternals); resetLog(); } return -1; }
public long checkout(String moduleName, String destPath, Revision revision, Revision pegRevision, int depth, boolean ignoreExternals, boolean allowUnverObstructions) throws ClientException { SVNUpdateClient updater = getSVNUpdateClient(); boolean oldIgnoreExternals = updater.isIgnoreExternals(); updater.setIgnoreExternals(ignoreExternals); try { File path = new File(destPath).getAbsoluteFile(); return updater.doCheckout(SVNURL.parseURIEncoded(moduleName), path, JavaHLObjectFactory.getSVNRevision(pegRevision), JavaHLObjectFactory.getSVNRevision(revision), JavaHLObjectFactory.getSVNDepth(depth), allowUnverObstructions); } catch (SVNException e) { throwException(e); } finally { updater.setIgnoreExternals(oldIgnoreExternals); resetLog(); } return -1; }
SVNURL svnurl = SVNURL.parseURIDecoded(url); SVNRepository repository = SVNRepositoryFactory.create(svnurl); ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(uname, password); repository.setAuthenticationManager(authManager); SVNClientManager ourClientManager = SVNClientManager.newInstance(); ourClientManager.setAuthenticationManager(authManager); SVNUpdateClient updateClient = ourClientManager.getUpdateClient(); updateClient.setIgnoreExternals(true); long latestRevision = repository.getLatestRevision(); if (updateClient.doCheckout(svnurl, destinationDir, SVNRevision.HEAD, SVNRevision.HEAD, SVNDepth.INFINITY, allowUnversionedObstructions) == latestRevision) { ourClientManager.dispose(); }
@Override public void checkout(Version tag, boolean recurse) throws VCSException { try { if (fireAction(VCSActionEvent.CHECKOUT, getLocalRepository())) { String tagPath = "/trunk/"; if (tag != null) { tagPath = "/tags/" + tag + "/"; } SVNURL source = getRemoteURL().appendPath(tagPath, false); File destDir = getLocalRepository(); destDir.mkdirs(); SVNUpdateClient updateClient = getSVNManager() .getUpdateClient(); long newRevision = updateClient.doCheckout(source, // SVNURL url destDir, // File dstPath null, // SVNRevision pegRevision SVNRevision.HEAD, // SVNRevision revision SVNDepth.INFINITY, // SVNDepth depth true); // boolean allowUnversionedObstructions if (log.isInfoEnabled()) { log.info(t("isisfish.vcs.vcssvn.global.torevision", newRevision)); } } } catch (SVNException eee) { throw new VCSException(t("isisfish.vcs.vcssvn.checkout.error"), eee); } }