Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-06-08 19:03:14 +0000
committerMichael Valenta2004-06-08 19:03:14 +0000
commit873e4c9a1321e8c8743c2f1685e49102c04e1426 (patch)
tree16d2f3a0ff1e2e06b8e7d61836cc10f60bfc51c7
parent606f1d8c80cfc07eadb37b587d234b4ae9bc641c (diff)
downloadeclipse.platform.team-873e4c9a1321e8c8743c2f1685e49102c04e1426.tar.gz
eclipse.platform.team-873e4c9a1321e8c8743c2f1685e49102c04e1426.tar.xz
eclipse.platform.team-873e4c9a1321e8c8743c2f1685e49102c04e1426.zip
Bug 65429 "re-shared" project ignores .cvsignore on synchronize
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java15
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSBaseResourceVariantTree.java35
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java19
3 files changed, 50 insertions, 19 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
index 2d2496a5e..2a7bb21a0 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
@@ -186,7 +186,20 @@ public class EclipseSynchronizer implements IFlushOperation {
} finally {
endOperation();
}
- }
+ }
+
+ /**
+ * Return whether the given folder is a managed CVS folder.
+ * A managed CVS folder has folder sync info and is either a
+ * project or has resource sync info.
+ * @param folder a folder
+ * @return whether the given folder is a managed CVS folder
+ * @throws CVSException
+ */
+ public boolean isManagedCVSFolder(IContainer folder) throws CVSException {
+ return (getFolderSync(folder) != null
+ && (folder.getType() == IResource.PROJECT || getSyncBytes(folder) != null));
+ }
/**
* Deletes the folder sync for the specified folder and the resource sync
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSBaseResourceVariantTree.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSBaseResourceVariantTree.java
index 475227759..43b7571de 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSBaseResourceVariantTree.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSBaseResourceVariantTree.java
@@ -10,10 +10,15 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.core.syncinfo;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.variants.ResourceVariantByteStore;
+import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
+import org.eclipse.team.internal.ccvs.core.CVSWorkspaceSubscriber;
import org.eclipse.team.internal.ccvs.core.resources.EclipseSynchronizer;
@@ -35,10 +40,14 @@ public class CVSBaseResourceVariantTree extends ResourceVariantByteStore {
}
return bytes;
} else {
- // For a folder, return the folder sync info bytes
- FolderSyncInfo info = EclipseSynchronizer.getInstance().getFolderSync((IContainer)resource);
- if (info == null) return null;
- return info.getBytes();
+ // For a folder, return the folder sync info bytes if the folder is managed or is a project
+ if (EclipseSynchronizer.getInstance().isManagedCVSFolder((IContainer)resource)) {
+ FolderSyncInfo info = EclipseSynchronizer.getInstance().getFolderSync((IContainer)resource);
+ if (info != null) {
+ return info.getBytes();
+ }
+ }
+ return null;
}
}
public boolean isVariantKnown(IResource resource) throws TeamException {
@@ -53,14 +62,22 @@ public class CVSBaseResourceVariantTree extends ResourceVariantByteStore {
public boolean deleteBytes(IResource resource) throws TeamException {
throw new UnsupportedOperationException();
}
-
- /* (non-Javadoc)
- * @see org.eclipse.team.core.subscribers.utils.SynchronizationCache#members(org.eclipse.core.resources.IResource)
- */
public IResource[] members(IResource resource) throws TeamException {
if(resource.getType() == IResource.FILE) {
return new IResource[0];
}
- return EclipseSynchronizer.getInstance().members((IContainer)resource);
+ CVSWorkspaceSubscriber workspaceSubscriber = CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber();
+ if(resource.getType() == IResource.ROOT) {
+ return workspaceSubscriber.roots();
+ }
+ IResource[] members = EclipseSynchronizer.getInstance().members((IContainer)resource);
+ List result = new ArrayList();
+ for (int i = 0; i < members.length; i++) {
+ IResource member = members[i];
+ if (workspaceSubscriber.isSupervised(member)) {
+ result.add(member);
+ }
+ }
+ return (IResource[]) result.toArray(new IResource[result.size()]);
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java
index 4406d59be..4230fa93e 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java
@@ -37,6 +37,7 @@ import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.internal.ccvs.core.Policy;
+import org.eclipse.team.internal.ccvs.core.resources.*;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFolder;
@@ -161,16 +162,16 @@ public class CVSResourceVariantTree extends ResourceVariantTree {
}
private byte[] getBaseBytes(IContainer parent, CVSTag tag) throws CVSException {
- byte[] bytes;
+ byte[] bytes = null;
// Look locally for the folder bytes
- ICVSFolder local = CVSWorkspaceRoot.getCVSFolderFor(parent);
- FolderSyncInfo info = local.getFolderSyncInfo();
- if (info == null) {
- bytes = null;
- } else {
- // Use the folder sync from the workspace and the tag from the store
- FolderSyncInfo newInfo = new FolderSyncInfo(info.getRepository(), info.getRoot(), tag, false);
- bytes = newInfo.getBytes();
+ EclipseSynchronizer synchronizer = EclipseSynchronizer.getInstance();
+ if (synchronizer.isManagedCVSFolder(parent)) {
+ FolderSyncInfo info = synchronizer.getFolderSync(parent);
+ if (info != null) {
+ // Use the folder sync from the workspace and the tag from the store
+ FolderSyncInfo newInfo = new FolderSyncInfo(info.getRepository(), info.getRoot(), tag, false);
+ bytes = newInfo.getBytes();
+ }
}
return bytes;
}

Back to the top