Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-01-28 15:18:53 +0000
committerMichael Valenta2002-01-28 15:18:53 +0000
commit5311fc82822881237b05f5f664ad02503b25839c (patch)
treec2c7c489dbcc8709859bc3085293c505285fc01e
parent36a22d7ac559c279064f0675aeb0dac1f7323178 (diff)
downloadeclipse.platform.team-5311fc82822881237b05f5f664ad02503b25839c.tar.gz
eclipse.platform.team-5311fc82822881237b05f5f664ad02503b25839c.tar.xz
eclipse.platform.team-5311fc82822881237b05f5f664ad02503b25839c.zip
7491: Behavior of get() in CVSTeamProvider is incorrect
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java35
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java2
3 files changed, 35 insertions, 4 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 62c1455a9..ed98b88c3 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
@@ -160,7 +160,7 @@ public class CVSProvider implements ICVSProvider {
// Add the option to load into a directory of a different name
String module = project.getName();
if (sourceModule != null) {
- localOptions.add(Checkout.makeModuleNameOption(module));
+ localOptions.add(Checkout.makeDirectoryNameOption(module));
module = sourceModule;
}
// Prune empty directories if pruning enabled
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 f9a16e198..6b5f0d98f 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
@@ -520,9 +520,40 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
*
* @see ITeamProvider#get(IResource[], int, IProgressMonitor)
*/
- public void get(IResource[] resources, int depth, IProgressMonitor progress) throws TeamException {
+ public void get(IResource[] resources, final int depth, IProgressMonitor progress) throws TeamException {
- // XXX Need to correct any outgoing additions or deletions so the remote contents will be retrieved properly
+ // Need to correct any outgoing additions and deletions so the remote contents will be retrieved properly
+ ICVSResourceVisitor visitor = new ICVSResourceVisitor() {
+ public void visitFile(ICVSFile file) throws CVSException {
+ ResourceSyncInfo info = file.getSyncInfo();
+ if (info == null || info.isAdded()) {
+ // Delete the file if it's unmanaged or doesn't exist remotely
+ file.delete();
+ file.unmanage();
+ } else if (info.isDeleted()) {
+ // If deleted, null the sync info so the file will be refetched
+ file.unmanage();
+ }
+ }
+
+ public void visitFolder(ICVSFolder folder) throws CVSException {
+ // Visit the children of the folder as appropriate
+ if (depth == IResource.DEPTH_INFINITE)
+ folder.acceptChildren(this);
+ else if (depth == IResource.DEPTH_ONE) {
+ ICVSFile[] files = folder.getFiles();
+ for (int i = 0; i < files.length; i++) {
+ files[i].accept(this);
+ }
+ }
+ }
+ };
+
+ for (int i = 0; i < resources.length; i++) {
+ getChild(resources[i]).accept(visitor);
+ }
+
+ Synchronizer.getInstance().save(progress);
// Perform an update, ignoring any local file modifications
update(resources, depth, null, true, progress);
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 d6bd5fcf7..04ff3f80a 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
@@ -17,7 +17,7 @@ import org.eclipse.team.internal.ccvs.core.util.Assert;
public class Checkout extends Command {
/*** Local options: specific to checkout ***/
public static final LocalOption FETCH_MODULE_ALIASES = new LocalOption("-c");
- public static LocalOption makeModuleNameOption(String moduleName) {
+ public static LocalOption makeDirectoryNameOption(String moduleName) {
return new LocalOption("-d", moduleName);
}

Back to the top