Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-08-14 15:28:48 +0000
committerMichael Valenta2003-08-14 15:28:48 +0000
commit4a3191a78bdd9fadb87b93271b22663f40354ed7 (patch)
tree0a5f7e4d079facdb358a89083db03b8b900d1647
parentc43090707a1be0776a43709d1feeffe9a389dc5e (diff)
downloadeclipse.platform.team-4a3191a78bdd9fadb87b93271b22663f40354ed7.tar.gz
eclipse.platform.team-4a3191a78bdd9fadb87b93271b22663f40354ed7.tar.xz
eclipse.platform.team-4a3191a78bdd9fadb87b93271b22663f40354ed7.zip
Removing support for Session.run()
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Tag.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java41
2 files changed, 23 insertions, 21 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Tag.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Tag.java
index 7248a2f20..e7dba043e 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Tag.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Tag.java
@@ -79,11 +79,10 @@ public class Tag extends Command {
return execute(session, globalOptions, localOptions, newArguments, listener, monitor);
}
- public IStatus execute(GlobalOption[] globalOptions, LocalOption[] localOptions,
+ public IStatus execute(Session session, GlobalOption[] globalOptions, LocalOption[] localOptions,
CVSTag tag, ICVSResource[] arguments, ICommandOutputListener listener, IProgressMonitor monitor)
throws CVSException {
- Session session = getOpenSession(arguments);
String[] stringArguments = convertArgumentsForOpenSession(arguments, session);
return execute(session, globalOptions, localOptions, tag, stringArguments, listener, monitor);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java
index cfcfc08d9..bdb1d76c5 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java
@@ -39,12 +39,10 @@ import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.CVSStatus;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
-
import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
-import org.eclipse.team.internal.ccvs.core.ICVSRunnable;
import org.eclipse.team.internal.ccvs.core.IConnectionMethod;
import org.eclipse.team.internal.ccvs.core.IUserAuthenticator;
import org.eclipse.team.internal.ccvs.core.IUserInfo;
@@ -481,25 +479,30 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
*/
public void validateConnection(IProgressMonitor monitor) throws CVSException {
try {
+ monitor = Policy.monitorFor(monitor);
+ monitor.beginTask(null, 100);
ICVSFolder root = CVSWorkspaceRoot.getCVSFolderFor(ResourcesPlugin.getWorkspace().getRoot());
- Session.run(this, root, false, new ICVSRunnable() {
- public void run(IProgressMonitor monitor) throws CVSException {
- IStatus status = Command.VERSION.execute(null, CVSRepositoryLocation.this, monitor);
- // Log any non-ok status
- if (! status.isOK()) {
- CVSProviderPlugin.log(status);
- }
- if (getServerPlatform() == CVSNT_SERVER) {
- // check for the use of a repository prefix
- if (getRootDirectory().startsWith(Session.SERVER_SEPARATOR)) {
- // A prefix is in use. Log a warning
- CVSProviderPlugin.log(IStatus.WARNING, Policy.bind("CVSRepositoryLocation.cvsntPrefix", getLocation()), null); //$NON-NLS-1$
- throw new CVSAuthenticationException(new Status(IStatus.WARNING, CVSProviderPlugin.ID, 0,
- Policy.bind("CVSRepositoryLocation.cvsntPrefix", getLocation()), null)); //$NON-NLS-1$
- }
- }
+ Session session = new Session(this, root, false /* output to console */);
+ session.open(Policy.subMonitorFor(monitor, 50));
+ try {
+ IStatus status = Command.VERSION.execute(session, this, Policy.subMonitorFor(monitor, 50));
+ // Log any non-ok status
+ if (! status.isOK()) {
+ CVSProviderPlugin.log(status);
+ }
+ } finally {
+ session.close();
+ monitor.done();
+ }
+ if (getServerPlatform() == CVSNT_SERVER) {
+ // check for the use of a repository prefix
+ if (getRootDirectory().startsWith(Session.SERVER_SEPARATOR)) {
+ // A prefix is in use. Log a warning
+ CVSProviderPlugin.log(IStatus.WARNING, Policy.bind("CVSRepositoryLocation.cvsntPrefix", getLocation()), null); //$NON-NLS-1$
+ throw new CVSAuthenticationException(new Status(IStatus.WARNING, CVSProviderPlugin.ID, 0,
+ Policy.bind("CVSRepositoryLocation.cvsntPrefix", getLocation()), null)); //$NON-NLS-1$
}
- }, monitor);
+ }
} catch (CVSException e) {
// If the validation failed, dispose of any cached info
dispose();

Back to the top