Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-03-14 20:25:39 +0000
committerMichael Valenta2002-03-14 20:25:39 +0000
commit6c2f1ccc9b97184edaef9b0d93d5d05ba86b5aa5 (patch)
tree77588453b76d531b982ff66a668b9c1dfa685daa
parent9622a24da4b92deb89cc4729c7750c053fd5390d (diff)
downloadeclipse.platform.team-6c2f1ccc9b97184edaef9b0d93d5d05ba86b5aa5.tar.gz
eclipse.platform.team-6c2f1ccc9b97184edaef9b0d93d5d05ba86b5aa5.tar.xz
eclipse.platform.team-6c2f1ccc9b97184edaef9b0d93d5d05ba86b5aa5.zip
Added cancel checking
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/DiffStructureVisitor.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TagFileSender.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ValidRequests.java11
4 files changed, 20 insertions, 0 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java
index 43c02c6d5..9d96ab72c 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java
@@ -77,6 +77,8 @@ abstract class AbstractStructureVisitor implements ICVSResourceVisitor {
*/
protected void sendFolder(ICVSFolder mFolder) throws CVSException {
+ Policy.checkCanceled(monitor);
+
// Do not send the same folder twice
if (isLastSent(mFolder)) return;
@@ -130,6 +132,8 @@ abstract class AbstractStructureVisitor implements ICVSResourceVisitor {
*/
protected void sendFile(ICVSFile mFile) throws CVSException {
+ Policy.checkCanceled(monitor);
+
// Send the file's entry line to the server
ResourceSyncInfo info = null;
boolean isManaged = mFile.isManaged();
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/DiffStructureVisitor.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/DiffStructureVisitor.java
index 15a9a1251..4e7cadae3 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/DiffStructureVisitor.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/DiffStructureVisitor.java
@@ -6,6 +6,7 @@ package org.eclipse.team.internal.ccvs.core.client;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.Policy;
import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
@@ -28,6 +29,8 @@ class DiffStructureVisitor extends FileStructureVisitor {
boolean binary = mode != null && KSubstOption.fromMode(mode).isBinary();
boolean newFile = false;
+ Policy.checkCanceled(monitor);
+
if (mFile.isManaged()) {
session.sendEntry(mFile.getSyncInfo().getEntryLine(false));
} else {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TagFileSender.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TagFileSender.java
index f6a131e52..2394b9f13 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TagFileSender.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/TagFileSender.java
@@ -8,6 +8,7 @@ package org.eclipse.team.internal.ccvs.core.client;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.Policy;
import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
@@ -26,6 +27,7 @@ class TagFileSender extends FileStructureVisitor {
* Added resources are skipped. Deleted resources are sent as if they were not deleted.
*/
protected void sendFile(ICVSFile mFile) throws CVSException {
+ Policy.checkCanceled(monitor);
if (mFile.isManaged()) {
// Send the parent folder if it hasn't been sent already
sendFolder(mFile.getParent());
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ValidRequests.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ValidRequests.java
index fe10f61f0..5eb56d7a3 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ValidRequests.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ValidRequests.java
@@ -25,4 +25,15 @@ class ValidRequests extends Command {
protected void sendLocalWorkingDirectory(Session session) throws CVSException {
}
+
+ /**
+ * Returns the default global options for all commands. Subclasses can override but
+ * must call this method and return superclasses global options.
+ *
+ * @param globalOptions are the options already specified by the user.
+ * @return the default global options that will be sent with every command.
+ */
+ protected GlobalOption[] getDefaultGlobalOptions(Session session, GlobalOption[] globalOptions, LocalOption[] localOptions) {
+ return Command.NO_GLOBAL_OPTIONS;
+ }
}

Back to the top