Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-04-08 15:09:59 -0400
committerJean Michel-Lemieux2002-04-08 15:09:59 -0400
commit930aa2343da4aa6716d80325283c7c8e15665065 (patch)
tree15a7a0aa59e7c48cedd7abdc38eefb63d6e5d85a
parentc94964535e96bbe9cf7586b7e7706d052fc21909 (diff)
downloadeclipse.platform.team-930aa2343da4aa6716d80325283c7c8e15665065.tar.gz
eclipse.platform.team-930aa2343da4aa6716d80325283c7c8e15665065.tar.xz
eclipse.platform.team-930aa2343da4aa6716d80325283c7c8e15665065.zip
timestamps from filesystem precision changed to the second.
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java41
1 files changed, 21 insertions, 20 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java
index 937f0cb51..269ba3056 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java
@@ -70,7 +70,7 @@ public class EclipseFile extends EclipseResource implements ICVSFile {
* @see ICVSFile#getTimeStamp()
*/
public Date getTimeStamp() {
- return new Date(getIOFile().lastModified());
+ return new Date((getIOFile().lastModified()/1000)*1000);
}
/*
@@ -160,27 +160,28 @@ public class EclipseFile extends EclipseResource implements ICVSFile {
public void setContents(InputStream stream, int responseType, boolean keepLocalHistory, IProgressMonitor monitor) throws CVSException {
try {
IFile file = getIFile();
- if (responseType == CREATED || (responseType == UPDATED && ! resource.exists())) {
- try {
- file.create(stream, false /*force*/, null);
- } catch (CoreException e) {
+ if (PROJECT_META_DATA_PATH.equals(file.getFullPath().removeFirstSegments(1))) {
+ responseType = UPDATED;
+ }
+ switch (responseType) {
+ case UPDATED:
if (resource.exists()) {
- if (PROJECT_META_DATA_PATH.equals(file.getFullPath().removeFirstSegments(1))) {
- // Special handling for the .project meta-file
- file.setContents(stream, true /*force*/, true /*keep history*/, monitor);
- return;
- }
+ file.setContents(stream, true /*force*/, true /*keep history*/, monitor);
+ break;
}
- throw new CVSException(Policy.bind("EclipseFile_Problem_creating_resource", e.getMessage(), e.getStatus().getMessage())); //$NON-NLS-1$
- }
- } else if(responseType == UPDATE_EXISTING) {
- file.setContents(stream, false /*force*/, keepLocalHistory /*keep history*/, monitor);
- } else {
- // Ensure we don't leave the file in a partially written state
- IFile tempFile = file.getParent().getFile(new Path(file.getName() + TEMP_FILE_EXTENSION));
- tempFile.create(stream, true /*force*/, null);
- file.delete(false, true, null);
- tempFile.move(new Path(file.getName()), true /*force*/, false /*history*/, null);
+ case CREATED: // creating a new file so it should not exist locally
+ file.create(stream, false /*force*/, monitor);
+ break;
+ case MERGED: // merging contents into a file that exists locally
+ // Ensure we don't leave the file in a partially written state
+ IFile tempFile = file.getParent().getFile(new Path(file.getName() + TEMP_FILE_EXTENSION));
+ tempFile.create(stream, true /*force*/, monitor);
+ file.delete(false, true, monitor);
+ tempFile.move(new Path(file.getName()), true /*force*/, false /*history*/, monitor);
+ break;
+ case UPDATE_EXISTING: // creating a new file so it should exist locally
+ file.setContents(stream, true /*force*/, true /*keep history*/, monitor);
+ break;
}
} catch(CoreException e) {
throw new CVSException(Policy.bind("EclipseFile_Problem_writing_resource", e.getMessage(), e.getStatus().getMessage())); //$NON-NLS-1$

Back to the top