Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2011-11-23 16:49:54 +0000
committerTomasz Zarna2011-11-23 16:49:54 +0000
commit1d317a8da6b135518fc0f27e059e2d38a94760f8 (patch)
tree9d482d8a972f45a982ebacf13fbe330be5929a71
parent951477fe0d9d1aa4bbfcabd936d0d7641c6f712a (diff)
downloadeclipse.platform.team-1d317a8da6b135518fc0f27e059e2d38a94760f8.tar.gz
eclipse.platform.team-1d317a8da6b135518fc0f27e059e2d38a94760f8.tar.xz
eclipse.platform.team-1d317a8da6b135518fc0f27e059e2d38a94760f8.zip
bug 364561: test failures due to unexpected outgoing changesv20111123-1649
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/ContentComparisonDiffFilter.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java3
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java15
3 files changed, 17 insertions, 6 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/ContentComparisonDiffFilter.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/ContentComparisonDiffFilter.java
index 984980e7c..5c520db9b 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/ContentComparisonDiffFilter.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/ContentComparisonDiffFilter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -55,7 +55,8 @@ public class ContentComparisonDiffFilter extends DiffFilter {
public boolean select(IDiff diff, IProgressMonitor monitor) {
IFileRevision remote = SyncInfoToDiffConverter.getRemote(diff);
IResource local = ResourceDiffTree.getResourceFor(diff);
- if (local == null || local.getType() != IResource.FILE) return true;
+ if (local == null) return true;
+ if (local.getType() != IResource.FILE) return false;
if (remote == null) return !local.exists();
if (!local.exists()) return false;
return compareContents((IFile)local, remote, monitor);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
index b5c219103..ddc62a111 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
@@ -206,6 +206,9 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
private SyncInfoFilter contentComparison = new SyncInfoFilter() {
private SyncInfoFilter contentCompare = new SyncInfoFilter.ContentComparisonSyncInfoFilter();
public boolean select(SyncInfo info, IProgressMonitor monitor) {
+ IResource local = info.getLocal();
+ // don't select folders
+ if (local.getType() != IResource.FILE) return false;
// Want to select infos whose contents do not match
return !contentCompare.select(info, monitor);
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java
index af5744621..57337af13 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -39,14 +39,16 @@ import org.eclipse.team.internal.ccvs.core.CVSTeamProvider;
import org.eclipse.team.internal.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.client.Command;
-import org.eclipse.team.internal.ccvs.core.client.Session;
-import org.eclipse.team.internal.ccvs.core.client.Update;
import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
+import org.eclipse.team.internal.ccvs.core.client.Session;
+import org.eclipse.team.internal.ccvs.core.client.Update;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.core.util.Util;
+import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.tests.ccvs.core.EclipseTest;
/*
@@ -603,17 +605,22 @@ public class CVSProviderTest extends EclipseTest {
}
+ private void setOnlyLookAtTimestamps(boolean b) {
+ CVSUIPlugin.getPlugin().getPreferenceStore().setValue(ICVSUIConstants.PREF_CONSIDER_CONTENTS, !b);
+ }
+
public void testUpdateWithNoChange() throws TeamException, CoreException {
IProject project = createProject(new String[] { "a.txt"});
setContentsAndEnsureModified(project.getFile("a.txt"), "contents");
commitProject(project);
+ setOnlyLookAtTimestamps(true);
// set the contents to the same value but ensure the local timestamp is different
setContentsAndEnsureModified(project.getFile("a.txt"), "contents");
// Update and ensure file timestamp is what is was before out edit
updateProject(project, null, false);
Date modDate = CVSWorkspaceRoot.getCVSFileFor(project.getFile("a.txt")).getSyncInfo().getTimeStamp();
assertEquals("Timestamp was not properly reset", modDate, CVSWorkspaceRoot.getCVSFileFor(project.getFile("a.txt")).getTimeStamp());
-
+ setOnlyLookAtTimestamps(false);
}
public void testBinaryAddition() throws CoreException {

Back to the top