Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-12-04 16:02:59 +0000
committerMichael Valenta2003-12-04 16:02:59 +0000
commit019556e65495c8c3f95a4d51f62f21edf1e2b857 (patch)
tree6b1052aa056c6424a300983ed8b9f6c2312414a5
parentf34d57838892931d52aa3eaddc08bfbf9296ff8b (diff)
downloadeclipse.platform.team-019556e65495c8c3f95a4d51f62f21edf1e2b857.tar.gz
eclipse.platform.team-019556e65495c8c3f95a4d51f62f21edf1e2b857.tar.xz
eclipse.platform.team-019556e65495c8c3f95a4d51f62f21edf1e2b857.zip
47814: Performing changes in a properties file not viewed as a change
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java25
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java21
2 files changed, 17 insertions, 29 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 ac4a27d1b..08efcd2fd 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
@@ -101,7 +101,7 @@ public class EclipseFile extends EclipseResource implements ICVSFile {
} else {
time = date.getTime();
}
- EclipseSynchronizer.getInstance().setTimeStamp(getIFile(), time);
+ EclipseSynchronizer.getInstance().setTimeStamp(this, time);
}
/*
@@ -129,10 +129,10 @@ public class EclipseFile extends EclipseResource implements ICVSFile {
}
// nothing cached, need to manually check (and record)
- ResourceSyncInfo info = getSyncInfo();
- if (info == null && isIgnored()) return false;
+ byte[] syncBytes = getSyncBytes();
+ if (syncBytes == null && isIgnored()) return false;
// unmanaged files are reported as modified
- return EclipseSynchronizer.getInstance().setModified(getIFile(), info, getTimeStamp(), UNKNOWN);
+ return EclipseSynchronizer.getInstance().setModified(this, UNKNOWN);
}
/*
@@ -382,7 +382,7 @@ public class EclipseFile extends EclipseResource implements ICVSFile {
setSyncInfo(newInfo, ICVSFile.CLEAN);
} else {
// an unedited file is no longer modified
- EclipseSynchronizer.getInstance().setModified(getIFile(), null, null, CLEAN);
+ EclipseSynchronizer.getInstance().setModified(EclipseFile.this, CLEAN);
}
} else {
// We still need to report a state change
@@ -496,16 +496,7 @@ public class EclipseFile extends EclipseResource implements ICVSFile {
private void setSyncBytes(byte[] syncBytes, ResourceSyncInfo info, int modificationState) throws CVSException {
Assert.isNotNull(syncBytes);
setSyncBytes(syncBytes);
- Date timestamp = null;
- if (modificationState == UNKNOWN) {
- // The sync info is only need if the modification state is unknown
- if (info == null) {
- info = new ResourceSyncInfo(syncBytes);
- }
- // The timesatmp is only need if the modification state is unknown
- timestamp = getTimeStamp();
- }
- EclipseSynchronizer.getInstance().setModified(getIFile(), info, timestamp, modificationState);
+ EclipseSynchronizer.getInstance().setModified(this, modificationState);
}
public void handleModification(boolean forAddition) throws CVSException {
@@ -517,12 +508,12 @@ public class EclipseFile extends EclipseResource implements ICVSFile {
// There may be a better was of handling resources that transition from un-managed to
// ignored but for now this seems like the safest change.
if(! resource.isDerived()) {
- EclipseSynchronizer.getInstance().setModified(getIFile(), null, null, CLEAN);
+ EclipseSynchronizer.getInstance().setModified(this, CLEAN);
}
return;
}
// set the modification state to what it really is and return true if the modification state changed
- EclipseSynchronizer.getInstance().setModified(getIFile(), getSyncInfo(), getTimeStamp(), UNKNOWN);
+ EclipseSynchronizer.getInstance().setModified(this, UNKNOWN);
}
/**
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
index a17356945..91a7581b2 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java
@@ -13,7 +13,6 @@ package org.eclipse.team.internal.ccvs.core.resources;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -1559,15 +1558,16 @@ public class EclipseSynchronizer implements IFlushOperation {
* @param time
* @throws CVSException
*/
- public void setTimeStamp(IFile file, long time) throws CVSException {
+ public void setTimeStamp(ICVSFile cvsFile, long time) throws CVSException {
ISchedulingRule rule = null;
+ IFile file = (IFile)cvsFile.getIResource();
try {
rule = beginBatching(file, null);
try {
beginOperation();
try {
file.setLocalTimeStamp(time);
- setModified(file, null, null, ICVSFile.CLEAN);
+ setModified(cvsFile, ICVSFile.CLEAN);
} catch (CoreException e) {
throw CVSException.wrapException(e);
}
@@ -1652,36 +1652,33 @@ public class EclipseSynchronizer implements IFlushOperation {
* ICVSFile.UNKNOWN, it is computed. However, if it is CLEAN or DIRTY,
* it is set accordingly. CLEAN or DIRTY can only be used if the caller is protected
* from resource modifications (either by a scheduling rule or inside a delta handler).
- * The info and modificationTime are only used if the modificationType is UNKNOWN.
- * Otherwise, they can be null.
* @param file
- * @param info
- * @param modificationTime
* @param modificationState
* @return true if the file is dirty
*/
- public boolean setModified(IFile file, ResourceSyncInfo info, Date modificationTime, int modificationState) throws CVSException {
+ public boolean setModified(ICVSFile cvsFile, int modificationState) throws CVSException {
try {
beginOperation();
boolean dirty;
if (modificationState == ICVSFile.UNKNOWN) {
// if there is no sync info and it doesn't exist then it is a phantom we don't care about.
+ ResourceSyncInfo info = cvsFile.getSyncInfo();
if (info == null) {
- dirty = file.exists();
+ dirty = cvsFile.exists();
} else {
// isMerged() must be called because when a file is updated and merged by the cvs server the timestamps
// are equal. Merged files should however be reported as dirty because the user should take action and commit
// or review the merged contents.
- if(info.isAdded() || info.isMerged() || !file.exists()) {
+ if(info.isAdded() || info.isMerged() || !cvsFile.exists()) {
dirty = true;
} else {
- dirty = !modificationTime.equals(info.getTimeStamp());
+ dirty = !cvsFile.getTimeStamp().equals(info.getTimeStamp());
}
}
} else {
dirty = modificationState == ICVSFile.DIRTY;
}
- setDirtyIndicator(file, dirty);
+ setDirtyIndicator(cvsFile.getIResource(), dirty);
return dirty;
} finally {
endOperation();

Back to the top