Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-05-12 20:12:16 +0000
committerMichael Valenta2004-05-12 20:12:16 +0000
commiteac2cb49efc11273981ee7332bf6f350d9940a7d (patch)
tree30b606d926934a09487fc815ac002fbf4aa08bed
parent68b57d5bfd851cd10563bfd815fdf1d6b19ed534 (diff)
downloadeclipse.platform.team-eac2cb49efc11273981ee7332bf6f350d9940a7d.tar.gz
eclipse.platform.team-eac2cb49efc11273981ee7332bf6f350d9940a7d.tar.xz
eclipse.platform.team-eac2cb49efc11273981ee7332bf6f350d9940a7d.zip
Always put folder sync info in the local workspace
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/CVSResourceVariantTree.java22
2 files changed, 23 insertions, 1 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java
index 7cc0a0e63..9771171a0 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java
@@ -732,7 +732,7 @@ public class RemoteFolderTreeBuilder {
}
private boolean pruneEmptyDirectories() {
- return CVSProviderPlugin.getPlugin().getPruneEmptyDirectories();
+ return false;
}
/*
* Record the deltas in a double map where the outer key is the parent directory
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 34b1cec3c..7a3ab3df7 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
@@ -15,6 +15,7 @@ import java.util.Arrays;
import java.util.List;
import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
@@ -169,6 +170,16 @@ public class CVSResourceVariantTree extends ResourceVariantTree {
}
return bytes;
}
+
+ private boolean hasLocalSyncInfo(IContainer folder) {
+ ICVSFolder local = CVSWorkspaceRoot.getCVSFolderFor(folder);
+ try {
+ return local.getFolderSyncInfo() != null;
+ } catch (CVSException e) {
+ // Say that there is sync info and let the failure occur elsewhere
+ return true;
+ }
+ }
public CVSTag getTag(IResource resource) {
return tag;
@@ -185,6 +196,17 @@ public class CVSResourceVariantTree extends ResourceVariantTree {
* @see org.eclipse.team.internal.core.subscribers.caches.ResourceVariantTree#setVariant(org.eclipse.core.resources.IResource, org.eclipse.team.core.synchronize.IResourceVariant)
*/
protected boolean setVariant(IResource local, IResourceVariant remote) throws TeamException {
+ if (local.getType() == IResource.FOLDER && remote != null
+ && !hasLocalSyncInfo((IFolder)local)
+ && hasLocalSyncInfo(local.getParent())) {
+ // Manage the folder locally since folders exist in all versions, etc
+ // Use the info from the remote except get the tag from the locla parent
+ CVSTag tag = CVSWorkspaceRoot.getCVSFolderFor(local.getParent()).getFolderSyncInfo().getTag();
+ FolderSyncInfo info = FolderSyncInfo.getFolderSyncInfo(remote.asBytes());
+ FolderSyncInfo newInfo = new FolderSyncInfo(info.getRepository(), info.getRoot(), tag, info.getIsStatic());
+ ICVSFolder cvsFolder = CVSWorkspaceRoot.getCVSFolderFor((IFolder)local);
+ cvsFolder.setFolderSyncInfo(newInfo);
+ }
boolean changed = super.setVariant(local, remote);
if (local.getType() == IResource.FILE && getByteStore().getBytes(local) != null && !parentHasSyncBytes(local)) {
// Log a warning if there is no sync bytes available for the resource's

Back to the top