Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 206671 Details for
Bug 361927
[Backport][Repo view] Module disappears in CVS Repositories view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Backport
patch_361927.txt (text/plain), 9.55 KB, created by
Malgorzata Janczarska
on 2011-11-09 06:24:59 EST
(
hide
)
Description:
Backport
Filename:
MIME Type:
Creator:
Malgorzata Janczarska
Created:
2011-11-09 06:24:59 EST
Size:
9.55 KB
patch
obsolete
>From b0bd0ee57c43c60fc428aee73d43d7944fcb7912 Wed, 9 Nov 2011 12:24:23 +0100 >From: Malgorzata Janczarska <malgorzata.tomczyk@pl.ibm.com> >Date: Wed, 9 Nov 2011 12:16:49 +0100 >Subject: [PATCH] 361927 > >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 0c9431c..0ce2d22 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 >@@ -451,14 +451,15 @@ > } > > /* >- * Return the cache key (path) for the given folder path. >- * This has been changed to cache the tags directly >- * with the folder to better support non-root projects. >- * However, resources in the local workspace use the folder >- * the project is mapped to as the tag source (see TagSource) >+ * Return the cache key (path) for the given folder path. For root projects >+ * it returns the folder the project is mapped to as the tag source (see >+ * TagSource). For non-root projects it returns only the first segment of >+ * the path because for the time being tag lists are kept for the remote >+ * ancestors of the resource that is a direct child of the remote root (see >+ * javadoc for addTags). > */ > private String getCachePathFor(String remotePath) { >- return remotePath; >+ return new Path(null, remotePath).segment(0); > } > > /** >diff --git a/tests/org.eclipse.team.tests.cvs.core/META-INF/MANIFEST.MF b/tests/org.eclipse.team.tests.cvs.core/META-INF/MANIFEST.MF >index 5830574..4fd2a3d 100644 >--- a/tests/org.eclipse.team.tests.cvs.core/META-INF/MANIFEST.MF >+++ b/tests/org.eclipse.team.tests.cvs.core/META-INF/MANIFEST.MF >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: Eclipse CVS Tests Core > Bundle-SymbolicName: org.eclipse.team.tests.cvs.core; singleton:=true >-Bundle-Version: 3.3.201.qualifier >+Bundle-Version: 3.3.203.qualifier > Bundle-ClassPath: cvstests.jar > Bundle-Activator: org.eclipse.team.tests.ccvs.core.TeamCVSTestPlugin > Bundle-Vendor: Eclipse.org >diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/AllUITests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/AllUITests.java >index 1e72035..451fc6e 100644 >--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/AllUITests.java >+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/AllUITests.java >@@ -31,6 +31,7 @@ > suite.addTest(CheckoutOperationTests.suite()); > suite.addTest(CompareOperationTests.suite()); > suite.addTest(MiscOperationsTests.suite()); >+ suite.addTest(RepositoriesViewTests.suite()); > suite.addTest(ProjectSetImporterTests.suite()); > suite.addTest(EditorTests.suite()); > suite.addTest(PatchWizardRadioButtonGroupTests.suite()); >diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/RepositoriesViewTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/RepositoriesViewTests.java >new file mode 100644 >index 0000000..86e09a1 >--- /dev/null >+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/RepositoriesViewTests.java >@@ -0,0 +1,165 @@ >+/******************************************************************************* >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.team.tests.ccvs.ui; >+ >+import junit.framework.Test; >+import junit.framework.TestSuite; >+ >+import org.eclipse.core.resources.IProject; >+import org.eclipse.core.resources.IResource; >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.team.core.TeamException; >+import org.eclipse.team.internal.ccvs.core.CVSTag; >+import org.eclipse.team.internal.ccvs.core.resources.RemoteFolder; >+import org.eclipse.team.internal.ccvs.core.resources.RemoteResource; >+import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; >+import org.eclipse.team.internal.ccvs.ui.model.AllRootsElement; >+import org.eclipse.team.internal.ccvs.ui.model.BranchCategory; >+import org.eclipse.team.internal.ccvs.ui.model.CVSTagElement; >+import org.eclipse.team.internal.ccvs.ui.model.RemoteContentProvider; >+import org.eclipse.team.internal.ccvs.ui.model.RemoteModule; >+import org.eclipse.team.internal.ccvs.ui.model.VersionCategory; >+import org.eclipse.team.internal.ccvs.ui.repo.RepositoryRoot; >+import org.eclipse.team.tests.ccvs.core.CVSTestSetup; >+import org.eclipse.team.tests.ccvs.core.EclipseTest; >+ >+public class RepositoriesViewTests extends EclipseTest { >+ >+ public RepositoriesViewTests(String testName) { >+ super(testName); >+ } >+ >+ protected void setUp() throws Exception { >+ super.setUp(); >+ // clear repository root cache >+ RepositoryRoot repositoryRoot = getRepositoryRoot(); >+ String remotePaths[] = repositoryRoot.getKnownRemotePaths(); >+ for (int i = 0; i < remotePaths.length; i++) { >+ repositoryRoot.removeTags(remotePaths[i], >+ repositoryRoot.getAllKnownTags(remotePaths[i])); >+ } >+ >+ } >+ >+ private RepositoryRoot getRepositoryRoot() { >+ RemoteContentProvider rcp = new RemoteContentProvider(); >+ AllRootsElement are = new AllRootsElement(); >+ Object[] repositoryRoots = rcp.getElements(are); >+ for (int i = 0; i < repositoryRoots.length; i++) { >+ RepositoryRoot repositoryRoot = (RepositoryRoot) repositoryRoots[i]; >+ if (getRepository().equals(repositoryRoot.getRoot())) { >+ return repositoryRoot; >+ } >+ } >+ fail(); >+ return null; >+ } >+ >+ public static Test suite() { >+ String testName = System.getProperty("eclipse.cvs.testName"); >+ if (testName == null) { >+ TestSuite suite = new TestSuite(RepositoriesViewTests.class); >+ return new CVSTestSetup(suite); >+ } else { >+ return new CVSTestSetup(new RepositoriesViewTests(testName)); >+ } >+ } >+ >+ public void testBranchSubmoduleChildren() throws TeamException, >+ CoreException { >+ >+ String time = Long.toString(System.currentTimeMillis()); >+ String moduleName = "TestBranchSubmoduleChildrenTestModule" + time; >+ String branchName = "TestBranchSubmoduleChildrenBranch" + time; >+ String versionName = "Root_" + branchName; >+ >+ // create project >+ IProject project = getUniqueTestProject("TestBranchSubmoduleChildrenProject"); >+ buildResources(project, new String[] { "file1.txt" }, true); >+ // share project under module >+ shareProject(getRepository(), project, >+ moduleName + "/" + project.getName(), DEFAULT_MONITOR); >+ assertValidCheckout(project); >+ >+ // make some changes >+ addResources(project, new String[] { "folder1/c.txt" }, false); >+ >+ // make branch >+ CVSTag version = new CVSTag(versionName, CVSTag.VERSION); >+ CVSTag branch = new CVSTag(branchName, CVSTag.BRANCH); >+ >+ makeBranch(new IResource[] { project }, version, branch, true); >+ commitProject(project); >+ >+ // refresh branches >+ CVSUIPlugin >+ .getPlugin() >+ .getRepositoryManager() >+ .refreshDefinedTags( >+ getRepository().getRemoteFolder(moduleName, null), >+ true, true, DEFAULT_MONITOR); >+ >+ // check if module is the only branch child >+ RemoteContentProvider rcp = new RemoteContentProvider(); >+ Object[] categories = rcp.getChildren(getRepositoryRoot()); >+ assertEquals(4, categories.length); >+ assertTrue(categories[1] instanceof BranchCategory); >+ Object[] branches = rcp.getChildren(categories[1]); >+ assertEquals(1, branches.length); >+ assertEquals(branchName, ((CVSTagElement) (branches[0])).getTag() >+ .getName()); >+ Object[] modules = rcp.getChildren(branches[0]); >+ assertEquals(1, modules.length); >+ assertEquals(moduleName, ((RemoteResource) modules[0]).getName()); >+ } >+ >+ public void testTagSubmoduleChildren() throws TeamException, CoreException { >+ >+ String time = Long.toString(System.currentTimeMillis()); >+ String moduleName = "TestTagSubmoduleChildrenTestModule" + time; >+ String versionName = "TestTagSubmoduleChildrenBranch" + time; >+ >+ // create project >+ IProject project = getUniqueTestProject("TestTagSubmoduleChildrenProject"); >+ buildResources(project, new String[] { "file1.txt" }, true); >+ // share project under module >+ shareProject(getRepository(), project, >+ moduleName + "/" + project.getName(), DEFAULT_MONITOR); >+ assertValidCheckout(project); >+ >+ // tag project >+ CVSTag tag = new CVSTag(versionName, CVSTag.VERSION); >+ >+ tagProject(project, tag, true); >+ >+ RemoteContentProvider rcp = new RemoteContentProvider(); >+ Object[] categories = rcp.getChildren(getRepositoryRoot()); >+ assertEquals(4, categories.length); >+ >+ // check if version exists for module >+ assertTrue(categories[2] instanceof VersionCategory); >+ Object[] modules = rcp.getChildren(categories[2]); >+ boolean moduleExists = false; >+ for (int i = 0; i < modules.length; i++) { >+ if (modules[i] instanceof RemoteModule >+ && ((RemoteModule) (modules[i])).getCVSResource().getName() >+ .equals(moduleName)) { >+ moduleExists = true; >+ Object folders[] = rcp.getChildren(modules[i]); >+ assertEquals(1, folders.length); >+ assertEquals(versionName, ((RemoteFolder) folders[0]).getTag() >+ .getName()); >+ } >+ } >+ assertTrue(moduleExists); >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 361927
:
206669
|
206671
|
206672
|
218499