/** * Reverts all local changes made to a Working Copy item(s) thus * bringing it to a 'pristine' state. * * @param paths a WC paths to perform a revert on * @param recursive <span class="javakeyword">true</span> to * descend recursively (relevant for directories) * @throws SVNException if one of the following is true: * <ul> * <li><code>path</code> is not under version control * <li>when trying to revert an addition of a directory * from within the directory itself * </ul> * <p/> * Exception will not be thrown if there are multiple paths passed. * Instead caller should process events received by <code>ISVNEventHandler</code> * instance to get information on whether certain path was reverted or not. * @deprecated use {@link #doRevert(File[], SVNDepth, Collection)} instead */ public void doRevert(File[] paths, boolean recursive) throws SVNException { doRevert(paths, recursive ? SVNDepth.INFINITY : SVNDepth.EMPTY, null); }
/** * Reverts all local changes made to a Working Copy item(s) thus * bringing it to a 'pristine' state. * * @param paths a WC paths to perform a revert on * @param recursive <span class="javakeyword">true</span> to * descend recursively (relevant for directories) * @throws SVNException if one of the following is true: * <ul> * <li><code>path</code> is not under version control * <li>when trying to revert an addition of a directory * from within the directory itself * </ul> * <p/> * Exception will not be thrown if there are multiple paths passed. * Instead caller should process events received by <code>ISVNEventHandler</code> * instance to get information on whether certain path was reverted or not. * @deprecated use {@link #doRevert(File[], SVNDepth, Collection)} instead */ public void doRevert(File[] paths, boolean recursive) throws SVNException { doRevert(paths, recursive ? SVNDepth.INFINITY : SVNDepth.EMPTY, null); }
/** * Reverts all local changes made to a Working Copy item(s) thus * bringing it to a 'pristine' state. * * @param path a WC path to perform a revert on * @param recursive <span class="javakeyword">true</span> to * descend recursively (relevant for directories) * @throws SVNException if one of the following is true: * <ul> * <li><code>path</code> is not under version control * <li>when trying to revert an addition of a directory * from within the directory itself * </ul> * @see #doRevert(File[],boolean) * @deprecated use {@link #doRevert(File[], SVNDepth, Collection)} */ public void doRevert(File path, boolean recursive) throws SVNException { doRevert(new File[] { path }, SVNDepth.getInfinityOrEmptyDepth(recursive), null); }
public void revert(String path, boolean recurse) throws ClientException { SVNWCClient client = getSVNWCClient(); try { client.doRevert(new File(path).getAbsoluteFile(), recurse); } catch (SVNException e) { throwException(e); } }
/** * Reverts all local changes made to a Working Copy item(s) thus * bringing it to a 'pristine' state. * * @param path a WC path to perform a revert on * @param recursive <span class="javakeyword">true</span> to * descend recursively (relevant for directories) * @throws SVNException if one of the following is true: * <ul> * <li><code>path</code> is not under version control * <li>when trying to revert an addition of a directory * from within the directory itself * </ul> * @see #doRevert(File[],boolean) * @deprecated use {@link #doRevert(File[], SVNDepth, Collection)} */ public void doRevert(File path, boolean recursive) throws SVNException { doRevert(new File[] { path }, SVNDepth.getInfinityOrEmptyDepth(recursive), null); }
/** * Reverts all local changes made to a Working Copy item(s) thus bringing it * to a 'pristine' state. * * @param path * a WC path to perform a revert on * @param recursive * <span class="javakeyword">true</span> to descend recursively * (relevant for directories) * @throws SVNException * if one of the following is true: * <ul> * <li><code>path</code> is not under version control * <li>when trying to revert an addition of a directory from * within the directory itself * </ul> * @see #doRevert(File[],boolean) * @deprecated use {@link #doRevert(File[], SVNDepth, Collection)} */ public void doRevert(File path, boolean recursive) throws SVNException { doRevert(new File[] {path}, SVNDepth.fromRecurse(recursive), null); }
/** * Reverts all local changes made to a Working Copy item(s) thus bringing it * to a 'pristine' state. * * @param paths * a WC paths to perform a revert on * @param recursive * <span class="javakeyword">true</span> to descend recursively * (relevant for directories) * @throws SVNException * if one of the following is true: * <ul> * <li><code>path</code> is not under version control * <li>when trying to revert an addition of a directory from * within the directory itself * </ul> * <p/> * Exception will not be thrown if there are multiple paths * passed. Instead caller should process events received by * <code>ISVNEventHandler</code> instance to get information on * whether certain path was reverted or not. * @deprecated use {@link #doRevert(File[], SVNDepth, Collection)} instead */ public void doRevert(File[] paths, boolean recursive) throws SVNException { doRevert(paths, SVNDepth.fromRecurse(recursive), null); }
public Void invoke(File ws, VirtualChannel channel) throws IOException, InterruptedException { File workingCopy = new File(ws, location.getLocalDir()).getCanonicalFile(); try { log(listener, "Reverting working copy: " + workingCopy); ISVNAuthenticationManager sam = SVNWCUtil.createDefaultAuthenticationManager(); sam.setAuthenticationProvider(authProvider); SVNWCClient wcClient = new SVNWCClient(sam, null); wcClient.doRevert(new File[]{workingCopy}, SVNDepth.INFINITY, null); return null; } catch (SVNException e) { debuggingLogger.log(Level.FINE, "Failed Revert WorkingCopy ", e); throw new IOException(e.getMessage()); } } }
@Override protected void preUpdate(ModuleLocation module, File local) throws SVNException, IOException { listener.getLogger().println("Reverting " + local + " ignoreExternals: " + module.isIgnoreExternalsOption()); final SVNWCClient svnwc = manager.getWCClient(); svnwc.setIgnoreExternals(module.isIgnoreExternalsOption()); svnwc.doRevert(new File[]{local.getCanonicalFile()}, getSvnDepth(module.getDepthOption()), null); } }
@Override protected void preUpdate(ModuleLocation module, File local) throws SVNException, IOException { listener.getLogger().println("Reverting " + local + " ignoreExternals: " + module.isIgnoreExternalsOption()); final SVNWCClient svnwc = manager.getWCClient(); svnwc.setIgnoreExternals(module.isIgnoreExternalsOption()); svnwc.doRevert(new File[]{local.getCanonicalFile()}, getSvnDepth(module.getDepthOption()), null); } }
public void revert(String path, int depth, String[] changelists) throws ClientException { SVNWCClient client = getSVNWCClient(); try { client.doRevert(new File[] { new File(path).getAbsoluteFile() }, JavaHLObjectFactory.getSVNDepth(depth), JavaHLObjectFactory.getChangeListsCollection(changelists)); } catch (SVNException e) { throwException(e); } finally { resetLog(); } }
@Override protected void preUpdate(ModuleLocation module, File local) throws SVNException, IOException { listener.getLogger().println("Reverting " + local + " to depth " + module.getDepthOption() + " with ignoreExternals: " + module.isIgnoreExternalsOption()); final SVNWCClient svnwc = manager.getWCClient(); svnwc.setIgnoreExternals(module.isIgnoreExternalsOption()); svnwc.doRevert(new File[]{local.getCanonicalFile()}, module.getSvnDepthForRevert(), null); } }
public void revert(String path, int depth, String[] changelists) throws ClientException { SVNWCClient client = getSVNWCClient(); try { client.doRevert(new File[] { new File(path).getAbsoluteFile() }, JavaHLObjectFactory.getSVNDepth(depth), JavaHLObjectFactory.getChangeListsCollection(changelists)); } catch (SVNException e) { throwException(e); } finally { resetLog(); } }
public void revert(String path, int depth, String[] changelists) throws ClientException { SVNWCClient client = getSVNWCClient(); try { client.doRevert(new File[] { new File(path).getAbsoluteFile() }, JavaHLObjectFactory.getSVNDepth(depth), JavaHLObjectFactory.getChangeListsCollection(changelists)); } catch (SVNException e) { throwException(e); } finally { resetLog(); } }
@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); } }
SVNAdminAreaInfo info = wcAccess.openAnchor(path, true, recursive ? SVNWCAccess.INFINITE_DEPTH : 0); boolean useCommitTimes = getOptions().isUseCommitTimes(); doRevert(path, info.getAnchor(), recursive, useCommitTimes); } catch (SVNException e) { SVNErrorCode code = e.getErrorMessage().getErrorCode();
ourClientManager.getWCClient().doRevert(new File[] { baseDirectory }, SVNDepth.fromRecurse(true), null); return null; } else {
File[] paths = (File[]) pathsList.toArray(new File[pathsList.size()]); try { client.doRevert(paths, depth, changeLists); } catch (SVNException e) { SVNErrorMessage err = e.getErrorMessage();
File[] paths = (File[]) pathsList.toArray(new File[pathsList.size()]); try { client.doRevert(paths, depth, changeLists); } catch (SVNException e) { SVNErrorMessage err = e.getErrorMessage();