Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-03-06 16:51:51 -0500
committerMichael Valenta2002-03-06 16:51:51 -0500
commit1e55f14c8fdb668c9f7170f009bdcaeab34be428 (patch)
treeaa45d275fe895059f6cb31421c720e5656dba0b9
parent3f25959a881a41b176ffc6c327924a5dd9351fe5 (diff)
downloadeclipse.platform.team-1e55f14c8fdb668c9f7170f009bdcaeab34be428.tar.gz
eclipse.platform.team-1e55f14c8fdb668c9f7170f009bdcaeab34be428.tar.xz
eclipse.platform.team-1e55f14c8fdb668c9f7170f009bdcaeab34be428.zip
10871: RemoveEntryHandler fails on delete+rename to deleted+release
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/OrphanedFolderListener.java28
1 files changed, 27 insertions, 1 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/OrphanedFolderListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/OrphanedFolderListener.java
index d2fe07313..93407ed21 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/OrphanedFolderListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/OrphanedFolderListener.java
@@ -13,6 +13,8 @@ import org.eclipse.team.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ccvs.core.ICVSFile;
import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.Policy;
+import org.eclipse.team.internal.ccvs.core.client.Session;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
@@ -56,11 +58,35 @@ public class OrphanedFolderListener extends ResourceDeltaVisitor {
}
/*
+ * Handle the case where an added file has the same name as a "cvs removed" file
+ * by restoring the sync info to what it was before the delete
+ */
+ private void handleReplacedDeletion(IResource resource) {
+ if (resource.getType() == IResource.FILE) {
+ try {
+ ICVSFile mFile = CVSWorkspaceRoot.getCVSFileFor((IFile)resource);
+ if (mFile.isManaged()) {
+ ResourceSyncInfo info = mFile.getSyncInfo();
+ if (info.isDeleted()) {
+ mFile.setSyncInfo(new ResourceSyncInfo(info.getName(), info.getRevision(), info.getTimeStamp(), info.getKeywordMode(), info.getTag(), info.getPermissions()));
+ }
+ }
+ } catch (CVSException e) {
+ CVSProviderPlugin.log(e);
+ }
+ }
+ }
+
+ /*
* @see ResourceDeltaVisitor#handleAdded(IResource[])
*/
protected void handleAdded(IResource[] resources) {
for (int i = 0; i < resources.length; i++) {
- handleOrphanedSubtree(resources[i]);
+ if (resources[i].getType() == IResource.FOLDER) {
+ handleOrphanedSubtree(resources[i]);
+ } else if (resources[i].getType() == IResource.FILE) {
+ handleReplacedDeletion(resources[i]);
+ }
}
}

Back to the top