Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-08-19 19:58:55 +0000
committerMichael Valenta2003-08-19 19:58:55 +0000
commit0c0eb9ee7304e8e2c408d2e479fbe58615934b7b (patch)
tree6a55d7d1b01960c04bb32d5a602c2318ac418e3f
parent8c6c83b49791b3bc89970a600294d52c85a2688a (diff)
downloadeclipse.platform.team-0c0eb9ee7304e8e2c408d2e479fbe58615934b7b.tar.gz
eclipse.platform.team-0c0eb9ee7304e8e2c408d2e479fbe58615934b7b.tar.xz
eclipse.platform.team-0c0eb9ee7304e8e2c408d2e479fbe58615934b7b.zip
Changes merged from HEAD and concurrent Checkout
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java83
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache.java14
-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
17 files changed, 202 insertions, 161 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java
index 9749ecf87..9e651c008 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMergeSubscriber.java
@@ -106,7 +106,7 @@ public class CVSMergeSubscriber extends CVSSyncTreeSubscriber implements IResour
String syncKeyPrefix = id.getLocalName();
remoteSynchronizer = new RemoteTagSynchronizer(syncKeyPrefix + end.getName(), end);
baseSynchronizer = new RemoteTagSynchronizer(syncKeyPrefix + start.getName(), start);
- mergedSynchronizer = new RemoteSynchronizer(syncKeyPrefix + "0merged");
+ mergedSynchronizer = new RemoteSynchronizer(syncKeyPrefix + "0merged"); //$NON-NLS-1$
try {
setCurrentComparisonCriteria(ContentComparisonCriteria.ID_IGNORE_WS);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
index 819a6aa60..0a1d7bc88 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
@@ -27,6 +27,8 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceStatus;
import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -55,6 +57,12 @@ import org.eclipse.team.internal.ccvs.core.util.SyncFileWriter;
* A synchronizer is responsible for managing synchronization information for local
* CVS resources.
*
+ * This class is thread safe but only allows one thread to modify the cache at a time. It
+ * doesn't support fine grain locking on a resource basis. Lock ordering between the workspace
+ * lock and the synchronizer lock is guaranteed to be deterministic. That is, the workspace
+ * lock is *always* acquired before the synchronizer lock. This protects against possible
+ * deadlock cases where the synchronizer lock is acquired before a workspace lock.
+ *
* Special processing has been added for linked folders and their childen so
* that their CVS meta files are never read or written.
*
@@ -123,7 +131,7 @@ public class EclipseSynchronizer {
Policy.bind("EclipseSynchronizer.ErrorSettingFolderSync", folder.getFullPath().toString())); //$NON-NLS-1$
}
try {
- beginOperation(null);
+ beginOperation(folder, null);
// get the old info
FolderSyncInfo oldInfo = getFolderSync(folder);
// set folder sync and notify
@@ -148,7 +156,7 @@ public class EclipseSynchronizer {
public FolderSyncInfo getFolderSync(IContainer folder) throws CVSException {
if (folder.getType() == IResource.ROOT || !isValid(folder)) return null;
try {
- beginOperation(null);
+ beginOperation(folder, null);
cacheFolderSync(folder);
return getSyncInfoCacheFor(folder).getCachedFolderSync(folder);
} finally {
@@ -166,7 +174,7 @@ public class EclipseSynchronizer {
public void deleteFolderSync(IContainer folder) throws CVSException {
if (folder.getType() == IResource.ROOT || !isValid(folder)) return;
try {
- beginOperation(null);
+ beginOperation(folder, null);
// iterate over all children with sync info and prepare notifications
// this is done first since deleting the folder sync may remove a phantom
cacheResourceSyncForChildren(folder);
@@ -203,7 +211,7 @@ public class EclipseSynchronizer {
Policy.bind("EclipseSynchronizer.ErrorSettingResourceSync", resource.getFullPath().toString())); //$NON-NLS-1$
}
try {
- beginOperation(null);
+ beginOperation(resource, null);
// cache resource sync for siblings, set for self, then notify
cacheResourceSyncForChildren(parent);
setCachedResourceSync(resource, info);
@@ -237,7 +245,7 @@ public class EclipseSynchronizer {
IContainer parent = resource.getParent();
if (parent == null || parent.getType() == IResource.ROOT || !isValid(parent)) return null;
try {
- beginOperation(null);
+ beginOperation(resource, null);
// cache resource sync for siblings, then return for self
try {
cacheResourceSyncForChildren(parent);
@@ -272,7 +280,7 @@ public class EclipseSynchronizer {
Policy.bind("EclipseSynchronizer.ErrorSettingResourceSync", resource.getFullPath().toString())); //$NON-NLS-1$
}
try {
- beginOperation(null);
+ beginOperation(resource, null);
// cache resource sync for siblings, set for self, then notify
cacheResourceSyncForChildren(parent);
setCachedSyncBytes(resource, syncBytes);
@@ -292,7 +300,7 @@ public class EclipseSynchronizer {
IContainer parent = resource.getParent();
if (parent == null || parent.getType() == IResource.ROOT || !isValid(parent)) return;
try {
- beginOperation(null);
+ beginOperation(resource, null);
// cache resource sync for siblings, delete for self, then notify
cacheResourceSyncForChildren(parent);
if (getCachedSyncBytes(resource) != null) { // avoid redundant notifications
@@ -327,7 +335,7 @@ public class EclipseSynchronizer {
return false;
}
try {
- beginOperation(null);
+ beginOperation(resource, null);
FileNameMatcher matcher = cacheFolderIgnores(resource.getParent());
return matcher.match(resource.getName());
} finally {
@@ -347,7 +355,7 @@ public class EclipseSynchronizer {
Policy.bind("EclipseSynchronizer.ErrorSettingIgnorePattern", folder.getFullPath().toString())); //$NON-NLS-1$
}
try {
- beginOperation(null);
+ beginOperation(folder, null);
String[] ignores = SyncFileWriter.readCVSIgnoreEntries(folder);
if (ignores != null) {
// verify that the pattern has not already been added
@@ -383,7 +391,7 @@ public class EclipseSynchronizer {
public IResource[] members(IContainer folder) throws CVSException {
if (! isValid(folder)) return new IResource[0];
try {
- beginOperation(null);
+ beginOperation(folder, null);
if (folder.getType() != IResource.ROOT) {
// ensure that the sync info is cached so any required phantoms are created
cacheResourceSyncForChildren(folder);
@@ -401,7 +409,9 @@ public class EclipseSynchronizer {
*
* @param monitor the progress monitor, may be null
*/
- public void beginOperation(IProgressMonitor monitor) throws CVSException {
+ public void beginOperation(IResource resource, IProgressMonitor monitor) throws CVSException {
+ // ensure locks are acquired in the same order: workspace then cvs
+ Platform.getJobManager().beginRule(resource);
lock.acquire();
if (lock.getDepth() == 1) {
@@ -421,7 +431,7 @@ public class EclipseSynchronizer {
* @exception CVSException with a status with code <code>COMMITTING_SYNC_INFO_FAILED</code>
* if all the CVS sync information could not be written to disk.
*/
- public void endOperation(IProgressMonitor monitor) throws CVSException {
+ public void endOperation(IProgressMonitor monitor) throws CVSException {
try {
IStatus status = SyncInfoCache.STATUS_OK;
if (lock.getDepth() == 1) {
@@ -431,7 +441,9 @@ public class EclipseSynchronizer {
throw new CVSException(status);
}
} finally {
- lock.release();
+ // ensure locks are released in the same order: cvs then workspace
+ lock.release();
+ Platform.getJobManager().endRule();
}
}
@@ -459,7 +471,7 @@ public class EclipseSynchronizer {
monitor = Policy.monitorFor(monitor);
monitor.beginTask(null, 10);
try {
- beginOperation(Policy.subMonitorFor(monitor, 1));
+ beginOperation(root, Policy.subMonitorFor(monitor, 1));
IStatus status = commitCache(Policy.subMonitorFor(monitor, 7));
@@ -528,7 +540,7 @@ public class EclipseSynchronizer {
public void prepareForDeletion(IResource resource) throws CVSException {
if (!resource.exists()) return;
try {
- beginOperation(null);
+ beginOperation(resource, null);
// Flush the dirty info for the resource and it's ancestors.
// Although we could be smarter, we need to do this because the
// deletion may fail.
@@ -573,7 +585,7 @@ public class EclipseSynchronizer {
protected void handleDeleted(IResource resource) throws CVSException {
if (resource.exists()) return;
try {
- beginOperation(null);
+ beginOperation(resource, null);
adjustDirtyStateRecursively(resource, RECOMPUTE_INDICATOR);
} finally {
endOperation(null);
@@ -635,7 +647,7 @@ public class EclipseSynchronizer {
private void created(IFolder folder) throws CVSException {
try {
// set the dirty count using what was cached in the phantom it
- beginOperation(null);
+ beginOperation(folder, null);
FolderSyncInfo folderInfo = synchronizerCache.getCachedFolderSync(folder);
byte[] syncBytes = synchronizerCache.getCachedSyncBytes(folder);
if (folderInfo != null && syncBytes != null) {
@@ -687,7 +699,7 @@ public class EclipseSynchronizer {
private void created(IFile file) throws CVSException {
try {
// set the dirty count using what was cached in the phantom it
- beginOperation(null);
+ beginOperation(file, null);
byte[] syncBytes = synchronizerCache.getCachedSyncBytes(file);
if (syncBytes == null) return;
byte[] newBytes = getSyncBytes(file);
@@ -802,10 +814,6 @@ public class EclipseSynchronizer {
if (changedFolders.isEmpty() && changedResources.isEmpty()) {
return SyncInfoCache.STATUS_OK;
}
- if (!isWorkspaceModifiable()) {
- // if the workspace is closed for modification, we'll wait until the next commit
- return SyncInfoCache.STATUS_OK;
- }
List errors = new ArrayList();
try {
/*** prepare operation ***/
@@ -1245,7 +1253,7 @@ public class EclipseSynchronizer {
for (int i = 0; i < folders.length; i++) {
IContainer parent = folders[i];
try {
- beginOperation(null);
+ beginOperation(parent, null);
cacheResourceSyncForChildren(parent);
cacheFolderSync(parent);
cacheFolderIgnores(parent);
@@ -1296,7 +1304,8 @@ public class EclipseSynchronizer {
monitor = Policy.monitorFor(monitor);
monitor.beginTask(null, 100);
try {
- beginOperation(Policy.subMonitorFor(monitor, 5));
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ beginOperation(root, Policy.subMonitorFor(monitor, 5));
job.run(Policy.subMonitorFor(monitor, 60));
} finally {
endOperation(Policy.subMonitorFor(monitor, 35));
@@ -1317,7 +1326,7 @@ public class EclipseSynchronizer {
private void adjustDirtyStateRecursively(IResource resource, String indicator) throws CVSException {
if (resource.getType() == IResource.ROOT) return;
try {
- beginOperation(null);
+ beginOperation(resource, null);
if (indicator == getDirtyIndicator(resource)) {
return;
@@ -1348,7 +1357,7 @@ public class EclipseSynchronizer {
protected String getDirtyIndicator(IResource resource) throws CVSException {
try {
- beginOperation(null);
+ beginOperation(resource, null);
return getSyncInfoCacheFor(resource).getDirtyIndicator(resource);
} finally {
endOperation(null);
@@ -1362,7 +1371,7 @@ public class EclipseSynchronizer {
*/
protected void setDirtyIndicator(IResource resource, boolean modified) throws CVSException {
try {
- beginOperation(null);
+ beginOperation(resource, null);
String indicator = modified ? IS_DIRTY_INDICATOR : NOT_DIRTY_INDICATOR;
// set the dirty indicator and adjust the parent accordingly
adjustDirtyStateRecursively(resource, indicator);
@@ -1450,24 +1459,4 @@ public class EclipseSynchronizer {
return ICVSFile.UNKNOWN;
}
}
-
- /**
- * If this method return false, the caller should not perform any workspace modification
- * operations. The danger of performing such an operation is deadlock.
- *
- * @return boolean
- */
- protected boolean isWorkspaceModifiable() {
- return true; //!lock.isReadOnly();
- }
-
- /**
- * Register the given thread as a thread that should be resitricted to having read-only access.
- * If a thread is not registered, it is expected that they obtain the workspace lock before
- * accessing any CVS sync information.
- * @param thread
- */
- public void addReadOnlyThread(Thread thread) {
- //lock.addReadOnlyThread(thread);
- }
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache.java
index e9ae37b49..42640195f 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache.java
@@ -27,7 +27,6 @@ import org.eclipse.core.runtime.CoreException;
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.Policy;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.core.util.SyncFileWriter;
@@ -143,11 +142,9 @@ import org.eclipse.team.internal.ccvs.core.util.Util;
try {
if (info == null) {
if (container.exists() || container.isPhantom()) {
- ensureWorkspaceModifiable(container);
getWorkspaceSynchronizer().flushSyncInfo(FOLDER_SYNC_KEY, container, IResource.DEPTH_ZERO);
}
} else {
- ensureWorkspaceModifiable(container);
getWorkspaceSynchronizer().setSyncInfo(FOLDER_SYNC_KEY, container, info.getBytes());
}
} catch (CoreException e) {
@@ -181,7 +178,6 @@ import org.eclipse.team.internal.ccvs.core.util.Util;
// We do this to avoid causing a resource delta when the sync info is
// initially loaded (i.e. the synchronizer has it and so does the Entries file
if (oldBytes == null || !Util.equals(syncBytes, oldBytes)) {
- ensureWorkspaceModifiable(resource);
getWorkspaceSynchronizer().setSyncInfo(RESOURCE_SYNC_KEY, resource, syncBytes);
}
}
@@ -275,16 +271,6 @@ import org.eclipse.team.internal.ccvs.core.util.Util;
}
/**
- *
- */
- protected void ensureWorkspaceModifiable(IResource resource) throws CVSException {
- if (!EclipseSynchronizer.getInstance().isWorkspaceModifiable()) {
- throw new CVSException(Policy.bind("EclipseSynchronizer.workspaceClosedForResource", resource.getFullPath().toString())); //$NON-NLS-1$
- }
-
- }
-
- /**
* @param root
* @param deep
*/
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