Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-10-10 14:23:46 +0000
committerMichael Valenta2003-10-10 14:23:46 +0000
commit3016ad1cff90ae391ecd96d9bf5821c8140569bb (patch)
tree67c9e56e48780937843fb54db84fddea37fd1b1a
parent43867c5ccee92ea6119ddb57d1e8d84349d1da23 (diff)
downloadeclipse.platform.team-3016ad1cff90ae391ecd96d9bf5821c8140569bb.tar.gz
eclipse.platform.team-3016ad1cff90ae391ecd96d9bf5821c8140569bb.tar.xz
eclipse.platform.team-3016ad1cff90ae391ecd96d9bf5821c8140569bb.zip
44614: [CVS] Unable to commit, NPE, broken UII20031010
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java8
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties1
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java8
3 files changed, 13 insertions, 4 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java
index 4d8a7ef23..78f34a266 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java
@@ -13,8 +13,10 @@ package org.eclipse.team.internal.ccvs.core.client;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
+import org.eclipse.team.internal.ccvs.core.Policy;
/**
* Handles a "Remove-entry" response from the CVS server.
@@ -49,7 +51,11 @@ class RemoveEntryHandler extends ResponseHandler {
String fileName = repositoryFile.substring(repositoryFile.lastIndexOf("/") + 1); //$NON-NLS-1$
ICVSFolder mParent = session.getLocalRoot().getFolder(localDir);
ICVSFile mFile = mParent.getFile(fileName);
- mFile.unmanage(null);
+ if (mFile.exists()) {
+ CVSProviderPlugin.log(new CVSException(Policy.bind("RemoveEntryHandler.2", mFile.getRepositoryRelativePath()))); //$NON-NLS-1$
+ } else {
+ mFile.unmanage(null);
+ }
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties
index aee784f3b..3298d9cbc 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties
@@ -325,3 +325,4 @@ SynchronizerSyncInfoCache.0=Synchronization information could not be cached for
DeferredResourceChangeHandler.0=Reconciling CVS state changes
DeferredResourceChangeHandler.1=Errors occured handling ignore file (.cvsignore) changes. Some resources may not be decorated properly.
CVSWorkspaceRoot.11=The parent folder of managed file {0} does not have sync info associated with it.
+RemoveEntryHandler.2=Remove-entry received and ignored from CVS server for existing file {0}.
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java
index bae83ba6e..15bca6e99 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java
@@ -316,8 +316,6 @@ import org.eclipse.team.internal.ccvs.core.util.SyncFileWriter;
if (resource.getType() == IResource.FILE) {
if (ResourceSyncInfo.isFolder(bytes)) {
genderChange = true;
- } else {
- bytes = ResourceSyncInfo.convertFromDeletion(bytes);
}
} else if (!ResourceSyncInfo.isFolder(bytes)) {
genderChange = true;
@@ -326,7 +324,7 @@ import org.eclipse.team.internal.ccvs.core.util.SyncFileWriter;
// Return null if it is a gender change
bytes = null;
} else {
- safeSetSessionProperty(resource, RESOURCE_SYNC_KEY, bytes);
+ safeSetSessionProperty(resource, RESOURCE_SYNC_KEY, ResourceSyncInfo.convertFromDeletion(bytes));
}
}
}
@@ -374,6 +372,10 @@ import org.eclipse.team.internal.ccvs.core.util.SyncFileWriter;
* @see org.eclipse.team.internal.ccvs.core.resources.SyncInfoCache#setCachedSyncBytes(org.eclipse.core.resources.IResource, byte[])
*/
void setCachedSyncBytes(IResource resource, byte[] syncBytes, boolean canModifyWorkspace) throws CVSException {
+ if (syncBytes != null && ResourceSyncInfo.isDeletion(syncBytes)) {
+ // Ensue that the sync bytes do not indicate a deletion
+ syncBytes = ResourceSyncInfo.convertFromDeletion(syncBytes);
+ }
safeSetSessionProperty(resource, RESOURCE_SYNC_KEY, syncBytes);
if (resource.exists()) {
// Ensure the synchronizer is clear for exiting resources

Back to the top