public void exportFromSvn(SVNClientManager clientManager) throws SVNException { SVNUpdateClient updateClient = clientManager.getUpdateClient(); SVNURL url = SVNURL.parseURIDecoded("<svn url to export from>"); //destination path File dstPath = new File("LocalDirNew"); //the revision number which should be looked upon for the file path SVNRevision pegRevision = SVNRevision.create(<right svn revision number>); //the revision number which is required to be exported. SVNRevision revision = SVNRevision.create(<right svn revision number>); //if there is any special character for end of line (in the file) then it is required. For our use case, //it can be null, assuming there are no special characters. In this case the OS specific EoF style will //be assumed String eolStyle = null; //this would force the operation boolean force = true; //Till what extent under a directory, export is required, is determined by depth. INFINITY means the whole subtree of that directory will be exported SVNDepth recursive = SVNDepth.INFINITY; updateClient.doExport(url, dstPath, pegRevision, revision, eolStyle, force, recursive ); }
protected SVNUpdateClient getSVNUpdateClient() { return getClientManager().getUpdateClient(); }
protected SVNUpdateClient getSVNUpdateClient() { return getClientManager().getUpdateClient(); }
protected SVNUpdateClient getSVNUpdateClient() { return getClientManager().getUpdateClient(); }
protected SVNUpdateClient getSVNUpdateClient(){ return getClientManager().getUpdateClient(); }
public SVNUpdateClient getUpdateClient() { return wrapUp(core.getUpdateClient()); }
public static long export( SVNClientManager clientManager, SVNURL url, SVNRevision revision, File destPath, boolean isRecursive ) throws SVNException { SVNUpdateClient updateClient = clientManager.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.doExport( url, destPath, revision, revision, "native", true, isRecursive ); }
/** * 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); } }
/** * Updates an existing local working copy from the repository. * * @return the revision of the fetched content * * @throws IOException thrown if there is a problem updating the working copy */ private SVNRevision updateResourceDirectory() throws IOException { try { final long newRevision = clientManager.getUpdateClient().doUpdate(workingCopyDirectory, retrievalRevision, SVNDepth.INFINITY, true, true); log.debug("Updated local working directory {} to revision {} from remote repository {}", new Object[] { workingCopyDirectory.getAbsolutePath(), newRevision, remoteRepository.toDecodedString(),}); return SVNRevision.create(newRevision); } catch (final SVNException e) { final String errMsg = "Unable to update working copy of resoure " + remoteRepository.toDecodedString() + " in working copy " + workingCopyDirectory.getAbsolutePath() + " to revsion " + retrievalRevision.toString(); 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 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); } }
throws SVNException SVNUpdateClient updateClient = clientManager.getUpdateClient();
/** * Updates an existing local working copy from the repository. * * @return the revision of the fetched content * * @throws ResourceException thrown if there is a problem updating the working copy */ private SVNRevision updateResourceDirectory() throws ResourceException { try { long newRevision = clientManager.getUpdateClient().doUpdate(workingCopyDirectory, retrievalRevision, SVNDepth.INFINITY, true, true); log.debug("Updated local working directory {} to revision {} from remote repository {}", new Object[] { workingCopyDirectory.getAbsolutePath(), newRevision, remoteRepository.toDecodedString(), }); return SVNRevision.create(newRevision); } catch (SVNException e) { String errMsg = "Unable to update working copy of resoure " + remoteRepository.toDecodedString() + " in working copy " + workingCopyDirectory.getAbsolutePath() + " to revsion " + retrievalRevision.toString(); log.error(errMsg, e); throw new ResourceException(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); }
@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(); } }
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); } }
SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CL_INSUFFICIENT_ARGS), SVNLogType.CLIENT); SVNUpdateClient client = getSVNEnvironment().getClientManager().getUpdateClient(); if (targets.size() == 1 || (targets.size() == 2