aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalgorzata Janczarska2012-04-27 14:02:28 (EDT)
committerTomasz Zarna2012-04-27 14:02:28 (EDT)
commit9a44f1060a78d560859b9e7774a25703b8b6c3d2 (patch)
treea2805c53508540f1eaff0a75fbafd36eeaf3f7fe
parentd3879a9f2ac2f91c6ba9207e020e826ed76e6163 (diff)
downloadeclipse.platform.team-9a44f1060a78d560859b9e7774a25703b8b6c3d2.zip
eclipse.platform.team-9a44f1060a78d560859b9e7774a25703b8b6c3d2.tar.gz
eclipse.platform.team-9a44f1060a78d560859b9e7774a25703b8b6c3d2.tar.bz2
Fix for returning missing Date tags.
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java4
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RepositoryRootTest.java19
2 files changed, 21 insertions, 2 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java
index 7b45f71..c977ff8 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java
@@ -683,7 +683,7 @@ public class RepositoryRoot extends PlatformObject {
* @return CVSTag[]
*/
public CVSTag[] getAllKnownTags(String remotePath) {
- Set tags = new HashSet();
+ Set tags = new HashSet(dateTags);
addAllKnownTagsForParents(getKnownParentTagCacheEntryFor(remotePath),
tags);
TagCacheEntry entry = getTagCacheEntryFor(remotePath, false);
@@ -694,7 +694,7 @@ public class RepositoryRoot extends PlatformObject {
}
public CVSTag[] getAllKnownTags() {
- Set tags = new HashSet();
+ Set tags = new HashSet(dateTags);
addAllKnownTagsForChildren(rootTagCacheEntry, tags);
return (CVSTag[]) tags.toArray(new CVSTag[tags.size()]);
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RepositoryRootTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RepositoryRootTest.java
index 98c4838..e70b28f 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RepositoryRootTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RepositoryRootTest.java
@@ -11,6 +11,7 @@
package org.eclipse.team.tests.ccvs.core.provider;
import java.util.Arrays;
+import java.util.Date;
import java.util.List;
import junit.framework.Test;
@@ -394,4 +395,22 @@ public class RepositoryRootTest extends EclipseTest {
assertEquals(0, knownTags.length);
}
+ public void testDateTags() throws CoreException {
+ CVSTag dateTag = new CVSTag(new Date());
+ repositoryManager.addDateTag(getRepository(), dateTag);
+ // verify if date tags are returned by repository manager
+ CVSTag[] dateTags = repositoryManager.getDateTags(getRepository());
+ assertEquals(1, dateTags.length);
+ assertEquals(dateTag, dateTags[0]);
+ dateTags = repositoryManager.getKnownTags(getRepository(), CVSTag.DATE);
+ assertEquals(1, dateTags.length);
+ assertEquals(dateTag, dateTags[0]);
+ // verify if date tags are returned in list of known tags for every
+ // project
+ IProject project = createProject("Project_1", (String) null);
+ CVSTag[] allTags = repositoryManager.getKnownTags(CVSWorkspaceRoot
+ .getCVSFolderFor(project));
+ assertEquals(1, allTags.length);
+ assertEquals(dateTag, allTags[0]);
+ }
}