Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-05-12 21:37:25 -0400
committerMichael Valenta2002-05-12 21:37:25 -0400
commit854072ef398e85722eb4bb6ddfbfb4d9f54ac7b5 (patch)
treed175a0f7433b8a36c6111195bdcf6f5b9e3689ce /bundles/org.eclipse.team.cvs.ui
parent6a06d166017343297508c806502a65307ff51a8c (diff)
downloadeclipse.platform.team-854072ef398e85722eb4bb6ddfbfb4d9f54ac7b5.tar.gz
eclipse.platform.team-854072ef398e85722eb4bb6ddfbfb4d9f54ac7b5.tar.xz
eclipse.platform.team-854072ef398e85722eb4bb6ddfbfb4d9f54ac7b5.zip
13971: Need to refresh not obvious from errors in log
Diffstat (limited to 'bundles/org.eclipse.team.cvs.ui')
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java18
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectPropertiesPage.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java46
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java36
-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/AddSyncAction.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java10
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncSet.java54
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CommitSyncAction.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/IgnoreAction.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java2
12 files changed, 154 insertions, 50 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java
index a23fb0bd3..e3577eda4 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java
@@ -120,7 +120,12 @@ public class CVSDecorationRunnable implements Runnable {
// if the resource is ignored return an empty decoration. This will
// force a decoration update event and clear the existing CVS decoration.
ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource);
- if(cvsResource.isIgnored()) {
+ try {
+ if(cvsResource.isIgnored()) {
+ return new CVSDecoration();
+ }
+ } catch (CVSException e) {
+ // The was an exception in isIgnored. Don't decorate
return new CVSDecoration();
}
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 eac66fc09..a13674aa2 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
@@ -481,13 +481,19 @@ public class CVSDecorator extends LabelProvider implements ILabelDecorator, IRes
ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource);
- if (!cvsResource.isManaged()) {
- if (cvsResource.isIgnored()) {
- return false;
- } else {
- // new resource, show as dirty
- throw DECORATOR_EXCEPTION;
+ try {
+ if (!cvsResource.isManaged()) {
+ if (cvsResource.isIgnored()) {
+ return false;
+ } else {
+ // new resource, show as dirty
+ throw DECORATOR_EXCEPTION;
+ }
}
+ } catch (CVSException e) {
+ // isManaged threw an exception
+ CVSUIPlugin.log(e.getStatus());
+ return false;
}
if (!cvsResource.isFolder()) {
if(isDirty((ICVSFile) cvsResource)) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectPropertiesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectPropertiesPage.java
index 97e2be58e..48662edd0 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectPropertiesPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectPropertiesPage.java
@@ -270,9 +270,9 @@ public class CVSProjectPropertiesPage extends PropertyPage {
if (provider == null) return;
CVSWorkspaceRoot cvsRoot = provider.getCVSWorkspaceRoot();
ICVSFolder folder = cvsRoot.getLocalRoot();
- if (!folder.isCVSFolder()) return;
try {
+ if (!folder.isCVSFolder()) return;
methodLabel.setText(location.getMethod().getName());
info = location.getUserInfo(true);
userLabel.setText(info.getUsername());
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
index ee44b691f..82369d0e1 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
@@ -11,10 +11,10 @@
package org.eclipse.team.internal.ccvs.ui;
-import java.util.Hashtable;
import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.Hashtable;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceStatus;
@@ -24,6 +24,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.IPreferenceStore;
@@ -40,14 +41,14 @@ import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
-import org.eclipse.team.internal.ccvs.core.util.AddDeleteMoveListener;
import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
+import org.eclipse.team.internal.ccvs.core.util.AddDeleteMoveListener;
import org.eclipse.team.internal.ccvs.ui.model.CVSAdapterFactory;
import org.eclipse.team.ui.TeamUIPlugin;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.texteditor.WorkbenchChainedTextFontFieldEditor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.ui.texteditor.WorkbenchChainedTextFontFieldEditor;
/**
* UI Plugin for CVS provider-specific workbench functionality.
@@ -127,12 +128,26 @@ public class CVSUIPlugin extends AbstractUIPlugin implements IPropertyChangeList
}
/**
+ * Extract or convert to a TeamException
+ */
+ public static TeamException asTeamException(InvocationTargetException e) {
+ Throwable exception = e.getTargetException();
+ if (exception instanceof TeamException) {
+ return (TeamException)exception;
+ } else if (exception instanceof CoreException) {
+ return new TeamException(((CoreException)exception).getStatus());
+ } else {
+ return new TeamException(new Status(IStatus.ERROR, CVSUIPlugin.ID, 0, Policy.bind("internal"), exception)); //$NON-NLS-1$
+ }
+ }
+
+ /**
* Run an operation involving the given resource. If an exception is thrown
* and the code on the status is IResourceStatus.OUT_OF_SYNC_LOCAL then
* the user will be prompted to refresh and try again. If they agree, then the
* supplied operation will be run again.
*/
- public static void runWithRefresh(Shell parent, IResource resource,
+ public static void runWithRefresh(Shell parent, IResource[] resources,
IRunnableWithProgress runnable, IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
boolean firstTime = true;
@@ -151,9 +166,11 @@ public class CVSUIPlugin extends AbstractUIPlugin implements IPropertyChangeList
throw e;
}
if (status.getCode() == IResourceStatus.OUT_OF_SYNC_LOCAL) {
- if (promptToRefresh(parent, resource, status)) {
+ if (promptToRefresh(parent, resources, status)) {
try {
- resource.refreshLocal(IResource.DEPTH_INFINITE, null);
+ for (int i = 0; i < resources.length; i++) {
+ resources[i].refreshLocal(IResource.DEPTH_INFINITE, null);
+ }
} catch (CoreException coreEx) {
// Throw the original exception to the caller
log(coreEx.getStatus());
@@ -172,7 +189,7 @@ public class CVSUIPlugin extends AbstractUIPlugin implements IPropertyChangeList
}
}
- private static boolean promptToRefresh(final Shell shell, final IResource resource, final IStatus status) {
+ private static boolean promptToRefresh(final Shell shell, final IResource[] resources, final IStatus status) {
final boolean[] result = new boolean[] { false};
Runnable runnable = new Runnable() {
public void run() {
@@ -180,15 +197,16 @@ public class CVSUIPlugin extends AbstractUIPlugin implements IPropertyChangeList
if (shell == null) {
shellToUse = new Shell(Display.getCurrent());
}
- result[0] = MessageDialog.openQuestion(shellToUse, Policy.bind("CVSUIPlugin.refreshTitle"),
- Policy.bind("CVSUIPlugin.refreshQuestion", status.getMessage(), resource.getFullPath().toString()));
+ String question;
+ if (resources.length == 1) {
+ question = Policy.bind("CVSUIPlugin.refreshQuestion", status.getMessage(), resources[0].getFullPath().toString());
+ } else {
+ question = Policy.bind("CVSUIPlugin.refreshMultipleQuestion", status.getMessage());
+ }
+ result[0] = MessageDialog.openQuestion(shellToUse, Policy.bind("CVSUIPlugin.refreshTitle"), question);
}
};
- if (shell == null) {
- Display.getDefault().syncExec(runnable);
- } else {
- runnable.run();
- }
+ Display.getDefault().syncExec(runnable);
return result[0];
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java
index 00beee131..2d4687c52 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java
@@ -18,13 +18,16 @@ import java.util.List;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
@@ -352,4 +355,37 @@ abstract public class CVSAction extends TeamAction {
}
return okToContinue[0];
}
+ /**
+ * @see IActionDelegate#selectionChanged(IAction, ISelection)
+ */
+ public void selectionChanged(final IAction action, ISelection selection) {
+ if (selection instanceof IStructuredSelection) {
+ this.selection = (IStructuredSelection) selection;
+ if (action != null) {
+ try {
+ CVSUIPlugin.runWithRefresh(getShell(), getSelectedResources(), new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ action.setEnabled(CVSAction.this.isEnabled());
+ } catch (TeamException e) {
+ throw new InvocationTargetException(e);
+ }
+ }
+ }, null);
+ } catch (InvocationTargetException e) {
+ action.setEnabled(false);
+ // We should not open a dialog when determining menu enablements so log it instead
+ CVSUIPlugin.log(CVSUIPlugin.asTeamException(e).getStatus());
+ } catch (InterruptedException e) {
+ action.setEnabled(false);
+ }
+ }
+ }
+ }
+
+ /**
+ * @see TeamAction#isEnabled()
+ */
+ protected abstract boolean isEnabled() throws TeamException;
+
} \ No newline at end of file
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 e87deb0d0..ab3af0a5d 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
@@ -201,6 +201,7 @@ CVSSyncCompareInput.confirmMergeMessage=Your changes have been saved. You can co
CVSUIPlugin.refreshTitle=Refresh Resource?
CVSUIPlugin.refreshQuestion={0} Would you like to refresh resource ''{1}''?
+CVSUIPlugin.refreshMultipleQuestion={0} Would you like to refresh the selected resources?
CheckoutAsAction.checkoutFailed=Problems encountered performing checkout
CheckoutAsAction.enterProjectTitle=Check Out {0} As...
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/AddSyncAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/AddSyncAction.java
index 807450043..c5d40e5f0 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/AddSyncAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/AddSyncAction.java
@@ -34,6 +34,7 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.sync.IRemoteSyncElement;
+import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
@@ -106,7 +107,12 @@ public class AddSyncAction extends MergeAction {
* Enabled for folders and files that aren't added.
*/
protected boolean isEnabled(ITeamNode node) {
- return new CVSSyncSet(new StructuredSelection(node)).hasNonAddedChanges();
+ try {
+ return new CVSSyncSet(new StructuredSelection(node)).hasNonAddedChanges();
+ } catch (CVSException e) {
+ CVSUIPlugin.log(e.getStatus());
+ return false;
+ }
}
/**
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 6d400a259..15482ff17 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
@@ -21,6 +21,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Composite;
@@ -271,6 +272,9 @@ public class CVSSyncCompareInput extends SyncCompareInput {
/**
* Wrap the input preparation in a CVS session run so open sessions will be reused and
* file contents under the same remote root folder will be fetched using the same connection.
+ *
+ * Also run with refresh prompting if one of the resources is out of sync with the local
+ * file system.
*/
public Object prepareInput(IProgressMonitor pm) throws InterruptedException, InvocationTargetException {
final Object[] result = new Object[] { null };
@@ -279,7 +283,11 @@ public class CVSSyncCompareInput extends SyncCompareInput {
Session.run(null, null, false, new ICVSRunnable() {
public void run(IProgressMonitor monitor) throws CVSException {
try {
- result[0] = CVSSyncCompareInput.super.prepareInput(monitor);
+ CVSUIPlugin.runWithRefresh(getShell(), resources, new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ result[0] = CVSSyncCompareInput.super.prepareInput(monitor);
+ }
+ }, monitor);
} catch (InterruptedException e) {
exception[0] = e;
} catch (InvocationTargetException e) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncSet.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncSet.java
index c7cb9161f..80a6568ad 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncSet.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncSet.java
@@ -9,9 +9,11 @@ import java.util.Iterator;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.team.core.sync.IRemoteSyncElement;
+import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
+import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ui.sync.ITeamNode;
import org.eclipse.team.internal.ui.sync.SyncSet;
@@ -29,7 +31,7 @@ public class CVSSyncSet extends SyncSet {
super(nodeSelection);
}
- public boolean hasNonAddedChanges() {
+ public boolean hasNonAddedChanges() throws CVSException {
for (Iterator it = getSyncSet().iterator(); it.hasNext();) {
ITeamNode node = (ITeamNode)it.next();
ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(node.getResource());
@@ -44,7 +46,7 @@ public class CVSSyncSet extends SyncSet {
return false;
}
- public boolean hasCommitableChanges() {
+ public boolean hasCommitableChanges() throws CVSException {
for (Iterator it = getSyncSet().iterator(); it.hasNext();) {
ITeamNode node = (ITeamNode)it.next();
// outgoing file that is added is a commit candidate
@@ -60,16 +62,22 @@ public class CVSSyncSet extends SyncSet {
public boolean removeNonAddedChanges() {
for (Iterator it = getSyncSet().iterator(); it.hasNext();) {
- ITeamNode node = (ITeamNode)it.next();
- ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(node.getResource());
- if(cvsResource.isFolder()) {
- if(!((ICVSFolder)cvsResource).isCVSFolder()) {
- it.remove();
- }
- } else {
- if(!cvsResource.isManaged()) {
- it.remove();
+ try {
+ ITeamNode node = (ITeamNode)it.next();
+ ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(node.getResource());
+ if(cvsResource.isFolder()) {
+ if(!((ICVSFolder)cvsResource).isCVSFolder()) {
+ it.remove();
+ }
+ } else {
+ if(!cvsResource.isManaged()) {
+ it.remove();
+ }
}
+ } catch (CVSException e) {
+ // isManaged or isCVSFolder threw an exception
+ // Log it and continue
+ CVSUIPlugin.log(e.getStatus());
}
}
return false;
@@ -77,16 +85,22 @@ public class CVSSyncSet extends SyncSet {
public boolean removeAddedChanges() {
for (Iterator it = getSyncSet().iterator(); it.hasNext();) {
- ITeamNode node = (ITeamNode)it.next();
- ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(node.getResource());
- if(cvsResource.isFolder()) {
- if(((ICVSFolder)cvsResource).isCVSFolder()) {
- it.remove();
- }
- } else {
- if(cvsResource.isManaged()) {
- it.remove();
+ try {
+ ITeamNode node = (ITeamNode)it.next();
+ ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(node.getResource());
+ if(cvsResource.isFolder()) {
+ if(((ICVSFolder)cvsResource).isCVSFolder()) {
+ it.remove();
+ }
+ } else {
+ if(cvsResource.isManaged()) {
+ it.remove();
+ }
}
+ } catch (CVSException e) {
+ // isManaged or isCVSFolder threw an exception
+ // Log it and continue
+ CVSUIPlugin.log(e.getStatus());
}
}
return false;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CommitSyncAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CommitSyncAction.java
index 4d452f44c..fe29c1ad9 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CommitSyncAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CommitSyncAction.java
@@ -14,9 +14,8 @@ package org.eclipse.team.internal.ccvs.ui.sync;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.team.internal.ccvs.core.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ui.sync.ITeamNode;
import org.eclipse.team.internal.ui.sync.SyncSet;
@@ -31,7 +30,12 @@ public class CommitSyncAction extends ForceCommitSyncAction {
protected boolean isEnabled(ITeamNode node) {
// The commit action is enabled only for non-conflicting outgoing changes
CVSSyncSet set = new CVSSyncSet(new StructuredSelection(node));
- return set.hasCommitableChanges();
+ try {
+ return set.hasCommitableChanges();
+ } catch (CVSException e) {
+ CVSUIPlugin.log(e.getStatus());
+ return false;
+ }
}
protected void removeNonApplicableNodes(SyncSet set, int syncMode) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/IgnoreAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/IgnoreAction.java
index 64bd9fbf7..c3765116b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/IgnoreAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/IgnoreAction.java
@@ -20,6 +20,7 @@ import org.eclipse.team.core.sync.IRemoteSyncElement;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
+import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.IgnoreResourcesDialog;
import org.eclipse.team.internal.ui.sync.ChangedTeamContainer;
import org.eclipse.team.internal.ui.sync.ITeamNode;
@@ -79,7 +80,12 @@ public class IgnoreAction extends Action {
if (node.getKind() != (ITeamNode.OUTGOING | IRemoteSyncElement.ADDITION)) return false;
IResource resource = node.getResource();
ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource);
- return !cvsResource.isManaged();
+ try {
+ return !cvsResource.isManaged();
+ } catch (CVSException e) {
+ CVSUIPlugin.log(e.getStatus());
+ return false;
+ }
}
public void update() {
IStructuredSelection selection = (IStructuredSelection)selectionProvider.getSelection();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
index e1049c652..a937810dd 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
@@ -326,7 +326,7 @@ public class SharingWizard extends Wizard implements IConfigurationWizard {
}
final boolean[] isCVSFolder = new boolean[] { false };
try {
- CVSUIPlugin.runWithRefresh(shell, project, new IRunnableWithProgress() {
+ CVSUIPlugin.runWithRefresh(shell, new IResource[] { project }, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
ICVSFolder folder = (ICVSFolder)CVSWorkspaceRoot.getCVSResourceFor(project);

Back to the top