Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSException.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IResourceStateChangeListener.java28
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java1
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipsePhantomSynchronizer.java1
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/FileModificationManager.java22
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/AddDeleteMoveListener.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java8
9 files changed, 29 insertions, 45 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSException.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSException.java
index 5b545d8e4..53361df41 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSException.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSException.java
@@ -11,6 +11,7 @@ import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.team.core.TeamException;
/**
@@ -100,4 +101,9 @@ public class CVSException extends TeamException {
else
return new CVSException(e.getStatus());
}
+
+ public CoreException toCoreException() {
+ IStatus status = getStatus();
+ return new CoreException(new Status(status.getSeverity(), status.getPlugin(), 0, status.getMessage(), this));
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
index 1500860c0..dbcecf9ac 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
@@ -432,12 +432,12 @@ public class CVSProviderPlugin extends Plugin {
}
}
- public static void broadcastModificationStateChanges(final IResource[] resources, final int type) {
+ public static void broadcastModificationStateChanges(final IResource[] resources) {
for(Iterator it=listeners.iterator(); it.hasNext();) {
final IResourceStateChangeListener listener = (IResourceStateChangeListener)it.next();
ISafeRunnable code = new ISafeRunnable() {
public void run() throws Exception {
- listener.resourceModificationStateChanged(resources, type);
+ listener.resourceModified(resources);
}
public void handleException(Throwable e) {
// don't log the exception....it is already being logged in Platform#run
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IResourceStateChangeListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IResourceStateChangeListener.java
index 8b06ca2c9..0c8ec80b0 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IResourceStateChangeListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IResourceStateChangeListener.java
@@ -20,8 +20,6 @@ import org.eclipse.core.resources.IResource;
*/
public interface IResourceStateChangeListener extends EventListener{
- public static final int CONTENTS_MODIFIED = 0;
-
/**
* Notifies this listener that some resource sync info state changes have
* already happened. For example, a resource's base revision may have
@@ -41,27 +39,9 @@ public interface IResourceStateChangeListener extends EventListener{
public void resourceSyncInfoChanged(IResource[] changedResources);
/**
- * Notifies this listener that the resource's modification state has
- * changed. For example, the resource may have become dirty due to an edit
- * or may have become clean due to a commit. The method is only invoked for
- * resources that existed before and exist after the state change.
- * The resource tree may not be open to modification when this method is
- * invoked.
- * <p>
- * A changeType of NO_LONGER_MODIFIED indicates that the files are no longer
- * modified from a CVS standpoint (i.e. it was either committed or
- * reverted). A changeType of CONTENTS_MODIFIED indicates that the contents
- * of the files have been modified but does not gaurentee that the files are
- * modified from a CVS standpoint. The receiver must verify the proper
- * state. A changeType of SYNC_INFO_EXTERNALLY_MODIFIED indicates that the
- * sync info was modified by an external tool so the files may or may not
- * still be modified.
- * </p>
- * <p>
- * Resources reported with a changeType of NO_LONGER_MODIFIED or
- * SYNC_INFO_EXTERNALLY_MODIFIED will also be reported via a
- * <code>resourceSyncInfoChanged</code> invocation.
- * </p>
+ * Notifies this listener that the resource's have been modified. This
+ * doesn't necessarily mean that the resource state isModified. The listener
+ * must check the state.
* <p>
* Note: This method is called by CVS team core; it is not intended to be
* called directly by clients.
@@ -70,7 +50,7 @@ public interface IResourceStateChangeListener extends EventListener{
* @param changedResources that have changed state
* @param changeType the type of state change.
*/
- public void resourceModificationStateChanged(IResource[] changedResources, int changeType);
+ public void resourceModified(IResource[] changedResources);
/**
* Notifies this listener that the project has just been configured
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java
index f01349200..458784654 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java
@@ -122,7 +122,9 @@ public class EclipseFile extends EclipseResource implements ICVSFile {
if (indicator != null)
return indicator == EclipseSynchronizer.IS_DIRTY_INDICATOR;
// nothing cached, need to manually check (and record)
+
ResourceSyncInfo info = getSyncInfo();
+ if (info == null && isIgnored()) return false;
// unmanaged files are reported as modified
boolean dirty = isModified(info);
setModified(dirty);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java
index 6ae0fdc70..9a9220ce8 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java
@@ -415,6 +415,7 @@ class EclipseFolder extends EclipseResource implements ICVSFolder {
boolean shared = isCVSFolder();
Integer count = EclipseSynchronizer.getInstance().getDirtyCount(container);
if (count == null) {
+ if (!exists()) return false;
String indicator = EclipseSynchronizer.getInstance().getDirtyIndicator(container);
if (indicator == null) {
// We have no cached info for the folder. We'll need to check directly,
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipsePhantomSynchronizer.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipsePhantomSynchronizer.java
index 515c45f82..0c2fd5ff8 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipsePhantomSynchronizer.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipsePhantomSynchronizer.java
@@ -226,7 +226,6 @@ public class EclipsePhantomSynchronizer extends EclipseSynchronizer {
beginOperation(null);
FolderSyncInfo folderInfo = getPhantomFolderSyncInfo(folder);
if (folderInfo != null) {
- beginOperation(null);
Map map = getPhantomResourceSyncInfoMap(folder);
if (folder.getFolder(SyncFileWriter.CVS_DIRNAME).exists()) {
// There is already a CVS subdirectory which indicates that
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/FileModificationManager.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/FileModificationManager.java
index 10ddb9e87..e1f6bfb4e 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/FileModificationManager.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/FileModificationManager.java
@@ -33,7 +33,6 @@ 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.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.IResourceStateChangeListener;
/**
* This class performs several functions related to determining the modified
@@ -80,6 +79,10 @@ public class FileModificationManager implements IResourceChangeListener, ISavePa
contentsChanged((IFile)resource);
} else if (delta.getKind() == IResourceDelta.ADDED) {
resourceAdded(resource);
+ } else if (delta.getKind() == IResourceDelta.REMOVED) {
+ // provide notifications for deletions since they may not have been managed
+ // The move/delete hook would have updated the parent counts properly
+ modifiedResources.add(resource);
}
return true;
@@ -87,9 +90,8 @@ public class FileModificationManager implements IResourceChangeListener, ISavePa
});
if (!modifiedResources.isEmpty()) {
CVSProviderPlugin.broadcastModificationStateChanges(
- (IResource[])modifiedResources.toArray(new IResource[modifiedResources.size()]),
- IResourceStateChangeListener.CONTENTS_MODIFIED);
- modifiedResources.clear();
+ (IResource[])modifiedResources.toArray(new IResource[modifiedResources.size()]));
+ modifiedResources.clear();
}
} catch (CoreException e) {
CVSProviderPlugin.log(e.getStatus());
@@ -158,12 +160,11 @@ public class FileModificationManager implements IResourceChangeListener, ISavePa
public void contentsChanged(IFile file) throws CoreException {
try {
EclipseFile cvsFile = (EclipseFile)CVSWorkspaceRoot.getCVSFileFor(file);
- if (cvsFile.handleModification(false /* addition */)) {
- modifiedResources.add(file);
- }
+ cvsFile.handleModification(false /* addition */);
+ // add all files to the modified list
+ modifiedResources.add(file);
} catch (CVSException e) {
- // XXX Should wrap exception
- throw new CoreException(e.getStatus());
+ throw e.toCoreException();
}
}
@@ -182,8 +183,7 @@ public class FileModificationManager implements IResourceChangeListener, ISavePa
modifiedResources.add(resource);
}
} catch (CVSException e) {
- // XXX Should wrap exception
- throw new CoreException(e.getStatus());
+ throw e.toCoreException();
}
}
/**
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/AddDeleteMoveListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/AddDeleteMoveListener.java
index 7a22cafdf..2f5d979f4 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/AddDeleteMoveListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/AddDeleteMoveListener.java
@@ -463,7 +463,7 @@ public class AddDeleteMoveListener implements IResourceDeltaVisitor, IResourceCh
/**
* @see org.eclipse.team.internal.ccvs.core.IResourceStateChangeListener#resourceModificationStateChanged(org.eclipse.core.resources.IResource[])
*/
- public void resourceModificationStateChanged(IResource[] changedResources, int changeType) {
+ public void resourceModified(IResource[] changedResources) {
// Nothing to do here
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java
index 3d04c50b3..1c4f864ee 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java
@@ -490,12 +490,8 @@ public class CVSDecorator extends LabelProvider implements ILabelDecorator, IRes
/**
* @see org.eclipse.team.internal.ccvs.core.IResourceStateChangeListener#resourceModificationStateChanged(org.eclipse.core.resources.IResource[])
*/
- public void resourceModificationStateChanged(IResource[] changedResources, int changeType) {
- // We are only concerned with content changes since all others
- // will have corresponding sync info changes.
- if (changeType == IResourceStateChangeListener.CONTENTS_MODIFIED) {
- resourceStateChanged(changedResources);
- }
+ public void resourceModified(IResource[] changedResources) {
+ resourceStateChanged(changedResources);
}
} \ No newline at end of file

Back to the top