Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-04-17 13:40:27 +0000
committerJean Michel-Lemieux2002-04-17 13:40:27 +0000
commitdc4e7cdea235a92cbd4ac065443045de16caa93a (patch)
tree46cf340849edf58326f09b79fdd37f087e0316b8
parent1b28f5415923af6b099cebf021623d97e699aa8c (diff)
downloadeclipse.platform.team-dc4e7cdea235a92cbd4ac065443045de16caa93a.tar.gz
eclipse.platform.team-dc4e7cdea235a92cbd4ac065443045de16caa93a.tar.xz
eclipse.platform.team-dc4e7cdea235a92cbd4ac065443045de16caa93a.zip
Progress monitoring fixes.
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties23
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java80
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java299
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java27
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java13
8 files changed, 224 insertions, 224 deletions
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 944dca4da..3911798cf 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
@@ -197,7 +197,7 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
/*
* @see ICVSRepositoryLocation#members(CVSTag, boolean, IProgressMonitor)
*/
- public ICVSRemoteResource[] members(CVSTag tag, boolean modules, IProgressMonitor progress) throws CVSException {
+ public ICVSRemoteResource[] members(CVSTag tag, boolean modules, IProgressMonitor progress) throws CVSException {
try {
if (modules) {
return RemoteModule.getRemoteModules(this, tag, progress);
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 78083726e..3fc9d6ab1 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
@@ -39,11 +39,9 @@ Connection.readUnestablishedConnection=Failure due to attempt to read from an un
Connection.writeUnestablishedConnection=Failure due to attempt to write to an unestablished connection
PServerConnection.invalidChars=Invalid characters in password
-PServerConnection.noUser=No user specified
PServerConnection.hostInvalid=Invalid host
PServerConnection.loginRefused=Incorrect user name or password
PServerConnection.invalidUser={0}
-PServerConnection.host=Cannot locate host: {0}
PServerConnection.socket=Cannot connect to host: {0}
PServerConnection.connectionRefused=Connection refused: {0}
PServerConnection.stream=Error opening socket connection
@@ -99,34 +97,28 @@ ResponseDispatcher.receiving=Receiving reponse
FileProperties.invalidEntryLine=Invalid entry line: {0}
-LocalResource.invalidResourceClass=Two different implementations of ICVSResource used
-LocalFile.invalidDateFormat=Invalid date format received: {0}
-LocalFile.moveFailed=Move from {0} to {1} failed
-LocalFolder.invalidChild=Invalid resource {0}
+EclipseResource.invalidResourceClass=Two different implementations of ICVSResource used
RemoteResource.invalidResourceClass=Two different implementations of ICVSResource used
RemoteResource.invalidOperation=Invalid operation performed on remote resource
RemoteFolder.errorFetchingRevisions=Error fetching file revision numbers
RemoteFolder.invalidChild=Resource {0} is not a child of folder {1}
-RemoteFolder.invalidChild=Invalid folder {0} received during remote operation
RemoteFolder.errorFetchingRevisions=Error fetching file revisions
+RemoteFolder.doesNotExist=Folder {0} does not exist remotely
+
RemoteFile.noContentsReceived=No contents received from server for {0}
RemoteFolderTreeBuilder.buildingBase=Collecting local synchronization information
RemoteFolderTreeBuilder.receivingDelta=Receiving delta for {0}
RemoteFolderTreeBuilder.receivingRevision=Receiving revision for {0}
-Session.readError=Read finished prematurely
Session.badInt="Malformed file transmission received"
Session.receiving=Receiving file: {0}
Session.sending=Sending file: {0}
Session.transfer={0} ({1}K of {2}K bytes)
Session.transferNoSize={0}
-Command.server=Contacting server
Command.receivingResponses=Receiving server response
-Command.invalidRoot=Resource {0} is not a valid CVS root directory
-Command.invalidResource=Resource {0} is not a valid CVS resource
Command.warnings=Warnings occured during CVS operation: {0}
Command.serverError=Error occured during CVS operation: {0}
Command.noMoreInfoAvailable=The server did not provide any additional information.
@@ -144,8 +136,6 @@ Command.update=update
Command.valid-requests=valid-requests
Command.unsupportedResponse=Unknown response received from cvs server: {0} {1}
Command.argumentNotManaged=Argument {0} is not managed
-Command.loadingSyncInfo=Loading CVS synchronization information
-Command.loadingSyncInfo=Saving CVS synchronization information
Command.invalidTag=HEAD is not a valid tag
Tag.notVersionOrBranchError=Error applying tag: the tag provided is not a version or branch tag.
@@ -234,7 +224,6 @@ EclipseFile_Problem_deleting_resource=Problem deleting resource: {1}
EclipseFile_Problem_accessing_resource=Problem accessing resource: {1} Perform a refresh from local.
EclipseFile_Problem_creating_resource=Problem creating resource: {1}
EclipseFile_Problem_writing_resource=Problem writing resource: {1}
-EclipseFile_Problem_appending_to_resource=Problem appending to resource: {1}
EclipseFolder_problem_creating=Problem creating folder: {1}
EclipseSynchronizer.UpdatingSyncEndOperation=Saving CVS synchronization information...
@@ -251,3 +240,9 @@ PollingInputStream.closeTimeout=Timeout while closing input stream
PollingOutputStream.writeTimeout=Timeout while writing to output stream
PollingOutputStream.closeTimeout=Timeout while closing output stream
TimeoutOutputStream.cannotWriteToStream=Cannot write to output stream
+
+RemoteFile.getContents=Retrieving remote file contents
+RemoteFile.getLogEntries=Retrieving log entries
+RemoteFolder.exists=Checking if resource exists remotely
+RemoteFolder.getMembers=Retrieving children of remote folder
+RemoteModule.getRemoteModules=Retrieving remote modules
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java
index 559ef1c1a..164620daa 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java
@@ -244,6 +244,8 @@ class EclipseFolder extends EclipseResource implements ICVSFolder {
}
}
} catch (CoreException e) {
+ } finally {
+ monitor.done();
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java
index dce13a5bc..7e5a318bb 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java
@@ -63,7 +63,7 @@ abstract class EclipseResource implements ICVSResource {
result = Util.getRelativePath(rootFolder.getPath(), getPath());
return result;
} catch (ClassCastException e) {
- throw new CVSException(Policy.bind("LocalResource.invalidResourceClass"), e); //$NON-NLS-1$
+ throw new CVSException(Policy.bind("EclipseResource.invalidResourceClass"), e); //$NON-NLS-1$
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java
index d001c975f..4a28d4f1b 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java
@@ -152,11 +152,12 @@ public class RemoteFile extends RemoteResource implements ICVSRemoteFile {
/**
* @see ICVSRemoteFile#getContents()
*/
- public InputStream getContents(final IProgressMonitor monitor) {
- try {
- if (contents == null) {
- final List entries = new ArrayList();
- monitor.beginTask(null, 100);
+ public InputStream getContents(IProgressMonitor monitor) {
+ if (contents == null) {
+ monitor = Policy.monitorFor(monitor);
+ monitor.beginTask(Policy.bind("RemoteFile.getContents"), 100); //$NON-NLS-1$
+ try {
+ List entries = new ArrayList();
IStatus status;
Session s = new Session(getRepository(), parent, false);
s.open(Policy.subMonitorFor(monitor, 10));
@@ -176,7 +177,6 @@ public class RemoteFile extends RemoteResource implements ICVSRemoteFile {
}
} finally {
s.close();
- monitor.done();
}
if (status.getCode() == CVSStatus.SERVER_ERROR) {
throw new CVSServerException(status);
@@ -186,11 +186,13 @@ public class RemoteFile extends RemoteResource implements ICVSRemoteFile {
if (contents == null) {
contents = new byte[0];
}
+ } catch(CVSException e) {
+ return null;
+ } finally {
+ monitor.done();
}
- return new ByteArrayInputStream(contents);
- } catch(CVSException e) {
- return null;
}
+ return new ByteArrayInputStream(contents);
}
/*
@@ -198,16 +200,20 @@ public class RemoteFile extends RemoteResource implements ICVSRemoteFile {
*/
public ILogEntry getLogEntry(IProgressMonitor monitor) throws CVSException {
if (entry == null) {
- monitor.beginTask(null, 100);
- Session s = new Session(getRepository(), parent, false);
- s.open(Policy.subMonitorFor(monitor, 10));
+ monitor = Policy.monitorFor(monitor);
+ monitor.beginTask(Policy.bind("RemoteFile.getLogEntries"), 100); //$NON-NLS-1$
try {
- IStatus status = getLogEntry(s, Policy.subMonitorFor(monitor, 90));
- if (status.getCode() == CVSStatus.SERVER_ERROR) {
- throw new CVSServerException(status);
+ Session s = new Session(getRepository(), parent, false);
+ s.open(Policy.subMonitorFor(monitor, 10));
+ try {
+ IStatus status = getLogEntry(s, Policy.subMonitorFor(monitor, 90));
+ if (status.getCode() == CVSStatus.SERVER_ERROR) {
+ throw new CVSServerException(status);
+ }
+ } finally {
+ s.close();
}
} finally {
- s.close();
monitor.done();
}
}
@@ -241,29 +247,31 @@ public class RemoteFile extends RemoteResource implements ICVSRemoteFile {
* @see ICVSRemoteFile#getLogEntries()
*/
public ILogEntry[] getLogEntries(IProgressMonitor monitor) throws CVSException {
-
- // Perform a "cvs log..." with a custom message handler
- final List entries = new ArrayList();
- IStatus status;
- Session s = new Session(getRepository(), parent, false);
- s.open(monitor);
- QuietOption quietness = CVSProviderPlugin.getPlugin().getQuietness();
+ monitor = Policy.monitorFor(monitor);
+ monitor.beginTask(Policy.bind("RemoteFile.getLogEntries"), 100); //$NON-NLS-1$
try {
- CVSProviderPlugin.getPlugin().setQuietness(Command.VERBOSE);
- status = Command.LOG.execute(s,
- Command.NO_GLOBAL_OPTIONS,
- Command.NO_LOCAL_OPTIONS,
- new String[] { getName() },
- new LogListener(this, entries),
- monitor);
+ // Perform a "cvs log..." with a custom message handler
+ final List entries = new ArrayList();
+ IStatus status;
+ Session s = new Session(getRepository(), parent, false);
+ s.open(Policy.subMonitorFor(monitor, 10));
+ QuietOption quietness = CVSProviderPlugin.getPlugin().getQuietness();
+ try {
+ CVSProviderPlugin.getPlugin().setQuietness(Command.VERBOSE);
+ status = Command.LOG.execute(s, Command.NO_GLOBAL_OPTIONS, Command.NO_LOCAL_OPTIONS,
+ new String[] { getName() }, new LogListener(this, entries),
+ Policy.subMonitorFor(monitor, 90));
+ } finally {
+ CVSProviderPlugin.getPlugin().setQuietness(quietness);
+ s.close();
+ }
+ if (status.getCode() == CVSStatus.SERVER_ERROR) {
+ throw new CVSServerException(status);
+ }
+ return (ILogEntry[])entries.toArray(new ILogEntry[entries.size()]);
} finally {
- CVSProviderPlugin.getPlugin().setQuietness(quietness);
- s.close();
- }
- if (status.getCode() == CVSStatus.SERVER_ERROR) {
- throw new CVSServerException(status);
+ monitor.done();
}
- return (ILogEntry[])entries.toArray(new ILogEntry[entries.size()]);
}
/**
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java
index 1c252d1ca..0db7fcdab 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java
@@ -112,7 +112,7 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC
Command.NO_LOCAL_OPTIONS,
fileNames,
new StatusListener(listener),
- monitor);
+ Policy.subMonitorFor(monitor, 100));
if (status.getCode() == CVSStatus.SERVER_ERROR) {
throw new CVSServerException(status);
}
@@ -160,64 +160,66 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC
* error and we're looking for a folder, we need to reissue the command without a tag.
*/
protected boolean exists(ICVSRemoteResource child, CVSTag tag, IProgressMonitor monitor) throws CVSException {
-
final IProgressMonitor progress = Policy.monitorFor(monitor);
-
- // Create the listener for remote files and folders
- final boolean[] exists = new boolean[] {true};
- IUpdateMessageListener listener = new IUpdateMessageListener() {
- public void directoryInformation(IPath path, boolean newDirectory) {
- exists[0] = true;
- }
- public void directoryDoesNotExist(IPath path) {
- exists[0] = false;
- }
- public void fileInformation(int type, String filename) {
- // We can't set exists true here as we may get a conflict on a deleted file.
- // i.e. remote files are always communicated to the server as modified.
- }
- public void fileDoesNotExist(String filename) {
- exists[0] = false;
- }
- };
-
- // Build the local options
- List localOptions = new ArrayList();
- localOptions.add(Update.RETRIEVE_ABSENT_DIRECTORIES);
- if (tag != null && tag.getType() != CVSTag.HEAD)
- localOptions.add(Update.makeTagOption(tag));
-
- // Retrieve the children and any file revision numbers in a single connection
- // Perform a "cvs -n update -d -r tagName folderName" with custom message and error handlers
- IStatus status;
- Session s = new Session(getRepository(), this, false);
- s.open(monitor);
+ progress.beginTask(Policy.bind("RemoteFolder.exists"), 100); //$NON-NLS-1$
try {
- status = Command.UPDATE.execute(s,
- new GlobalOption[] { Command.DO_NOT_CHANGE },
- (LocalOption[]) localOptions.toArray(new LocalOption[localOptions.size()]),
- new String[] { child.getName() },
- new UpdateListener(listener),
- monitor);
- } finally {
- s.close();
- }
- if (status.getCode() == CVSStatus.SERVER_ERROR) {
- CVSServerException e = new CVSServerException(status);
- if ( ! e.isNoTagException() || ! child.isContainer()) {
- if (e.containsErrors()) {
- throw e;
+ // Create the listener for remote files and folders
+ final boolean[] exists = new boolean[] {true};
+ IUpdateMessageListener listener = new IUpdateMessageListener() {
+ public void directoryInformation(IPath path, boolean newDirectory) {
+ exists[0] = true;
+ }
+ public void directoryDoesNotExist(IPath path) {
+ exists[0] = false;
+ }
+ public void fileInformation(int type, String filename) {
+ // We can't set exists true here as we may get a conflict on a deleted file.
+ // i.e. remote files are always communicated to the server as modified.
+ }
+ public void fileDoesNotExist(String filename) {
+ exists[0] = false;
}
+ };
+
+ // Build the local options
+ List localOptions = new ArrayList();
+ localOptions.add(Update.RETRIEVE_ABSENT_DIRECTORIES);
+ if (tag != null && tag.getType() != CVSTag.HEAD)
+ localOptions.add(Update.makeTagOption(tag));
+
+ // Retrieve the children and any file revision numbers in a single connection
+ // Perform a "cvs -n update -d -r tagName folderName" with custom message and error handlers
+ IStatus status;
+ Session s = new Session(getRepository(), this, false);
+ s.open(Policy.subMonitorFor(progress, 10));
+ try {
+ status = Command.UPDATE.execute(s,
+ new GlobalOption[] { Command.DO_NOT_CHANGE },
+ (LocalOption[]) localOptions.toArray(new LocalOption[localOptions.size()]),
+ new String[] { child.getName() }, new UpdateListener(listener),
+ Policy.subMonitorFor(progress, 90));
+ } finally {
+ s.close();
}
- // we now know that this is an exception caused by a cvs bug.
- // if the folder has no files in it (just subfolders) cvs does not respond with the subfolders...
- // workaround: retry the request with no tag to get the directory names (if any)
- Policy.checkCanceled(progress);
- if (e.isNoTagException()) {
- return exists(child, null, progress);
+ if (status.getCode() == CVSStatus.SERVER_ERROR) {
+ CVSServerException e = new CVSServerException(status);
+ if ( ! e.isNoTagException() || ! child.isContainer()) {
+ if (e.containsErrors()) {
+ throw e;
+ }
+ }
+ // we now know that this is an exception caused by a cvs bug.
+ // if the folder has no files in it (just subfolders) cvs does not respond with the subfolders...
+ // workaround: retry the request with no tag to get the directory names (if any)
+ Policy.checkCanceled(progress);
+ if (e.isNoTagException()) {
+ return exists(child, null, progress);
+ }
}
+ return exists[0];
+ } finally {
+ progress.done();
}
- return exists[0];
}
/**
@@ -236,107 +238,112 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC
* persist the children.
*/
protected ICVSRemoteResource[] getMembers(final CVSTag tag, IProgressMonitor monitor) throws CVSException {
-