Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2002-02-26 16:07:21 -0500
committerjames2002-02-26 16:07:21 -0500
commitd877db3731e29bd28b99f16f11d4527ae66a5d11 (patch)
tree90ac30009fbe5c45e68e10a6c5d858e41a520fb1
parentcef705c95a345e904f50cc0abd34d3929aac66e8 (diff)
downloadeclipse.platform.team-d877db3731e29bd28b99f16f11d4527ae66a5d11.tar.gz
eclipse.platform.team-d877db3731e29bd28b99f16f11d4527ae66a5d11.tar.xz
eclipse.platform.team-d877db3731e29bd28b99f16f11d4527ae66a5d11.zip
9312: Checkout progress bar doesn't reflect reality
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java65
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java7
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java1
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java34
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties1
5 files changed, 59 insertions, 49 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java
index a99d2a8f5..824d4dd99 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java
@@ -137,38 +137,42 @@ public class CVSProvider implements ICVSProvider {
// Perform a checkout
IStatus status;
Session s = new Session(repository, root);
- s.open(monitor);
+ monitor.beginTask(null, 100);
try {
- status = Command.CHECKOUT.execute(s,
- getDefaultGlobalOptions(),
- (LocalOption[])localOptions.toArray(new LocalOption[localOptions.size()]),
- new String[]{module},
- null,
- monitor);
- } finally {
- s.close();
- }
- if (status.getCode() == CVSStatus.SERVER_ERROR) {
- throw new CVSServerException(status);
- }
-
- try {
- // Create, open and/or refresh the project
- if (!project.exists())
- project.create(Policy.subMonitorFor(monitor, 1));
- if (!project.isOpen())
- project.open(Policy.subMonitorFor(monitor, 5));
- else
- project.refreshLocal(IResource.DEPTH_INFINITE, Policy.subMonitorFor(monitor, 5));
-
- // Register the project with Team
- // (unless the project already has the proper nature from the project meta-information)
- if (!project.getDescription().hasNature(CVSProviderPlugin.NATURE_ID)) {
- TeamPlugin.getManager().setProvider(project, CVSProviderPlugin.NATURE_ID, null, Policy.subMonitorFor(monitor, 1));
+ // Opening the session takes 10% of the time
+ s.open(Policy.subMonitorFor(monitor, 10));
+ try {
+ status = Command.CHECKOUT.execute(s,
+ getDefaultGlobalOptions(),
+ (LocalOption[])localOptions.toArray(new LocalOption[localOptions.size()]),
+ new String[]{module},
+ null,
+ Policy.subMonitorFor(monitor, 80));
+ } finally {
+ s.close();
+ }
+ if (status.getCode() == CVSStatus.SERVER_ERROR) {
+ throw new CVSServerException(status);
}
- } catch (CoreException e) {
- throw wrapException(e);
+ try {
+ // Create, open and/or refresh the project
+ if (!project.exists())
+ project.create(Policy.subMonitorFor(monitor, 1));
+ if (!project.isOpen())
+ project.open(Policy.subMonitorFor(monitor, 5));
+ else
+ project.refreshLocal(IResource.DEPTH_INFINITE, Policy.subMonitorFor(monitor, 5));
+
+ // Register the project with Team
+ // (unless the project already has the proper nature from the project meta-information)
+ if (!project.getDescription().hasNature(CVSProviderPlugin.NATURE_ID)) {
+ TeamPlugin.getManager().setProvider(project, CVSProviderPlugin.NATURE_ID, null, Policy.subMonitorFor(monitor, 1));
+ }
+
+ } catch (CoreException e) {
+ throw wrapException(e);
+ }
} finally {
monitor.done();
}
@@ -200,13 +204,14 @@ public class CVSProvider implements ICVSProvider {
// XXX: temporary code to support creating a java project for sources in CVS
// should be removed once nature support is added to the UI.
// delete children, keep project
- pm.subTask("Srubbing local project...");
+ pm.subTask(Policy.bind("CVSProvider.Scrubbing_local_project_1")); //$NON-NLS-1$
IResource[] children = project.members();
IProgressMonitor subMonitor = Policy.subMonitorFor(pm, 90);
subMonitor.beginTask(null, children.length * 100);
for (int j = 0; j < children.length; j++) {
children[j].delete(true /*force*/, Policy.subMonitorFor(subMonitor, 100));
}
+ subMonitor.done();
}
checkout(resource.getRepository(), project, resource.getRepositoryRelativePath(), resource.getTag(), Policy.subMonitorFor(pm, 900));
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java
index 8dd896d42..419e1b0fc 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java
@@ -10,6 +10,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.team.ccvs.core.CVSStatus;
import org.eclipse.team.ccvs.core.CVSTag;
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.GlobalOption;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.core.client.Command.Option;
@@ -110,10 +111,10 @@ public class Checkout extends Command {
public IStatus execute(Session session, GlobalOption[] globalOptions,
LocalOption[] localOptions, String[] arguments, ICommandOutputListener listener,
IProgressMonitor monitor) throws CVSException {
-
+ monitor.beginTask(null, 100);
// Execute the expand-modules command.
// This will put the expansions in the session for later retrieval
- IStatus status = EXPAND_MODULES.execute(session, arguments, monitor);
+ IStatus status = EXPAND_MODULES.execute(session, arguments, Policy.subMonitorFor(monitor, 10));
if (status.getCode() == CVSStatus.SERVER_ERROR)
return status;
@@ -127,7 +128,7 @@ public class Checkout extends Command {
}
}
- return super.execute(session, globalOptions, localOptions, arguments, listener, monitor);
+ return super.execute(session, globalOptions, localOptions, arguments, listener, Policy.subMonitorFor(monitor, 90));
}
/**
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 fbabbe0d0..bbaf2f28c 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
@@ -401,7 +401,6 @@ public abstract class Command {
// Finished adds last 5% of work.
commandFinished(session, gOptions, lOptions, resources, Policy.subMonitorFor(monitor, 5),
status.getCode() != CVSStatus.SERVER_ERROR);
- monitor.worked(5);
return status;
} finally {
// Give the synchronizer a chance to persist any pending changes.
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 99082478a..1f0b7e2a4 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
@@ -137,20 +137,25 @@ public class Session {
*/
public void open(IProgressMonitor monitor) throws CVSException {
if (connection != null) throw new IllegalStateException();
- connection = location.openConnection(monitor);
-
- // tell the server the names of the responses we can handle
- connection.writeLine("Valid-responses " + Command.makeResponseList()); //$NON-NLS-1$
-
- // ask for the set of valid requests
- boolean saveOutputToConsole = outputToConsole;
- outputToConsole = false;
- Command.VALID_REQUESTS.execute(this, Command.NO_GLOBAL_OPTIONS, Command.NO_LOCAL_OPTIONS,
- Command.NO_ARGUMENTS, null, monitor);
- outputToConsole = saveOutputToConsole;
-
- // set the root directory on the server for this connection
- connection.writeLine("Root " + getRepositoryRoot()); //$NON-NLS-1$
+ monitor.beginTask(null, 100);
+ try {
+ connection = location.openConnection(Policy.subMonitorFor(monitor, 50));
+
+ // tell the server the names of the responses we can handle
+ connection.writeLine("Valid-responses " + Command.makeResponseList()); //$NON-NLS-1$
+
+ // ask for the set of valid requests
+ boolean saveOutputToConsole = outputToConsole;
+ outputToConsole = false;
+ Command.VALID_REQUESTS.execute(this, Command.NO_GLOBAL_OPTIONS, Command.NO_LOCAL_OPTIONS,
+ Command.NO_ARGUMENTS, null, Policy.subMonitorFor(monitor, 50));
+ outputToConsole = saveOutputToConsole;
+
+ // set the root directory on the server for this connection
+ connection.writeLine("Root " + getRepositoryRoot()); //$NON-NLS-1$
+ } finally {
+ monitor.done();
+ }
}
/**
@@ -718,7 +723,6 @@ public class Session {
if (totalRead > nextProgressThresh) {
monitor.subTask(Policy.bind("Session.transfer", //$NON-NLS-1$
new Object[] { title, new Long(totalRead / 1024), ksize}));
- monitor.worked(read);
nextProgressThresh = totalRead + TRANSFER_PROGRESS_INCREMENT;
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties
index e566369b9..4b19bec6d 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties
@@ -179,3 +179,4 @@ CVSRemoteSyncElement.alreadyManaged=Error making a remote folder in sync with th
Util.Internal_error,_resource_does_not_start_with_root_3=Internal error, resource does not start with root
+CVSProvider.Scrubbing_local_project_1=Scrubbing local project

Back to the top