Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-06-11 13:18:32 -0400
committerMichael Valenta2002-06-11 13:18:32 -0400
commite61b7db1dfea33c771d7fb5e997caadc3cc99463 (patch)
tree64b32107d257eb7d8d5eb653af1a48fecc55e041
parent2734558f3f3c6e25c0fc1ab8fed302e50e7f194c (diff)
downloadeclipse.platform.team-e61b7db1dfea33c771d7fb5e997caadc3cc99463.tar.gz
eclipse.platform.team-e61b7db1dfea33c771d7fb5e997caadc3cc99463.tar.xz
eclipse.platform.team-e61b7db1dfea33c771d7fb5e997caadc3cc99463.zip
19873: Sync View: Internal error refreshing from repo on deleted project
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties1
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java9
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/SyncCompareInput.java6
3 files changed, 14 insertions, 2 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
index 23c6f43e9..9b15669c0 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
@@ -196,6 +196,7 @@ CVSRepositoryLocationPropertySource.method=Connection Method
CVSSyncCompareInput.confirmMergeMessageTitle=Information
CVSSyncCompareInput.confirmMergeMessage=Your changes have been saved. When you are finished, \
select 'Mark as Merged' to make this file an outgoing change.
+CVSSyncCompareInput.projectDeleted=Project ''{0}'' has been deleted locally and cannot be synchronized.
CVSUIPlugin.refreshTitle=Refresh Resource?
CVSUIPlugin.refreshQuestion={0} Would you like to refresh resource ''{1}''?
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java
index 10f74c82a..538f88a7e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java
@@ -143,6 +143,15 @@ public class CVSSyncCompareInput extends SyncCompareInput {
// }
protected IRemoteSyncElement[] createSyncElements(IProgressMonitor monitor) throws TeamException {
+ // Ensure that the projects for all resources being synchronized exist
+ // Note: his could happen on a refresh view after a synced project was deleted.
+ for (int i = 0; i < resources.length; i++) {
+ IResource resource = resources[i];
+ if (!resource.getProject().exists()) {
+ throw new CVSException(Policy.bind("CVSSyncCompareInput.projectDeleted", resource.getProject().getName()));
+ }
+ }
+
if (onlyOutgoing) {
// Find the outgoing changes in each selected resource
final List outgoing = new ArrayList();
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/SyncCompareInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/SyncCompareInput.java
index 4d7a34dbc..a0660860d 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/SyncCompareInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/SyncCompareInput.java
@@ -380,12 +380,14 @@ public abstract class SyncCompareInput extends CompareEditorInput {
} catch (InvocationTargetException e) {
Throwable throwable = e.getTargetException();
IStatus error = null;
- if (throwable instanceof CoreException) {
+ if (throwable instanceof TeamException) {
+ error = ((TeamException)throwable).getStatus();
+ } else if (throwable instanceof CoreException) {
error = ((CoreException)throwable).getStatus();
} else {
error = new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, Policy.bind("simpleInternal") , throwable); //$NON-NLS-1$
}
- ErrorDialog.openError(shell, problemMessage, error.getMessage(), error);
+ ErrorDialog.openError(shell, problemMessage, null, error);
TeamUIPlugin.log(error);
}
}

Back to the top