diff options
author | Michael Valenta | 2003-09-02 18:44:49 +0000 |
---|---|---|
committer | Michael Valenta | 2003-09-02 18:44:49 +0000 |
commit | 6b5d99090a75493c619449795e64dfd2eb53fe7c (patch) | |
tree | c0a3988de886fb37dc6ad0ec9c201c3eb84d7751 | |
parent | a719d1e856cb68e942d1be754f8d8b98634a803d (diff) | |
download | eclipse.platform.team-6b5d99090a75493c619449795e64dfd2eb53fe7c.tar.gz eclipse.platform.team-6b5d99090a75493c619449795e64dfd2eb53fe7c.tar.xz eclipse.platform.team-6b5d99090a75493c619449795e64dfd2eb53fe7c.zip |
41985: [CVS Conscurrency] Checkout must use scheduling rules
2 files changed, 25 insertions, 11 deletions
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 848dce159..fc36701b2 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 @@ -105,7 +105,6 @@ public abstract class CVSOperation implements IRunnableWithProgress { * @return */ protected ISchedulingRule getSchedulingRule() { - // TODO Auto-generated method stub return null; } 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 5e0a7579a..84564153f 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 @@ -22,6 +22,8 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.jobs.ISchedulingRule; import org.eclipse.swt.widgets.Shell; import org.eclipse.team.core.RepositoryProvider; import org.eclipse.team.core.TeamException; @@ -106,13 +108,6 @@ public class CheckoutIntoOperation extends CheckoutOperation { } /* (non-Javadoc) - * @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#execute(org.eclipse.core.runtime.IProgressMonitor) - */ - public void execute(IProgressMonitor monitor) throws CVSException, InterruptedException { - checkout(getRemoteFolders(), monitor); - } - - /* (non-Javadoc) * @see org.eclipse.team.internal.ccvs.ui.operations.CheckoutOperation#checkout(org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder, org.eclipse.core.runtime.IProgressMonitor) */ protected IStatus checkout(ICVSRemoteFolder folder, IProgressMonitor monitor) throws CVSException { @@ -124,9 +119,15 @@ public class CheckoutIntoOperation extends CheckoutOperation { */ protected void checkout(ICVSRemoteFolder[] folders, IProgressMonitor monitor) throws CVSException { monitor.beginTask(null, 100); - super.checkout(folders, Policy.subMonitorFor(monitor, 90)); - refreshRoot(getLocalRoot(getLocalFolder()), Policy.subMonitorFor(monitor, 10)); - monitor.done(); + try { + // Obtain a scheduling rule on the projects were about to overwrite + Platform.getJobManager().beginRule(getSchedulingRule()); + super.checkout(folders, Policy.subMonitorFor(monitor, 90)); + refreshRoot(getLocalRoot(getLocalFolder()), Policy.subMonitorFor(monitor, 10)); + } finally { + Platform.getJobManager().endRule(); + monitor.done(); + } } /* @@ -417,4 +418,18 @@ public class CheckoutIntoOperation extends CheckoutOperation { public String getName() { return getTaskName(); } + + /* (non-Javadoc) + * @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#getSchedulingRule() + */ + protected ISchedulingRule getSchedulingRule() { + try { + // Use the project of the target folder as the scheduling rule + return getLocalFolder().getIResource().getProject(); + } catch (CVSException e) { + CVSUIPlugin.log(e); + return null; + } + } + } |