Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-04-05 08:26:21 -0500
committerMichael Valenta2002-04-05 08:26:21 -0500
commit08596da4d1d8092127d596d2d6a5d07671e4dc7b (patch)
treefa87690b4c70a836d9aff7a2a2a379b6c5cc57c3
parentd62a68978473637b3890bb6fadc318da887b41da (diff)
downloadeclipse.platform.team-08596da4d1d8092127d596d2d6a5d07671e4dc7b.tar.gz
eclipse.platform.team-08596da4d1d8092127d596d2d6a5d07671e4dc7b.tar.xz
eclipse.platform.team-08596da4d1d8092127d596d2d6a5d07671e4dc7b.zip
12715: NPE trying to check-out project which already exists
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java8
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java16
2 files changed, 19 insertions, 5 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java
index 77fad2e42..d9254c57e 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java
@@ -139,15 +139,16 @@ public class CVSProvider implements ICVSProvider {
// delete children, keep project
monitor.subTask(Policy.bind("CVSProvider.Scrubbing_local_project_1")); //$NON-NLS-1$
IResource[] children = project.members();
- IProgressMonitor subMonitor = Policy.subMonitorFor(monitor, 90);
+ IProgressMonitor subMonitor = Policy.subMonitorFor(monitor, 80);
subMonitor.beginTask(null, children.length * 100);
try {
for (int j = 0; j < children.length; j++) {
- children[j].delete(true /*force*/, Policy.subMonitorFor(subMonitor, 100));
+ children[j].delete(true /*force*/, Policy.subMonitorFor(subMonitor, 100));
}
} finally {
subMonitor.done();
}
+ CVSWorkspaceRoot.getCVSFolderFor(project).unmanage(Policy.subMonitorFor(monitor, 10));
}
}
} catch (CoreException e) {
@@ -540,8 +541,7 @@ public class CVSProvider implements ICVSProvider {
}
private CVSException wrapException(CoreException e) {
- CVSProviderPlugin.log(e.getStatus());
- return new CVSException(new Status(IStatus.ERROR, CVSProviderPlugin.ID, CVSException.UNABLE, Policy.bind("CVSProvider.exception"), e)); //$NON-NLS-1$
+ return new CVSException(e.getStatus()); //$NON-NLS-1$
}
public static void startup() {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java
index 8f351cc1e..ff19698c0 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java
@@ -5,10 +5,14 @@ package org.eclipse.team.internal.ccvs.core.client;
* All Rights Reserved.
*/
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.team.ccvs.core.CVSStatus;
import org.eclipse.team.ccvs.core.CVSTag;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.ccvs.core.ICVSResourceVisitor;
import org.eclipse.team.internal.ccvs.core.CVSException;
@@ -76,7 +80,17 @@ public class Checkout extends Command {
Assert.isTrue(session.getLocalRoot().isFolder());
// Send the information about the local workspace resources to the server
- new FileStructureVisitor(session, true, true, monitor).visit(session, resources);
+ List resourcesToSend = new ArrayList(resources.length);
+ for (int i = 0; i < resources.length; i++) {
+ ICVSResource resource = resources[i];
+ if (resource.exists() && resource.isFolder() && ((ICVSFolder)resource).isCVSFolder()) {
+ resourcesToSend.add(resource);
+ }
+ }
+ if ( ! resourcesToSend.isEmpty()) {
+ resources = (ICVSResource[]) resourcesToSend.toArray(new ICVSResource[resourcesToSend.size()]);
+ new FileStructureVisitor(session, true, true, monitor).visit(session, resources);
+ }
}
protected void sendLocalWorkingDirectory(Session session) throws CVSException {

Back to the top