diff options
author | Bogdan Gheorghe | 2006-04-24 18:05:39 +0000 |
---|---|---|
committer | Bogdan Gheorghe | 2006-04-24 18:05:39 +0000 |
commit | bf147af25684ea54c47ce1248f26f3019c908796 (patch) | |
tree | a1ee3f1e4415763c5ae0f7eaf4b1323bc79ac996 /bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal | |
parent | 4c3500ae80dc6b45e89a5749315b3b835c560cd6 (diff) | |
download | eclipse.platform.team-bf147af25684ea54c47ce1248f26f3019c908796.tar.gz eclipse.platform.team-bf147af25684ea54c47ce1248f26f3019c908796.tar.xz eclipse.platform.team-bf147af25684ea54c47ce1248f26f3019c908796.zip |
Bug 137602 Last local rather than remote date on update
Diffstat (limited to 'bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal')
2 files changed, 11 insertions, 23 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 ee6a55ba3..b981e3a27 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 @@ -456,29 +456,12 @@ public class EclipseFile extends EclipseResource implements ICVSFile { if (entryLine == null) { // cvs commit: the file contents matched the server contents so no entry line was sent if (oldInfo == null) return; - Date timeStamp = oldInfo.getTimeStamp(); - if (timeStamp == null || oldInfo.isMergedWithConflicts()) { - // If the entry line has no timestamp, put the file timestamp in the entry line - if(! oldInfo.isAdded()) { - MutableResourceSyncInfo mutable = oldInfo.cloneMutable(); - mutable.setTimeStamp(getTimeStamp(), true /* clear merged */); - newInfo = mutable; - } - } else { - // reset the file timestamp to the one from the entry line - boolean reset = false; - if (isReadOnly()) { - // We can only set the timestamp if the file is not read-only. - // We will get a situation like this if the timestamp changes due to a time change (e.g. daylight savings) - setReadOnly(false); - reset = true; - } - setTimeStamp(timeStamp); - if (reset) { - // Make sure we set the file back to read-only - setReadOnly(true); - } - // (newInfo = null) No need to set the newInfo as there is no sync info change + // We should never make the timestamp go backwards so we'll set + // the entry line timestamp to match that of the file + if(! oldInfo.isAdded()) { + MutableResourceSyncInfo mutable = oldInfo.cloneMutable(); + mutable.setTimeStamp(getTimeStamp(), true /* clear merged */); + newInfo = mutable; } // (modified = false) the file will be no longer modified } else if (oldInfo == null) { 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 c1982bd16..e7caa3b56 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 @@ -19,6 +19,7 @@ import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.*; import org.eclipse.team.core.TeamException; +import org.eclipse.team.core.variants.CachedResourceVariant; import org.eclipse.team.internal.ccvs.core.*; import org.eclipse.team.internal.ccvs.core.client.*; import org.eclipse.team.internal.ccvs.core.client.Command.*; @@ -644,4 +645,8 @@ public class RemoteFile extends RemoteResource implements ICVSRemoteFile { // return executable bit return executable; } + + public CachedResourceVariant getCachedHandle() { + return super.getCachedHandle(); + } } |