/** * Cleans up a working copy. * This method is equivalent to a call to <code>doCleanup(path, false)</code>. * * @param path a WC path to start a cleanup from * @throws SVNException if one of the following is true: * <ul> * <li><code>path</code> does not exist * <li><code>path</code>'s parent directory * is not under version control * </ul> * @see #doCleanup(File, boolean) */ public void doCleanup(File path) throws SVNException { doCleanup(path, false); }
/** * Cleans up a working copy. * This method is equivalent to a call to <code>doCleanup(path, false)</code>. * * @param path a WC path to start a cleanup from * @throws SVNException if one of the following is true: * <ul> * <li><code>path</code> does not exist * <li><code>path</code>'s parent directory * is not under version control * </ul> * @see #doCleanup(File, boolean) */ public void doCleanup(File path) throws SVNException { doCleanup(path, false); }
public void cleanup(String path) throws ClientException { SVNWCClient client = getSVNWCClient(); try { client.doCleanup(new File(path).getAbsoluteFile()); } catch (SVNException e) { throwException(e); } }
public void cleanup(String path) throws ClientException { SVNWCClient client = getSVNWCClient(); try { client.doCleanup(new File(path).getAbsoluteFile()); } catch (SVNException e) { throwException(e); } finally { resetLog(); } }
public void cleanup(String path) throws ClientException { SVNWCClient client = getSVNWCClient(); try { client.doCleanup(new File(path).getAbsoluteFile()); } catch (SVNException e) { throwException(e); } finally { resetLog(); } }
public void cleanup(String path) throws ClientException { SVNWCClient client = getSVNWCClient(); try { client.doCleanup(new File(path).getAbsoluteFile()); } catch (SVNException e) { throwException(e); } finally { resetLog(); } }
public Void invoke(File ws, VirtualChannel channel) throws IOException, InterruptedException { File workingCopy = new File(ws, location.getLocalDir()).getCanonicalFile(); try { log(listener, "Cleanup working copy: " + workingCopy); ISVNAuthenticationManager sam = SVNWCUtil.createDefaultAuthenticationManager(); sam.setAuthenticationProvider(authProvider); SVNWCClient wcClient = new SVNWCClient(sam, null); wcClient.doCleanup(workingCopy); return null; } catch (SVNException e) { debuggingLogger.log(Level.FINE, "Failed Cleanup ", e); throw new IOException(e.getMessage()); } } }
@Override public void init(RepositoryDefinition repo, File dir, ProjectTeamSettings teamSettings) throws Exception { config = repo; baseDirectory = dir; String predefinedUser = repo.getOtherAttributes().get(new QName("svnUsername")); String predefinedPass = repo.getOtherAttributes().get(new QName("svnPassword")); if (predefinedUser == null) { predefinedUser = SVNURL.parseURIEncoded(repo.getUrl()).getUserInfo(); } ISVNOptions options = SVNWCUtil.createDefaultOptions(true); ISVNAuthenticationManager authManager = new SVNAuthenticationManager(repo.getUrl(), predefinedUser, predefinedPass, teamSettings); ourClientManager = SVNClientManager.newInstance(options, authManager); if (baseDirectory.exists()) { ourClientManager.getWCClient().doCleanup(baseDirectory); ourClientManager.getWCClient().doRevert(new File[] { baseDirectory }, SVNDepth.fromRecurse(true), null); } }
/** * {@inheritDoc} * * Perform a "svn cleanup" command. */ @Override public void cleanup(File path) throws VCSException { File localFile = path; if (localFile == null) { localFile = getLocalRepository(); } SVNWCClient wcClient = getSVNManager().getWCClient(); try { wcClient.doCleanup(localFile); } catch (SVNException e) { throw new VCSException(t("isisfish.vcs.vcssvn.cleanup.error"), e); } }
client.doCleanup(target.getFile(), false, false, false, removeUnversioned, removeIgnored, includeExternals); } catch (SVNException e) { if (e.getErrorMessage().getErrorCode() == SVNErrorCode.WC_LOCKED) { client.doCleanup(target.getFile(), true, true, true, false, false, includeExternals); } catch (SVNException e) { if (e.getErrorMessage().getErrorCode() == SVNErrorCode.WC_LOCKED) {
client.doCleanup(target.getFile(), false, false, false, removeUnversioned, removeIgnored, includeExternals); } catch (SVNException e) { if (e.getErrorMessage().getErrorCode() == SVNErrorCode.WC_LOCKED) { client.doCleanup(target.getFile(), true, true, true, false, false, includeExternals); } catch (SVNException e) { if (e.getErrorMessage().getErrorCode() == SVNErrorCode.WC_LOCKED) {
private void copyDisjointDir(File nestedWC, SVNWCAccess parentAccess, File nestedWCParent) throws SVNException { SVNWCClient wcClient = new SVNWCClient((ISVNAuthenticationManager) null, null); wcClient.setEventHandler(getEventDispatcher()); wcClient.doCleanup(nestedWC); SVNWCAccess nestedWCAccess = createWCAccess(); SVNAdminArea dir; String copyFromURL = null; long copyFromRevision = -1; try { dir = nestedWCAccess.open(nestedWC, true, SVNWCAccess.INFINITE_DEPTH); SVNEntry nestedWCThisEntry = nestedWCAccess.getVersionedEntry(nestedWC, false); postCopyCleanup(dir); if (nestedWCThisEntry.isCopied()) { if (nestedWCThisEntry.getCopyFromURL() != null) { copyFromURL = nestedWCThisEntry.getCopyFromURL(); copyFromRevision = nestedWCThisEntry.getCopyFromRevision(); } Map attributes = new SVNHashMap(); attributes.put(SVNProperty.URL, copyFromURL); dir.modifyEntry(dir.getThisDirName(), attributes, true, false); } else { copyFromURL = nestedWCThisEntry.getURL(); copyFromRevision = nestedWCThisEntry.getRevision(); } } finally { nestedWCAccess.close(); } SVNWCManager.add(nestedWC, parentAccess.getAdminArea(nestedWCParent), SVNURL.parseURIEncoded(copyFromURL), copyFromRevision, SVNDepth.INFINITY); }
private void copyDisjointDir(File nestedWC, SVNWCAccess parentAccess, File nestedWCParent) throws SVNException { SVNWCClient wcClient = new SVNWCClient((ISVNAuthenticationManager) null, null); wcClient.setEventHandler(getEventDispatcher()); wcClient.doCleanup(nestedWC); SVNWCAccess nestedWCAccess = createWCAccess(); SVNAdminArea dir; String copyFromURL = null; long copyFromRevision = -1; try { dir = nestedWCAccess.open(nestedWC, true, SVNWCAccess.INFINITE_DEPTH); SVNEntry nestedWCThisEntry = nestedWCAccess.getVersionedEntry(nestedWC, false); postCopyCleanup(dir); if (nestedWCThisEntry.isCopied()) { if (nestedWCThisEntry.getCopyFromURL() != null) { copyFromURL = nestedWCThisEntry.getCopyFromURL(); copyFromRevision = nestedWCThisEntry.getCopyFromRevision(); } Map attributes = new SVNHashMap(); attributes.put(SVNProperty.URL, copyFromURL); dir.modifyEntry(dir.getThisDirName(), attributes, true, false); } else { copyFromURL = nestedWCThisEntry.getURL(); copyFromRevision = nestedWCThisEntry.getRevision(); } } finally { nestedWCAccess.close(); } SVNWCManager.add(nestedWC, parentAccess.getAdminArea(nestedWCParent), SVNURL.parseURIEncoded(copyFromURL), copyFromRevision, SVNDepth.INFINITY); }
SVNWCClient wcClient = new SVNWCClient((ISVNAuthenticationManager) null, null); wcClient.setEventHandler(getEventDispatcher()); wcClient.doCleanup(dst);
SVNWCClient wcClient = new SVNWCClient((ISVNAuthenticationManager) null, null); wcClient.setEventHandler(getEventDispatcher()); wcClient.doCleanup(dst);
private void copyDir(SVNAdminArea dstParent, SVNAdminArea srcArea, File srcPath, String dstName) throws SVNException { SVNEntry srcEntry = srcArea.getWCAccess().getEntry(srcPath, false); if (srcEntry == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_NOT_FOUND, "'{0}'' is not under version control", srcPath); SVNErrorManager.error(err); } if (srcEntry.isScheduledForAddition() || srcEntry.getURL() == null || srcEntry.isCopied()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE, "Cannot copy or move ''{0}'': it''s not in repository yet; try committing first", srcPath); SVNErrorManager.error(err); } File dstPath = dstParent.getFile(dstName); SVNFileUtil.copyDirectory(srcPath, dstPath, true, srcArea.getWCAccess()); SVNWCClient wcClient = new SVNWCClient((ISVNAuthenticationManager) null, (ISVNOptions) null); wcClient.doCleanup(dstPath); SVNWCAccess tmpAccess = SVNWCAccess.newInstance(null); try { SVNAdminArea tmpDir = tmpAccess.open(dstPath, true, SVNWCAccess.INFINITE_DEPTH); postCopyCleanup(tmpDir); } finally { tmpAccess.close(); } SVNWCManager.add(dstPath, dstParent, srcEntry.getSVNURL(), srcEntry.getRevision()); }