Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-03-22 11:34:49 -0500
committerJean Michel-Lemieux2002-03-22 11:34:49 -0500
commite0404c13f28184c7203e32ba1ab39ad2f6c3f6fd (patch)
tree7224108c455df28fe57d468cd53d1865384e297a
parent98bdb5fd8623c6a5f6c6f8d0603e7756bfcb2ec7 (diff)
downloadeclipse.platform.team-e0404c13f28184c7203e32ba1ab39ad2f6c3f6fd.tar.gz
eclipse.platform.team-e0404c13f28184c7203e32ba1ab39ad2f6c3f6fd.tar.xz
eclipse.platform.team-e0404c13f28184c7203e32ba1ab39ad2f6c3f6fd.zip
Bug 11609: Disconnecting a project is slow
Bug 11869: Disconnecting does not clear cache? Bug 11059: Disconnect progress is terrible
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java13
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSResource.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/PruneFolderVisitor.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java22
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ResourceDeltaSyncHandler.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java5
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java2
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/AllTestsCVSResources.java3
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseFolderTest.java95
14 files changed, 141 insertions, 26 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java
index 7e1cbefed..bc427ea6d 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java
@@ -57,6 +57,7 @@ import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.connection.CVSServerException;
import org.eclipse.team.internal.ccvs.core.resources.CVSRemoteSyncElement;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
+import org.eclipse.team.internal.ccvs.core.resources.EclipseSynchronizer;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.core.util.Assert;
@@ -113,6 +114,14 @@ public class CVSTeamProvider extends RepositoryProvider {
* @see IProjectNature#deconfigure()
*/
public void deconfigure() throws CoreException {
+ // when a nature is removed from the project, notify the synchronizer that
+ // we no longer need the sync info cached. This does not affect the actual CVS
+ // meta directories on disk, and will remain unless a client calls unmanage().
+ try {
+ EclipseSynchronizer.getInstance().flush(getProject(), true, null);
+ } catch(CVSException e) {
+ throw new CoreException(e.getStatus());
+ }
}
/**
@@ -444,10 +453,10 @@ public class CVSTeamProvider extends RepositoryProvider {
if (info == null || info.isAdded()) {
// Delete the file if it's unmanaged or doesn't exist remotely
file.delete();
- file.unmanage();
+ file.unmanage(null);
} else if (info.isDeleted()) {
// If deleted, null the sync info so the file will be refetched
- file.unmanage();
+ file.unmanage(null);
}
subProgress.worked(1);
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSResource.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSResource.java
index e5e4b120f..96a533d81 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSResource.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSResource.java
@@ -47,7 +47,7 @@ public interface ICVSResource {
* resource. The only way a resource can become managed is by running the
* appropriate CVS commands (e.g. add/commit/update).
*/
- public void unmanage() throws CVSException;
+ public void unmanage(IProgressMonitor monitor) throws CVSException;
/**
* Answer whether the resource could be ignored because it is in the one of the
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/PruneFolderVisitor.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/PruneFolderVisitor.java
index b58159f35..cceb1b97f 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/PruneFolderVisitor.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/PruneFolderVisitor.java
@@ -40,7 +40,7 @@ class PruneFolderVisitor implements ICVSResourceVisitor {
folder.getFiles().length == 0 &&
folder.getFolders().length == 0) {
folder.delete();
- folder.unmanage();
+ folder.unmanage(null);
}
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java
index 98d5c7674..71ccea493 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java
@@ -44,8 +44,7 @@ class RemoveEntryHandler extends ResponseHandler {
String fileName = repositoryFile.substring(repositoryFile.lastIndexOf("/") + 1); //$NON-NLS-1$
ICVSFolder mParent = session.getLocalRoot().getFolder(localDir);
ICVSFile mFile = mParent.getFile(fileName);
- mFile.unmanage();
+ mFile.unmanage(null);
}
-
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java
index 4d23ede27..61784d9b9 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java
@@ -51,7 +51,7 @@ class RemovedHandler extends ResponseHandler {
// delete then unmanage the file
mFile.delete();
- mFile.unmanage();
+ mFile.unmanage(null);
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java
index 3f9d2c25f..2b6d0a1fe 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java
@@ -218,7 +218,7 @@ public class CVSRemoteSyncElement extends RemoteSyncElement {
// To make outgoing deletions incoming, the local will not exist but
// it is still important to unmanage (e.g. delete all meta info) for the
// deletion.
- CVSWorkspaceRoot.getCVSResourceFor(getLocal()).unmanage();
+ CVSWorkspaceRoot.getCVSResourceFor(getLocal()).unmanage(null);
}
/*
@@ -314,7 +314,7 @@ public class CVSRemoteSyncElement extends RemoteSyncElement {
try {
ICVSResource cvsResource = localSync.getCVSResource();
if(!isContainer() && cvsResource.isManaged()) {
- cvsResource.unmanage();
+ cvsResource.unmanage(null);
}
return IRemoteSyncElement.IN_SYNC;
} catch(CVSException e) {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java
index 7fa7e4f05..261a812fa 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java
@@ -206,19 +206,29 @@ class EclipseFolder extends EclipseResource implements ICVSFolder {
/*
* @see ICVSResource#unmanage()
*/
- public void unmanage() throws CVSException {
- recursiveUnmanage((IContainer) resource);
- super.unmanage();
+ public void unmanage(IProgressMonitor monitor) throws CVSException {
+ monitor = Policy.monitorFor(monitor);
+ monitor.beginTask("", 100);
+ run(new ICVSRunnable() {
+ public void run(IProgressMonitor monitor) throws CVSException {
+ recursiveUnmanage((IContainer) resource, monitor);
+ }
+ }, Policy.subMonitorFor(monitor, 99));
+ // unmanaged from parent
+ super.unmanage(Policy.subMonitorFor(monitor, 1));
}
- private static void recursiveUnmanage(IContainer container) throws CVSException {
+ private static void recursiveUnmanage(IContainer container, IProgressMonitor monitor) throws CVSException {
try {
- EclipseSynchronizer.getInstance().deleteFolderSync(container);
+ monitor.beginTask("", 10);
+ monitor.subTask(container.getFullPath().toOSString());
+ EclipseSynchronizer.getInstance().deleteFolderSync(container);
IResource[] members = container.members();
for (int i = 0; i < members.length; i++) {
+ monitor.worked(1);
IResource resource = members[i];
if (members[i].getType() != IResource.FILE) {
- recursiveUnmanage((IContainer) resource);
+ recursiveUnmanage((IContainer) resource, monitor);
}
}
} catch (CoreException e) {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java
index ec5c53ddc..d81fe57fd 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java
@@ -8,7 +8,7 @@ package org.eclipse.team.internal.ccvs.core.resources;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.core.IIgnoreInfo;
@@ -235,7 +235,7 @@ abstract class EclipseResource implements ICVSResource {
/*
* @see ICVSResource#unmanage()
*/
- public void unmanage() throws CVSException {
+ public void unmanage(IProgressMonitor monitor) throws CVSException {
EclipseSynchronizer.getInstance().deleteResourceSync(resource);
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java
index 3696c9d28..60a95f15e 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java
@@ -110,7 +110,7 @@ public abstract class RemoteResource extends PlatformObject implements ICVSRemot
/*
* @see ICVSResource#unmanage()
*/
- public void unmanage() throws CVSException {
+ public void unmanage(IProgressMonitor monitor) throws CVSException {
// do nothing
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ResourceDeltaSyncHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ResourceDeltaSyncHandler.java
index d3b61fc8d..ea1b716e0 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ResourceDeltaSyncHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ResourceDeltaSyncHandler.java
@@ -100,7 +100,7 @@ public class ResourceDeltaSyncHandler implements IResourceDeltaVisitor {
try {
ICVSFolder mFolder = CVSWorkspaceRoot.getCVSFolderFor((IContainer)resource);
if (mFolder.isCVSFolder() && ! mFolder.isManaged() && mFolder.getParent().isCVSFolder()) {
- mFolder.unmanage();
+ mFolder.unmanage(null);
return true;
}
} catch (CVSException e) {
@@ -119,7 +119,7 @@ public class ResourceDeltaSyncHandler implements IResourceDeltaVisitor {
if (mFile.isManaged()) {
ResourceSyncInfo info = mFile.getSyncInfo();
if (info.isAdded()) {
- mFile.unmanage();
+ mFile.unmanage(null);
} else {
mFile.setSyncInfo(new ResourceSyncInfo(info.getName(), info.DELETED_PREFIX + info.getRevision(), info.getTimeStamp(), info.getKeywordMode(), info.getTag(), info.getPermissions()));
}
@@ -142,7 +142,7 @@ public class ResourceDeltaSyncHandler implements IResourceDeltaVisitor {
mFile.setSyncInfo(new ResourceSyncInfo(info.getName(), info.getRevision(), info.getTimeStamp(), info.getKeywordMode(), info.getTag(), info.getPermissions()));
} else if (info.isDirectory()) {
// XXX This is a gender change against the server! We should prevent this creation.
- mFile.unmanage();
+ mFile.unmanage(null);
}
}
} catch (CVSException e) {
@@ -163,7 +163,7 @@ public class ResourceDeltaSyncHandler implements IResourceDeltaVisitor {
if (fromFile.isManaged()) {
fromInfo = fromFile.getSyncInfo();
if (fromInfo.isAdded()) {
- fromFile.unmanage();
+ fromFile.unmanage(null);
} else {
fromFile.setSyncInfo(new ResourceSyncInfo(fromInfo.getName(), fromInfo.DELETED_PREFIX + fromInfo.getRevision(), fromInfo.getTimeStamp(), fromInfo.getKeywordMode(), fromInfo.getTag(), fromInfo.getPermissions()));
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java
index d7b4a6675..b7929fb59 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java
@@ -37,6 +37,7 @@ import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.TeamPlugin;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
+import org.eclipse.team.internal.ccvs.core.util.InfiniteSubProgressMonitor;
import org.eclipse.team.internal.ccvs.ui.CVSDecorator;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.ui.actions.TeamAction;
@@ -149,7 +150,7 @@ public class UnmanageAction extends TeamAction {
monitor.setTaskName(Policy.bind("Unmanage.unmanaging"));
Iterator iterator = keySet.iterator();
while (iterator.hasNext()) {
- IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1000);
+ IProgressMonitor subMonitor = new InfiniteSubProgressMonitor(monitor, 1000);
subMonitor.beginTask(null, 100);
CVSTeamProvider provider = (CVSTeamProvider)iterator.next();
List list = (List)table.get(provider);
@@ -158,7 +159,7 @@ public class UnmanageAction extends TeamAction {
IResource resource = providerResources[i];
ICVSFolder folder = CVSWorkspaceRoot.getCVSFolderFor((IContainer) resource);
if(deleteContent) {
- folder.unmanage();
+ folder.unmanage(Policy.subMonitorFor(subMonitor, 10));
}
RepositoryProvider.removeNatureFromProject((IProject)resource, CVSProviderPlugin.getTypeId(), Policy.subMonitorFor(subMonitor, 10));
CVSDecorator.refresh(resource);
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
index d5e21d1c5..932fbf69c 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
@@ -147,7 +147,7 @@ public class EclipseTest extends EclipseWorkspaceTest {
public void unmanageResources(IContainer container, String[] hierarchy) throws CoreException, TeamException {
IResource[] resources = getResources(container, hierarchy);
for (int i=0;i<resources.length;i++) {
- CVSWorkspaceRoot.getCVSResourceFor(resources[i]).unmanage();
+ CVSWorkspaceRoot.getCVSResourceFor(resources[i]).unmanage(null);
}
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/AllTestsCVSResources.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/AllTestsCVSResources.java
index 50ba24c33..e4e41a51c 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/AllTestsCVSResources.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/AllTestsCVSResources.java
@@ -11,7 +11,8 @@ public class AllTestsCVSResources extends EclipseTest {
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(ResourceSyncInfoTest.suite());
- //suite.addTest(EclipseSynchronizerTest.suite());
+ suite.addTest(EclipseSynchronizerTest.suite());
+ suite.addTest(EclipseFolderTest.suite());
return suite;
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseFolderTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseFolderTest.java
new file mode 100644
index 000000000..42662c4c6
--- /dev/null
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseFolderTest.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2002 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ ******************************************************************************/
+package org.eclipse.team.tests.ccvs.core.cvsresources;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.ICVSFolder;
+import org.eclipse.team.ccvs.core.ICVSResource;
+import org.eclipse.team.ccvs.core.ICVSRunnable;
+import org.eclipse.team.core.TeamException;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
+import org.eclipse.team.tests.ccvs.core.CVSTestSetup;
+import org.eclipse.team.tests.ccvs.core.EclipseTest;
+
+/**
+ * What does this class do?
+ */
+public class EclipseFolderTest extends EclipseTest {
+ public EclipseFolderTest() {
+ super();
+ }
+
+ public EclipseFolderTest(String name) {
+ super(name);
+ }
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite();
+ suite.addTestSuite(EclipseFolderTest.class);
+ return new CVSTestSetup(suite);
+ }
+
+ protected void assertChildrenHaveSync(IContainer root, final boolean hasSync) throws CoreException, CVSException {
+ root.accept(new IResourceVisitor() {
+ public boolean visit(IResource resource) throws CoreException {
+ try {
+ ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource);
+ if(!cvsResource.isIgnored()) {
+ if(resource.getType()==IResource.FILE) {
+ assertTrue((cvsResource.getSyncInfo()!=null) == hasSync);
+ } else {
+ assertTrue((((ICVSFolder)cvsResource).getFolderSyncInfo()!=null) == hasSync);
+ }
+ }
+ } catch(CVSException e) {
+ throw new CoreException(e.getStatus());
+ }
+ return true;
+ }
+ });
+ }
+
+ public void testUnmanageFolder() throws CoreException, TeamException {
+ IProject project = createProject("testUnmanageFolder_A", new String[] {"a.txt", "folder1/", "folder1/b.txt", "folder1/folder2/", "folder1/folder2/c.txt"});
+ ICVSFolder cvsProject = CVSWorkspaceRoot.getCVSFolderFor(project);
+ assertChildrenHaveSync(project, true);
+
+ // test that unmanaging the project flushes sync info
+ cvsProject.unmanage(null);
+ assertChildrenHaveSync(project, false);
+
+ final IProject projectB = createProject("testUnmanageFolder_B", new String[] {"a.txt", "folder1/", "folder1/b.txt", "folder1/folder2/", "folder1/folder2/c.txt"});
+ final ICVSFolder cvsProjectB = CVSWorkspaceRoot.getCVSFolderFor(projectB);
+ assertChildrenHaveSync(projectB, true);
+
+ // test that unmanaging in a CVS runnable flushes too
+ cvsProjectB.run(new ICVSRunnable() {
+ public void run(IProgressMonitor monitor) throws CVSException {
+ try {
+ assertChildrenHaveSync(projectB, true);
+ cvsProjectB.unmanage(null);
+ assertChildrenHaveSync(projectB, false);
+ } catch(CoreException e) {
+ throw CVSException.wrapException(e);
+ }
+ }
+ }, null);
+ assertChildrenHaveSync(projectB, false);
+ }
+} \ No newline at end of file

Back to the top