Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-08-18 14:42:30 +0000
committerMichael Valenta2003-08-18 14:42:30 +0000
commitd8483f3e4e2d102366ff5c9156d48e2700fc02bd (patch)
treed876d1a966b9d4830dae0b8ef320ce0bccbce860
parent933efe278dcdb88399398129aa736d4e26050e0a (diff)
downloadeclipse.platform.team-d8483f3e4e2d102366ff5c9156d48e2700fc02bd.tar.gz
eclipse.platform.team-d8483f3e4e2d102366ff5c9156d48e2700fc02bd.tar.xz
eclipse.platform.team-d8483f3e4e2d102366ff5c9156d48e2700fc02bd.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java19
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java43
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java129
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java17
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Version.java3
5 files changed, 0 insertions, 211 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java
index e05339701..5f99078cc 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java
@@ -72,25 +72,6 @@ public class Add extends Command {
}
}
return status;
- }
-
- /**
- * Since the arguments of the add are probably not managed, find a parent of at least
- * one argument that is a CVS folder.
- *
- * @see Command#getOpenSession(ICVSResource[])
- */
- protected Session getOpenSession(ICVSResource[] arguments) throws CVSException {
- for (int i = 0; i < arguments.length; i++) {
- ICVSResource cvsResource = arguments[i];
- if (cvsResource.isManaged()) {
- return super.getOpenSession(new ICVSResource[] { cvsResource });
- } else if (cvsResource.getParent().isCVSFolder()) {
- return super.getOpenSession(new ICVSResource[] { cvsResource.getParent() });
- }
- }
- // If no approrpiate resource was found, invoke the overriden method and let it fail.
- return super.getOpenSession(arguments);
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java
index 6f0c3012e..9779eb93d 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java
@@ -17,7 +17,6 @@ import java.util.Map;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -33,7 +32,6 @@ import org.eclipse.team.internal.ccvs.core.ICVSRunnable;
import org.eclipse.team.internal.ccvs.core.Policy;
import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener;
import org.eclipse.team.internal.ccvs.core.client.listeners.IConsoleListener;
-import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
/**
* Abstract base class for command requests.
@@ -710,32 +708,6 @@ public abstract class Command extends Request {
}
/**
- * Execute a CVS command inside an ICVSRunnable passed to Session.run()
- * <p>
- * Dispatches the commands, retrieves the results, and determines whether or
- * not an error occurred. A listener may be supplied to capture message text
- * that would normally be written to the standard error and standard output
- * streams of a command line CVS client.
- * </p>
- * @param globalOptions the array of global options, or NO_GLOBAL_OPTIONS
- * @param localOptions the array of local options, or NO_LOCAL_OPTIONS
- * @param arguments the array of arguments (usually filenames relative to localRoot), or NO_ARGUMENTS
- * @param listener the command output listener, or null to discard all messages
- * @param monitor the progress monitor
- * @return a status code indicating success or failure of the operation
- * @throws CVSException if a fatal error occurs (e.g. connection timeout)
- *
- * @deprecated
- */
- public final IStatus execute(GlobalOption[] globalOptions, LocalOption[] localOptions, ICVSResource[] arguments,
- ICommandOutputListener listener, IProgressMonitor pm) throws CVSException {
-
- Session openSession = getOpenSession(arguments);
- String[] stringArguments = convertArgumentsForOpenSession(arguments, openSession);
- return execute(openSession, globalOptions, localOptions, stringArguments, listener, pm);
- }
-
- /**
* Execute a CVS command on an array of ICVSResource. This method simply converts
* the ICVSResource to String paths relative to the local root of the session and
* invokes <code>execute(Session, GlobalOption[], LocalOption[], String[], ICommandOutputListener, IProgressMonitor)</code>.
@@ -758,21 +730,6 @@ public abstract class Command extends Request {
return execute(session, globalOptions, localOptions, stringArguments, listener, pm);
}
- protected Session getOpenSession(ICVSResource[] arguments) throws CVSException {
- // We assume that all the passed resources have the same root
- Session openSession;
- if (arguments == null || arguments.length == 0) {
- // If there are no arguments to the command, assume that the command is rooted at the workspace root
- openSession = Session.getOpenSession(CVSWorkspaceRoot.getCVSFolderFor(ResourcesPlugin.getWorkspace().getRoot()));
- } else {
- openSession = Session.getOpenSession(arguments[0]);
- }
- if (openSession == null) {
- throw new CVSException(Policy.bind("Command.noOpenSession")); //$NON-NLS-1$
- }
- return openSession;
- }
-
protected String[] convertArgumentsForOpenSession(ICVSResource[] arguments, Session openSession) throws CVSException {
// Convert arguments
List stringArguments = new ArrayList(arguments.length);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java
index 730f72842..1c6844236 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java
@@ -45,7 +45,6 @@ import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.ICVSResourceVisitor;
-import org.eclipse.team.internal.ccvs.core.ICVSRunnable;
import org.eclipse.team.internal.ccvs.core.Policy;
import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption;
import org.eclipse.team.internal.ccvs.core.client.Command.QuietOption;
@@ -93,9 +92,6 @@ public class Session {
private static final boolean IS_CRLF_PLATFORM = Arrays.equals(
System.getProperty("line.separator").getBytes(), new byte[] { '\r', '\n' }); //$NON-NLS-1$
-
- private static Map currentOpenSessions = null;
- private static final int MAX_SESSIONS_OPEN = 10;
private CVSRepositoryLocation location;
private ICVSFolder localRoot;
@@ -141,131 +137,6 @@ public class Session {
this.outputToConsole = outputToConsole;
}
- /**
- * Execute the given runnable in a context that has access to an open session
- *
- * A session will be opened for the provided root. If the root is null, no session is opened.
- * However, sessions will be open for nested calls to run and these sessions will not be closed
- * until the outer most run finishes.
- *
- * @deprecated
- */
- public static void run(final ICVSRepositoryLocation location, final ICVSFolder root, final boolean outputToConsole,
- final ICVSRunnable runnable, final IProgressMonitor monitor) throws CVSException {
-
- // Serialize runnables to allow only one thread to run at a time.
- // TODO: The following removed due to bug 40129
-// CVSWorkspaceRoot.getCVSFolderFor(ResourcesPlugin.getWorkspace().getRoot()).run(new ICVSRunnable() {
-// public void run(IProgressMonitor monitor) throws CVSException {
- internalRun(location, root, outputToConsole, runnable, monitor);
-// }
-// }, monitor);
- }
-
- private static void internalRun(ICVSRepositoryLocation location, ICVSFolder root, boolean outputToConsole,
- ICVSRunnable runnable, IProgressMonitor monitor) throws CVSException {
-
- // Determine if we are nested or not
- boolean isOuterRun = false;
- if (currentOpenSessions == null) {
- // Initialize the variable to be a map
- currentOpenSessions = new HashMap();
- isOuterRun = true;
- }
-
- try {
- monitor = Policy.monitorFor(monitor);
- monitor.beginTask(null, 100);
- if (root == null) {
- // We don't have a root, so just run the runnable
- // (assuming that nested runs will create sessions)
- runnable.run(Policy.subMonitorFor(monitor, 90));
- } else {
- // Open a session on the root as far up the chain as possible
- ICVSFolder actualRoot = root;
- while (actualRoot.isManaged()) {
- actualRoot = actualRoot.getParent();
- }
- // Look for the root in the current open sessions
- Session session = (Session)currentOpenSessions.get(actualRoot);
- if (session == null) {
- // Make sure we don't exceed our maximum
- if (currentOpenSessions.size() == MAX_SESSIONS_OPEN) {
- // Pick one at random and close it
- Object key = currentOpenSessions.keySet().iterator().next();
- try {
- ((Session)currentOpenSessions.get(key)).close();
- } catch (CVSException e) {
- CVSProviderPlugin.log(e);
- } finally {
- currentOpenSessions.remove(key);
- }
- }
- // If it's not there, open a session for the given root and remember it
- session = new Session(location, actualRoot, outputToConsole);
- session.open(Policy.subMonitorFor(monitor, 10));
- currentOpenSessions.put(actualRoot, session);
- }
-
- try {
- root.run(runnable, Policy.subMonitorFor(monitor, 100));
- } catch (CVSException e) {
- // The run didn't succeed so close the session and forget it ever existed
- try {
- // The session may have been close by a nested run
- if (currentOpenSessions.get(actualRoot) != null) session.close();
- } finally {
- currentOpenSessions.remove(actualRoot);
- throw e;
- }
- }
- }
- } finally {
- monitor.done();
- if (isOuterRun) {
- // Close all open sessions
- try {
- Iterator iter = currentOpenSessions.keySet().iterator();
- while (iter.hasNext()) {
- Session session = (Session)currentOpenSessions.get(iter.next());
- try {
- session.close();
- } catch (CVSException e) {
- CVSProviderPlugin.log(e);
- }
- }
- } finally {
- currentOpenSessions = null;
- }
- }
- }
- }
-
- /**
- * Answer the currently open session
- */
- protected static Session getOpenSession(ICVSResource resource) throws CVSException {
- ICVSFolder root;
- if (resource.isFolder()) {
- root = (ICVSFolder)resource;
- } else {
- root = resource.getParent();
- }
- // go to the top of the management chain
- while (root.isManaged()) {
- root = root.getParent();
- }
- // Look for the root in the current open sessions
- Session session;
- do {
- session = (Session)currentOpenSessions.get(root);
- if (session != null) return session;
- // we should have found it the first time but continue up the chain
- root = root.getParent();
- } while (root != null);
- return null;
- }
-
/**
* Register a case collision with the session.
*
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java
index 5e0840ae7..d685e99ce 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java
@@ -100,23 +100,6 @@ public class Update extends Command {
}
/**
- * Convenience method that allows the creation of .# files to be disabled.
- * @param createBackups if true, creates .# files
- * @see Command.execute
- */
- public final IStatus execute(GlobalOption[] globalOptions,
- LocalOption[] localOptions, ICVSResource[] arguments, ICommandOutputListener listener,
- IProgressMonitor pm, boolean createBackups) throws CVSException {
-
- Session s = getOpenSession(arguments);
- s.setCreateBackups(createBackups);
- try {
- return super.execute(globalOptions, localOptions, arguments, listener, pm);
- } finally {
- s.setCreateBackups(true);
- }
- }
- /**
* On successful finish, prune empty directories if the -P or -D option was specified.
*/
protected IStatus commandFinished(Session session, GlobalOption[] globalOptions,
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Version.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Version.java
index 140a32e23..abb426e3f 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Version.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Version.java
@@ -43,9 +43,6 @@ public class Version extends RemoteCommand {
public IStatus execute(Session session, final ICVSRepositoryLocation location, IProgressMonitor monitor) throws CVSException {
// The server may not support the version request
- if (session == null) {
- session = getOpenSession(null);
- }
if ( ! session.isValidRequest(getRequestId())) {
IStatus status = new CVSStatus(IStatus.WARNING, CVSStatus.SERVER_IS_UNKNOWN, Policy.bind("Version.versionNotValidRequest", location.getHost()));//$NON-NLS-1$
((CVSRepositoryLocation)location).setServerPlaform(status);

Back to the top