Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.team.cvs.ui')
-rw-r--r--bundles/org.eclipse.team.cvs.ui/icons/full/cview16/annotate_view.gifbin253 -> 182 bytes
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.properties5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.xml21
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java122
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutIntoOperation.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutOperation.java22
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateAction.java41
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SyncInfoSetDetailsDialog.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/UpdateDialog.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsWizard.java21
14 files changed, 165 insertions, 99 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/icons/full/cview16/annotate_view.gif b/bundles/org.eclipse.team.cvs.ui/icons/full/cview16/annotate_view.gif
index b3823f4dc..d28c2519d 100644
--- a/bundles/org.eclipse.team.cvs.ui/icons/full/cview16/annotate_view.gif
+++ b/bundles/org.eclipse.team.cvs.ui/icons/full/cview16/annotate_view.gif
Binary files differ
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.properties b/bundles/org.eclipse.team.cvs.ui/plugin.properties
index 5578d3cd7..2cae29824 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.properties
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.properties
@@ -176,7 +176,10 @@ CVSWorkspaceSubscriber.commit.label=&Commit
CVSWorkspaceSubscriber.commit.tooltip=Perform a commit on the visible resources
CVSWorkspaceSubscriber.overcommit.label=&Override and Commit
-CVSWorkspaceSubscriber.overcommit.tooltip=Perform an override and commit on the visible resources. This will make the remote contents equal to the local.
+CVSWorkspaceSubscriber.overcommit.tooltip=Perform an override and commit on the visible resources. This will make the remote contents equal to the local ignoring any remote changes.
+
+CVSWorkspaceSubscriber.overupdate.label=O&verride and Update
+CVSWorkspaceSubscriber.overupdate.tooltip=Perform an override and update on the visible resources. This will make the local contents equal to the remote ignoring any local changes.
CVSWorkspaceSubscriber.confirmMerged.label=&Mark as Merged
CVSWorkspaceSubscriber.confirmMerged.tooltip=Mark the conflict as merged by upgrading the base to match the remote
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml b/bundles/org.eclipse.team.cvs.ui/plugin.xml
index 8994a5754..8d79739e8 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml
@@ -572,7 +572,7 @@
<action
label="%CVSWorkspaceSubscriber.confirmMerged.label"
- menubarPath="SubscriberActions"
+ menubarPath="SubscriberActionsGroup2"
tooltip="%CVSWorkspaceSubscriber.confirmMerged.tooltip"
class="org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberConfirmMergedAction"
helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_confirm_merged_action"
@@ -581,16 +581,25 @@
<action
label="%CVSWorkspaceSubscriber.overcommit.label"
- menubarPath="SubscriberActions"
+ menubarPath="SubscriberActionsGroup2"
tooltip="%CVSWorkspaceSubscriber.overcommit.tooltip"
class="org.eclipse.team.internal.ccvs.ui.subscriber.OverrideAndCommitAction"
helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_overcommit_action"
id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.overcommit">
</action>
+
+ <action
+ label="%CVSWorkspaceSubscriber.overupdate.label"
+ menubarPath="SubscriberActionsGroup2"
+ tooltip="%CVSWorkspaceSubscriber.overupdate.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.subscriber.OverrideAndUpdateAction"
+ helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_overupdate_action"
+ id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.overupdate">
+ </action>
<action
label="%CVSWorkspaceSubscriber.commit.label"
- menubarPath="SubscriberActions"
+ menubarPath="SubscriberActionsGroup1"
tooltip="%CVSWorkspaceSubscriber.commit.tooltip"
class="org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberCommitAction"
overrideActionId="org.eclipse.team.ccvs.ui.commit"
@@ -600,7 +609,7 @@
<action
label="%CVSWorkspaceSubscriber.update.label"
- menubarPath="SubscriberActions"
+ menubarPath="SubscriberActionsGroup1"
tooltip="%CVSWorkspaceSubscriber.update.tooltip"
class="org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceUpdateAction"
overrideActionId="org.eclipse.team.ccvs.ui.update"
@@ -618,7 +627,7 @@
<action
label="%CVSWorkspaceSubscriber.confirmMerged.label"
- menubarPath="SubscriberActions"
+ menubarPath="SubscriberActionsGroup1"
tooltip="%CVSWorkspaceSubscriber.confirmMerged.tooltip"
class="org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberConfirmMergedAction"
helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_confirm_merged_action"
@@ -627,7 +636,7 @@
<action
label="%CVSWorkspaceSubscriber.merge.label"
- menubarPath="SubscriberActions"
+ menubarPath="SubscriberActionsGroup1"
tooltip="%CVSWorkspaceSubscriber.merge.tooltip"
class="org.eclipse.team.internal.ccvs.ui.subscriber.MergeUpdateAction"
overrideActionId="org.eclipse.team.ccvs.ui.update"
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java
index e43dc7f0e..777db2ae4 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java
@@ -44,7 +44,6 @@ import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.IResourceStateChangeListener;
import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
-import org.eclipse.team.internal.ccvs.core.resources.EclipseSynchronizer;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.core.ExceptionCollector;
@@ -157,11 +156,6 @@ public class CVSLightweightDecorator
*/
public void decorate(Object element, IDecoration decoration) {
- // Make sure that the decorator thread only has read access to the CVS sync info.
- // This will register the thread on each decoration but it's the only way we
- // know of to ensure the proper thread is registered.
- EclipseSynchronizer.getInstance().addReadOnlyThread(Thread.currentThread());
-
IResource resource = getResource(element);
if (resource == null || resource.getType() == IResource.ROOT)
return;
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 dbcfe8c36..bbc118041 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
@@ -1006,10 +1006,13 @@ HasProjectMetaFile.taskName=Looking for a remote meta file
TagFromWorkspace.taskName=Tagging from workspace
TagFromRepository.taskName=Tagging from repository
UpdateOnlyMergeable.taskName=Updating mergeable changes
-UpdateDialog.overwriteTitle=Overwrite Unmergable Resources?
-UpdateDialog.overwriteMessage=All mergable resources have been updated. However, some non-mergable resources remain. Should these resources be updated, overwriting any local changes?
+UpdateDialog.overwriteTitle=Overwrite Local Changes?
+UpdateDialog.overwriteMessage=Some conflicting files cannot be merged automatically with the update action. Should these resources be updated, overwriting any local changes?
ReplaceOperation.taskName=Replacing...
UpdateOperation.taskName=Updating...
+SafeUpdateAction.warnFilesWithConflictsTitle=Non-mergeable files
+SafeUpdateAction.warnFilesWithConflictsDescription=Some conflicting files cannot be merged automatically with the update action. They contain conflicting changes that will have to be merged manually. Use the Synchronize View to find the conflicts then merge the changes in a compare editor.
+
Error.unableToShowSyncView=Error opening Synchronize View. Please ensure that the Team plugin is installed correctly.
ShowAnnotationAction.1=Unexpected response from CVS Server: {0}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java
index 27cd58399..abaef6229 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CVSOperation.java
@@ -14,6 +14,9 @@ import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
@@ -25,12 +28,14 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSStatus;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
@@ -46,7 +51,7 @@ public abstract class CVSOperation implements IRunnableWithProgress {
private List errors = new ArrayList(); // of IStatus
- protected static final IStatus OK = new CVSStatus(IStatus.OK, Policy.bind("ok")); // $NON-NLS-1$
+ protected static final IStatus OK = new CVSStatus(IStatus.OK, Policy.bind("ok")); //$NON-NLS-1$
private IRunnableContext runnableContext;
private Shell shell;
@@ -56,6 +61,9 @@ public abstract class CVSOperation implements IRunnableWithProgress {
// instance variable used to indicate behavior while prompting for overwrite
private boolean confirmOverwrite = true;
+ // instance variable used to indicate that the operation is running in the background
+ private boolean runningAsJob = false;
+
public static void run(Shell shell, CVSOperation operation) throws CVSException, InterruptedException {
operation.setShell(shell);
operation.setRunnableContext(new ProgressMonitorDialog(shell));
@@ -90,19 +98,46 @@ public abstract class CVSOperation implements IRunnableWithProgress {
}
protected void runAsJob() {
- Job job = new Job(Policy.bind("CVSOperation.operationJobName", getTaskName())) {
+ Job job;
+ if (isModifiesWorkspace()) {
+ job = getWorkspaceJob();
+ } else {
+ job = getBasicJob();
+ }
+ runningAsJob = true;
+ job.schedule();
+ }
+
+ protected IStatus runInJob(IProgressMonitor monitor) {
+ try {
+ // Don't wrap inside the run since the WorkspaceJob will do the batching
+ CVSOperation.this.run(monitor, false /* wrap in ModifyOperation*/);
+ return Status.OK_STATUS;
+ } catch (InvocationTargetException e) {
+ return CVSException.wrapException(e).getStatus();
+ } catch (InterruptedException e) {
+ return Status.CANCEL_STATUS;
+ }
+ }
+
+ protected Job getBasicJob() {
+ return new Job(Policy.bind("CVSOperation.operationJobName", getTaskName())) { //$NON-NLS-1$
public IStatus run(IProgressMonitor monitor) {
- try {
- CVSOperation.this.run(monitor);
- return Status.OK_STATUS;
- } catch (InvocationTargetException e) {
- return CVSException.wrapException(e).getStatus();
- } catch (InterruptedException e) {
- return Status.CANCEL_STATUS;
- }
+ return CVSOperation.this.runInJob(monitor);
+ }
+ };
+ }
+
+ protected Job getWorkspaceJob() {
+ return new WorkspaceJob(Policy.bind("CVSOperation.operationJobName", getTaskName())) { //$NON-NLS-1$
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ return CVSOperation.this.runInJob(monitor);
}
};
- job.schedule();
+ }
+
+ protected void fireDelta() {
+ ResourcesPlugin.getWorkspace().checkpoint(false);
}
/**
@@ -140,9 +175,16 @@ public abstract class CVSOperation implements IRunnableWithProgress {
* @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
*/
public final void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ run(monitor, isModifiesWorkspace());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ private void run(IProgressMonitor monitor, boolean wrapInModifiyOperation) throws InvocationTargetException, InterruptedException {
startOperation();
try {
- if (isModifiesWorkspace()) {
+ if (wrapInModifiyOperation) {
new CVSWorkspaceModifyOperation(this).run(monitor);
} else {
execute(monitor);
@@ -153,7 +195,7 @@ public abstract class CVSOperation implements IRunnableWithProgress {
throw new InvocationTargetException(e);
}
}
-
+
protected void startOperation() {
statusCount = 0;
resetErrors();
@@ -193,51 +235,49 @@ public abstract class CVSOperation implements IRunnableWithProgress {
return runnableContext != null;
}
- /**
- * @return
- */
public Shell getShell() {
+ if (isRunningAsJob()) {
+ // We can't use the assigned shell as it may have been disposed
+ // run in syncExec because callback is from an operation,
+ // which is probably not running in the UI thread.
+ final Shell[] newShell = new Shell[] { null };
+ Display.getDefault().syncExec(
+ new Runnable() {
+ public void run() {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (window == null) {
+ Display display = Display.getDefault();
+ newShell[0] = new Shell(display);
+ } else {
+ newShell[0] = window.getShell();
+ }
+ }
+ });
+ return newShell[0];
+ }
return shell;
}
- /**
- * @param shell
- */
public void setShell(Shell shell) {
this.shell = shell;
}
- /**
- * @return
- */
public boolean isInterruptable() {
return interruptable;
}
- /**
- * @param b
- */
public void setInterruptable(boolean b) {
interruptable = b;
}
- /**
- * @return
- */
public boolean isModifiesWorkspace() {
return modifiesWorkspace;
}
- /**
- * @param b
- */
public void setModifiesWorkspace(boolean b) {
modifiesWorkspace = b;
}
- /**
- * @param status
- */
protected void addError(IStatus status) {
if (status.isOK()) return;
errors.add(status);
@@ -248,16 +288,10 @@ public abstract class CVSOperation implements IRunnableWithProgress {
if (!status.isOK()) addError(status);
}
- /**
- *
- */
protected void resetErrors() {
errors.clear();
}
- /**
- * @param statuses
- */
protected void handleErrors(IStatus[] errors) throws CVSException {
if (errors.length == 0) return;
if (errors.length == 1 && statusCount == 1) {
@@ -340,9 +374,6 @@ public abstract class CVSOperation implements IRunnableWithProgress {
return involvesMultipleResources;
}
- /**
- * @param b
- */
public void setInvolvesMultipleResources(boolean b) {
involvesMultipleResources = b;
}
@@ -354,4 +385,9 @@ public abstract class CVSOperation implements IRunnableWithProgress {
* @return
*/
protected abstract String getTaskName();
+
+ protected boolean isRunningAsJob() {
+ return runningAsJob;
+ }
+
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutIntoOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutIntoOperation.java
index 0bac821b6..c8a882032 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutIntoOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutIntoOperation.java
@@ -357,7 +357,7 @@ public class CheckoutIntoOperation extends CheckoutOperation {
}
manageFolders(targetFolders, repository.getLocation());
-
+ fireDelta();
} finally {
session.close();
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutOperation.java
index eb25545f7..fc27bd4d6 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutOperation.java
@@ -1,9 +1,13 @@
-/*
- * Created on 2-Jun-03
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.operations;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -12,12 +16,6 @@ import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder;
import org.eclipse.team.internal.ccvs.ui.Policy;
-/**
- * @author Administrator
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
public abstract class CheckoutOperation extends RemoteOperation {
public CheckoutOperation(Shell shell, ICVSRemoteFolder[] remoteFolders) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java
index eb1116078..1d11350d3 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CheckoutProjectOperation.java
@@ -396,7 +396,7 @@ public abstract class CheckoutProjectOperation extends CheckoutOperation {
/*
* Bring the provied projects into the workspace
*/
- private static void refreshProjects(IProject[] projects, IProgressMonitor monitor) throws CVSException {
+ private void refreshProjects(IProject[] projects, IProgressMonitor monitor) throws CVSException {
monitor.beginTask(null, projects.length * 100);
try {
for (int i = 0; i < projects.length; i++) {
@@ -411,7 +411,8 @@ public abstract class CheckoutProjectOperation extends CheckoutOperation {
CVSTeamProvider provider = (CVSTeamProvider)RepositoryProvider.getProvider(project, CVSProviderPlugin.getTypeId());
provider.setWatchEditEnabled(CVSProviderPlugin.getPlugin().isWatchEditEnabled());
}
-
+ // Allow deltas to be sent out
+ fireDelta();
} finally {
monitor.done();
}
@@ -429,7 +430,6 @@ public abstract class CheckoutProjectOperation extends CheckoutOperation {
*/
protected void checkout(ICVSRemoteFolder[] folders, IProgressMonitor monitor) throws CVSException {
checkout(folders, getTargetProjects(folders), monitor);
-
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateAction.java
index d2d54e130..02b747705 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateAction.java
@@ -21,6 +21,7 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.SyncInfo;
@@ -37,7 +38,10 @@ import org.eclipse.team.ui.sync.SyncInfoSet;
/**
* This update action will update all mergable resources first and then prompt the
- * user to iverwrite any resources that failed the safe update
+ * user to overwrite any resources that failed the safe update.
+ *
+ * Subclasses should determine how the update should handle conflicts by implementing
+ * the getOverwriteLocalChanges() method.
*/
public abstract class SafeUpdateAction extends CVSSubscriberAction {
@@ -71,12 +75,19 @@ public abstract class SafeUpdateAction extends CVSSubscriberAction {
return failedSet.getNodeFor(info.getLocal()) != null;
}
});
-
- // Ask the user if a replace should be performed on the remaining nodes
- if(getOverwriteLocalChanges()) {
- if (!failedSet.isEmpty() && promptForOverwrite(failedSet)) {
- overwriteUpdate(failedSet, Policy.subMonitorFor(monitor, willFail.length * 100));
- syncSet.addAll(failedSet);
+
+ // Handle conflicting files that can't be merged, ask the user what should be done.
+ if(! failedSet.isEmpty()) {
+ if(getOverwriteLocalChanges()) {
+ // Ask the user if a replace should be performed on the remaining nodes
+ if(promptForOverwrite(failedSet)) {
+ overwriteUpdate(failedSet, Policy.subMonitorFor(monitor, willFail.length * 100));
+ syncSet.addAll(failedSet);
+ }
+ } else {
+ // Warn the user that some nodes could not be updated. This can happen if there are
+ // files with conflicts that are not auto-mergeable.
+ warnAboutFailedResources(failedSet);
}
}
@@ -263,6 +274,22 @@ public abstract class SafeUpdateAction extends CVSSubscriberAction {
}
/**
+ * Warn user that some files could not be updated.
+ * Note: This method is designed to be overridden by test cases.
+ */
+ protected void warnAboutFailedResources(final SyncInfoSet syncSet) {
+ final int[] result = new int[] {Dialog.CANCEL};
+ final Shell shell = getShell();
+ shell.getDisplay().syncExec(new Runnable() {
+ public void run() {
+ MessageDialog.openInformation(shell,
+ Policy.bind("SafeUpdateAction.warnFilesWithConflictsTitle"), //$NON-NLS-1$
+ Policy.bind("SafeUpdateAction.warnFilesWithConflictsDescription")); //$NON-NLS-1$
+ }
+ });
+ }
+
+ /**
* This method is invoked for all resources in the sync set that are incoming deletions.
* It is done separately to allow deletions to be performed before additions that may
* be the same name with different letter case.
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SyncInfoSetDetailsDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SyncInfoSetDetailsDialog.java
index 9fa679b23..24db713ef 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SyncInfoSetDetailsDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SyncInfoSetDetailsDialog.java
@@ -46,14 +46,16 @@ public abstract class SyncInfoSetDetailsDialog extends DetailsDialog {
private SyncInfoSet syncSet;
private Object[] selectedResources;
+ private String detailsTitle;
/**
* @param parentShell
* @param dialogTitle
*/
- public SyncInfoSetDetailsDialog(Shell parentShell, String dialogTitle, SyncInfoSet syncSet) {
+ public SyncInfoSetDetailsDialog(Shell parentShell, String dialogTitle, String detailsTitle, SyncInfoSet syncSet) {
super(parentShell, dialogTitle);
this.syncSet = syncSet;
+ this.detailsTitle = detailsTitle;
}
/* (non-Javadoc)
@@ -74,7 +76,7 @@ public abstract class SyncInfoSetDetailsDialog extends DetailsDialog {
* @param composite
*/
private void addResourcesArea(Composite composite) {
- createWrappingLabel(composite, "The following resources will be effected by the update");
+ createWrappingLabel(composite, detailsTitle);
// add the selectable checkbox list
listViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/UpdateDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/UpdateDialog.java
index 5d088fcf9..9513ff072 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/UpdateDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/UpdateDialog.java
@@ -28,7 +28,7 @@ public class UpdateDialog extends SyncInfoSetDetailsDialog {
public static final int YES = IDialogConstants.YES_ID;
public UpdateDialog(Shell parentShell, SyncInfoSet syncSet) {
- super(parentShell, Policy.bind("UpdateDialog.overwriteTitle"), syncSet); //$NON-NLS-1$
+ super(parentShell, Policy.bind("UpdateDialog.overwriteTitle"), Policy.bind("UpdateDialog.overwriteDetailsTitle"), syncSet); //$NON-NLS-1$
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java
index ae9369d3e..3f7891a28 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java
@@ -98,6 +98,5 @@ public class WorkspaceUpdateAction extends SafeUpdateAction {
*/
protected void updated(IResource[] resources) throws TeamException {
// Do nothing
- }
-
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsWizard.java
index d09eea3ab..cb3ce06b3 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CheckoutAsWizard.java
@@ -174,19 +174,16 @@ public class CheckoutAsWizard extends Wizard {
private boolean performConfigureAndCheckout() throws CVSException, InterruptedException {
IProject newProject = getNewProject();
if (newProject == null) return false;
- new CheckoutSingleProjectOperation(getShell(), remoteFolders[0], newProject, null, true)
- .runInContext(getContainer());
+ // Run the checkout in the background
+ new CheckoutSingleProjectOperation(getShell(), remoteFolders[0], newProject, null, true).run();
return true;
}
- /**
- *
- */
private boolean performSingleCheckoutAs() throws CVSException, InterruptedException {
IProject newProject = ResourcesPlugin.getWorkspace().getRoot().getProject(mainPage.getProjectName());
String targetLocation = locationSelectionPage.getTargetLocation();
- new CheckoutSingleProjectOperation(getShell(), remoteFolders[0], newProject, targetLocation, false)
- .runInContext(getContainer());
+ // Run the checkout in the background
+ new CheckoutSingleProjectOperation(getShell(), remoteFolders[0], newProject, targetLocation, false).run();
return true;
}
@@ -196,14 +193,11 @@ public class CheckoutAsWizard extends Wizard {
*/
private boolean performMultipleCheckoutAs() throws CVSException, InterruptedException {
String targetLocation = locationSelectionPage.getTargetLocation();
- new CheckoutMultipleProjectsOperation(getShell(), remoteFolders, targetLocation)
- .runInContext(getContainer());
+ // Run the checkout in the background
+ new CheckoutMultipleProjectsOperation(getShell(), remoteFolders, targetLocation).run();
return true;
}
- /**
- * @return
- */
private boolean performCheckoutInto() throws CVSException, InterruptedException {
CheckoutIntoOperation operation;
boolean recursive = projectSelectionPage.isRecurse();
@@ -212,7 +206,8 @@ public class CheckoutAsWizard extends Wizard {
} else {
operation = new CheckoutIntoOperation(getShell(), remoteFolders, projectSelectionPage.getParentFolder(), recursive);
}
- operation.runInContext(getContainer());
+ // Run the checkout in the background
+ operation.run();
return true;
}

Back to the top