aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalgorzata Janczarska2012-05-09 11:45:42 (EDT)
committerTomasz Zarna2012-05-09 11:45:42 (EDT)
commitbf74a1480bdd394da719c41ba496d6560cf7d312 (patch)
tree4750ed4d07ca43858d5ef338b1196035b0606cea
parent53b8a8e96f316f3d556a0b40972f4659f433b909 (diff)
downloadeclipse.platform.team-bf74a1480bdd394da719c41ba496d6560cf7d312.zip
eclipse.platform.team-bf74a1480bdd394da719c41ba496d6560cf7d312.tar.gz
eclipse.platform.team-bf74a1480bdd394da719c41ba496d6560cf7d312.tar.bz2
Bug 361928 - [Backport][Repo view] Module disappears in CVSR36x_v20120509
Repositories view -- regression fix
-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.java21
2 files changed, 23 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..6964dfc 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,24 @@ 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]);
+
+ }
+
}