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 209749 Details for
Bug 366016
Branches from other libs are displayed when trying to "Check Out As" from Orbit
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]
fix
clipboard.txt (text/plain), 6.36 KB, created by
Malgorzata Janczarska
on 2012-01-19 10:16:13 EST
(
hide
)
Description:
fix
Filename:
MIME Type:
Creator:
Malgorzata Janczarska
Created:
2012-01-19 10:16:13 EST
Size:
6.36 KB
patch
obsolete
>From 921bf00531cb1fc3f6929a2ab55cf577a30eec40 Thu, 19 Jan 2012 16:06:15 +0100 >From: Malgorzata Janczarska <malgorzata.tomczyk@pl.ibm.com> >Date: Thu, 19 Jan 2012 14:55:15 +0100 >Subject: [PATCH] NEW - bug 366016: Branches from other libs are displayed when trying to "Check Out As" from Orbit https://bugs.eclipse.org/bugs/show_bug.cgi?id=366016 > >diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/CVSTagElement.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/CVSTagElement.java >index 2a082ab..b9724bd 100644 >--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/CVSTagElement.java >+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/CVSTagElement.java >@@ -12,8 +12,8 @@ > > import java.lang.reflect.InvocationTargetException; > import com.ibm.icu.text.SimpleDateFormat; >-import java.util.Date; >-import java.util.Locale; >+import java.util.*; >+ > import com.ibm.icu.util.TimeZone; > > import org.eclipse.core.runtime.IProgressMonitor; >@@ -113,12 +113,34 @@ > return null; > return ((CVSTagElement) o).root; > } >+ >+ /* >+ * Filter out subfolders from cache, to prevent duplicated entries. >+ */ >+ private Object[] filterSubfolders(ICVSRemoteResource[] children){ >+ List filteredChildren = new ArrayList(); >+ for(int i=0; i<children.length; i++){ >+ ICVSRemoteResource child = children[i]; >+ boolean isSubfolderOfOtherChild = false; >+ for(int j=0; j<children.length; j++){ >+ ICVSRemoteResource otherChild = children[j]; >+ if(!(i==j) && child.getRepositoryRelativePath().startsWith(otherChild.getRepositoryRelativePath())){ >+ isSubfolderOfOtherChild = true; >+ break; >+ } >+ } >+ if(!isSubfolderOfOtherChild){ >+ filteredChildren.add(child); >+ } >+ } >+ return filteredChildren.toArray(new Object[filteredChildren.size()]); >+ } > > protected Object[] fetchChildren(Object o, IProgressMonitor monitor) throws TeamException { > ICVSRemoteResource[] children = CVSUIPlugin.getPlugin().getRepositoryManager().getFoldersForTag(root, tag, monitor); > if (getWorkingSet() != null) > children = CVSUIPlugin.getPlugin().getRepositoryManager().filterResources(getWorkingSet(), children); >- return children; >+ return filterSubfolders(children); > } > > public void fetchDeferredChildren(Object o, IElementCollector collector, IProgressMonitor monitor) { >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 b90cc03..cc414ab 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 >@@ -25,7 +25,6 @@ > import org.eclipse.team.internal.ccvs.ui.Policy; > import org.eclipse.team.internal.ccvs.ui.operations.RemoteLogOperation; > import org.eclipse.team.internal.ccvs.ui.operations.RemoteLogOperation.LogEntryCache; >-import org.eclipse.team.internal.ccvs.ui.tags.TagSource; > > public class RepositoryRoot extends PlatformObject { > >@@ -444,22 +443,15 @@ > return (CVSTag[])tagSet.toArray(new CVSTag[0]); > } > >- /** >- * 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. 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 TagSource >- * @see #addTags(String, CVSTag[]) >- * >- * @param remotePath >- * the remote folder path >- * @return the cache key (path) for the given folder path >+ /* >+ * 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) > */ > private String getCachePathFor(String remotePath) { >- return new Path(null, remotePath).segment(0); >+ return remotePath; > } > > /** >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 >index 64e6e17..8704599 100644 >--- 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 >@@ -82,21 +82,19 @@ > > // 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); >+ // add some files >+ addResources(project, new String[] { "file1.txt" }, true); > > // 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 >@@ -128,17 +126,27 @@ > > // 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); > >+ // add some files >+ addResources(project, new String[] { "file1.txt" }, true); >+ > // tag project > CVSTag tag = new CVSTag(versionName, CVSTag.VERSION); > > tagProject(project, tag, true); > >+ // refresh branches >+ CVSUIPlugin >+ .getPlugin() >+ .getRepositoryManager() >+ .refreshDefinedTags( >+ getRepository().getRemoteFolder(moduleName, null), >+ true, true, DEFAULT_MONITOR); >+ > RemoteContentProvider rcp = new RemoteContentProvider(); > Object[] categories = rcp.getChildren(getRepositoryRoot()); > assertEquals(4, categories.length);
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 366016
:
209749
|
209750
|
211659
|
211660
|
211682
|
211683