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 );
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 ); }
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; }
updateClient.setIgnoreExternals( false );
public long doExport(String srcPath, String destPath, Revision revision, Revision pegRevision, boolean force, boolean ignoreExternals, boolean recurse, String nativeEOL) throws ClientException { SVNUpdateClient updater = getSVNUpdateClient(); boolean oldIgnore = updater.isIgnoreExternals(); updater.setIgnoreExternals(ignoreExternals); try { if(isURL(srcPath)){ return updater.doExport(SVNURL.parseURIEncoded(srcPath), new File(destPath).getAbsoluteFile(), JavaHLObjectFactory.getSVNRevision(pegRevision), JavaHLObjectFactory.getSVNRevision(revision), nativeEOL, force, recurse); } return updater.doExport(new File(srcPath).getAbsoluteFile(), new File(destPath).getAbsoluteFile(), JavaHLObjectFactory.getSVNRevision(pegRevision), JavaHLObjectFactory.getSVNRevision(revision), nativeEOL, force, recurse); } catch (SVNException e) { throwException(e); } finally { updater.setIgnoreExternals(oldIgnore); } 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[] update(String[] path, Revision revision, boolean recurse, boolean ignoreExternals) throws ClientException { if(path == null || path.length == 0){ return new long[]{}; } long[] updated = new long[path.length]; SVNUpdateClient updater = getSVNUpdateClient(); boolean oldIgnore = updater.isIgnoreExternals(); updater.setIgnoreExternals(ignoreExternals); updater.setEventPathPrefix(""); try { for (int i = 0; i < updated.length; i++) { updated[i] = update(path[i], revision, recurse); } } finally { updater.setIgnoreExternals(oldIgnore); updater.setEventPathPrefix(null); SVNFileUtil.sleepForTimestamp(); } return updated; }
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 doExport(String srcPath, String destPath, Revision revision, Revision pegRevision, boolean force, boolean ignoreExternals, int depth, String nativeEOL) throws ClientException { SVNUpdateClient updater = getSVNUpdateClient(); boolean oldIgnore = updater.isIgnoreExternals(); updater.setIgnoreExternals(ignoreExternals); try { if (isURL(srcPath)) { return updater.doExport(SVNURL.parseURIEncoded(srcPath), new File(destPath).getAbsoluteFile(), JavaHLObjectFactory.getSVNRevision(pegRevision), JavaHLObjectFactory.getSVNRevision(revision), nativeEOL, force, JavaHLObjectFactory.getSVNDepth(depth)); } return updater.doExport(new File(srcPath).getAbsoluteFile(), new File(destPath).getAbsoluteFile(), JavaHLObjectFactory.getSVNRevision(pegRevision), JavaHLObjectFactory.getSVNRevision(revision), nativeEOL, force, JavaHLObjectFactory.getSVNDepth(depth)); } catch (SVNException e) { throwException(e); } finally { updater.setIgnoreExternals(oldIgnore); resetLog(); } return -1; }
public long doExport(String srcPath, String destPath, Revision revision, Revision pegRevision, boolean force, boolean ignoreExternals, int depth, String nativeEOL) throws ClientException { SVNUpdateClient updater = getSVNUpdateClient(); boolean oldIgnore = updater.isIgnoreExternals(); updater.setIgnoreExternals(ignoreExternals); try { if (isURL(srcPath)) { return updater.doExport(SVNURL.parseURIEncoded(srcPath), new File(destPath).getAbsoluteFile(), JavaHLObjectFactory.getSVNRevision(pegRevision), JavaHLObjectFactory.getSVNRevision(revision), nativeEOL, force, JavaHLObjectFactory.getSVNDepth(depth)); } return updater.doExport(new File(srcPath).getAbsoluteFile(), new File(destPath).getAbsoluteFile(), JavaHLObjectFactory.getSVNRevision(pegRevision), JavaHLObjectFactory.getSVNRevision(revision), nativeEOL, force, JavaHLObjectFactory.getSVNDepth(depth)); } catch (SVNException e) { throwException(e); } finally { updater.setIgnoreExternals(oldIgnore); resetLog(); } return -1; }
public long doExport(String srcPath, String destPath, Revision revision, Revision pegRevision, boolean force, boolean ignoreExternals, int depth, String nativeEOL) throws ClientException { SVNUpdateClient updater = getSVNUpdateClient(); boolean oldIgnore = updater.isIgnoreExternals(); updater.setIgnoreExternals(ignoreExternals); try { if (isURL(srcPath)) { return updater.doExport(SVNURL.parseURIEncoded(srcPath), new File(destPath).getAbsoluteFile(), JavaHLObjectFactory.getSVNRevision(pegRevision), JavaHLObjectFactory.getSVNRevision(revision), nativeEOL, force, JavaHLObjectFactory.getSVNDepth(depth)); } return updater.doExport(new File(srcPath).getAbsoluteFile(), new File(destPath).getAbsoluteFile(), JavaHLObjectFactory.getSVNRevision(pegRevision), JavaHLObjectFactory.getSVNRevision(revision), nativeEOL, force, JavaHLObjectFactory.getSVNDepth(depth)); } catch (SVNException e) { throwException(e); } finally { updater.setIgnoreExternals(oldIgnore); resetLog(); } return -1; }
/** * Returns an instance of the {@link SVNUpdateClient} class. * * <p> * If it's the first time this method is being called the object is * created, initialized and then returned. Further calls to this * method will get the same object instantiated at that moment of * the first call. <b>SVNClientManager</b> does not reinstantiate * its <b>SVN</b>*<b>Client</b> objects. * * @return an <b>SVNUpdateClient</b> instance */ public SVNUpdateClient getUpdateClient() { if (myUpdateClient == null) { myUpdateClient = new SVNUpdateClient(this, myOptions); myUpdateClient.setEventHandler(myEventHandler); myUpdateClient.setDebugLog(getDebugLog()); myUpdateClient.setIgnoreExternals(myIsIgnoreExternals); } return myUpdateClient; }
public long[] update(String[] path, Revision revision, int depth, boolean depthIsSticky, boolean ignoreExternals, boolean allowUnverObstructions) throws ClientException { if (path == null || path.length == 0) { return new long[]{}; } long[] updated = new long[path.length]; SVNUpdateClient updater = getSVNUpdateClient(); boolean oldIgnore = updater.isIgnoreExternals(); updater.setIgnoreExternals(ignoreExternals); updater.setEventPathPrefix(""); SVNDepth svnDepth = JavaHLObjectFactory.getSVNDepth(depth); SVNRevision rev = JavaHLObjectFactory.getSVNRevision(revision); try { for (int i = 0; i < updated.length; i++) { updated[i] = updater.doUpdate(new File(path[i]).getAbsoluteFile(), rev, svnDepth, allowUnverObstructions, depthIsSticky); } } catch (SVNException e) { throwException(e); } finally { updater.setIgnoreExternals(oldIgnore); updater.setEventPathPrefix(null); resetLog(); SVNFileUtil.sleepForTimestamp(); } return updated; }
/** * Returns an instance of the {@link SVNUpdateClient} class. * * <p> * If it's the first time this method is being called the object is * created, initialized and then returned. Further calls to this * method will get the same object instantiated at that moment of * the first call. <b>SVNClientManager</b> does not reinstantiate * its <b>SVN</b>*<b>Client</b> objects. * * @return an <b>SVNUpdateClient</b> instance */ public SVNUpdateClient getUpdateClient() { if (myUpdateClient == null) { myUpdateClient = new SVNUpdateClient(this, myOptions); myUpdateClient.setEventHandler(myEventHandler); myUpdateClient.setDebugLog(getDebugLog()); myUpdateClient.setIgnoreExternals(myIsIgnoreExternals); } return myUpdateClient; }
public long[] update(String[] path, Revision revision, int depth, boolean depthIsSticky, boolean ignoreExternals, boolean allowUnverObstructions) throws ClientException { if (path == null || path.length == 0) { return new long[]{}; } long[] updated = new long[path.length]; SVNUpdateClient updater = getSVNUpdateClient(); boolean oldIgnore = updater.isIgnoreExternals(); updater.setIgnoreExternals(ignoreExternals); updater.setEventPathPrefix(""); SVNDepth svnDepth = JavaHLObjectFactory.getSVNDepth(depth); SVNRevision rev = JavaHLObjectFactory.getSVNRevision(revision); try { for (int i = 0; i < updated.length; i++) { updated[i] = updater.doUpdate(new File(path[i]).getAbsoluteFile(), rev, svnDepth, allowUnverObstructions, depthIsSticky); } } catch (SVNException e) { throwException(e); } finally { updater.setIgnoreExternals(oldIgnore); updater.setEventPathPrefix(null); resetLog(); SVNFileUtil.sleepForTimestamp(); } return updated; }
public long[] update(String[] path, Revision revision, int depth, boolean depthIsSticky, boolean ignoreExternals, boolean allowUnverObstructions) throws ClientException { if (path == null || path.length == 0) { return new long[]{}; } long[] updated = new long[path.length]; SVNUpdateClient updater = getSVNUpdateClient(); boolean oldIgnore = updater.isIgnoreExternals(); updater.setIgnoreExternals(ignoreExternals); updater.setEventPathPrefix(""); SVNDepth svnDepth = JavaHLObjectFactory.getSVNDepth(depth); SVNRevision rev = JavaHLObjectFactory.getSVNRevision(revision); try { for (int i = 0; i < updated.length; i++) { updated[i] = updater.doUpdate(new File(path[i]).getAbsoluteFile(), rev, svnDepth, allowUnverObstructions, depthIsSticky); } } catch (SVNException e) { throwException(e); } finally { updater.setIgnoreExternals(oldIgnore); updater.setEventPathPrefix(null); resetLog(); SVNFileUtil.sleepForTimestamp(); } return updated; }
@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(); }