Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366016

Summary: Branches from other libs are displayed when trying to "Check Out As" from Orbit
Product: [Eclipse Project] Platform Reporter: Tomasz Zarna <tomasz.zarna>
Component: CVSAssignee: Malgorzata Janczarska <malgorzata.tomczyk>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: Szymon.Brandys
Version: 3.8Flags: malgorzata.tomczyk: review? (Szymon.Brandys)
Target Milestone: 3.8 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 339990    
Bug Blocks: 361930    
Attachments:
Description Flags
fix
none
mylyn/context/zip
none
Hierarchical cache fix
none
mylyn/context/zip
none
Hierarchical cache + tests
none
mylyn/context/zip none

Description Tomasz Zarna CLA 2011-12-08 07:15:37 EST
I20111207-2118

Steps:
1. Go to Orbit repo :pserver:anonymous@dev.eclipse.org:/cvsroot/tools
2. Check Out As > org.junit
3. When asked for branch, refresh tags and pick one
4. From the same repo, Check Out As > org.hamcrest
5. When asked for branch, again refresh tags first
=> IS: all branches are shown, from org.junit and org.hamcrest
=> SHOULD BE: only branches from the latter should be shown

It seems to be caused by bug 339990.
Comment 1 Malgorzata Janczarska CLA 2011-12-08 10:32:50 EST
I'll try to investigate it ASAP
Comment 2 Malgorzata Janczarska CLA 2012-01-19 10:04:15 EST
The problem is that fixing bug 339990 we assumed that having two cache entries: one for a module and second for its submodule is an error situation or at least extraneous. If we know that Branch1 is in "module1" we don't really need information that Branch1 is in "module1/submodule1", because the only place where we ask for it top modules. It occurs that it's not true. We try to keep as detailed information as possible and there are some places where we need this information for submodule.
Based on this I found another way to reproduce bug 339990. You don't need to create new branch each time you want to reproduce it. All you need to do "Replace with -> Another branch or version" and then go to the repositories view.
Anyway I think that the best way to fix  bug 339990 is to revert the last fix and then leave the detailed paths in cache, but filter them in the repositories view.
Comment 3 Malgorzata Janczarska CLA 2012-01-19 10:16:13 EST
Created attachment 209749 [details]
fix

This fix reverts fix for bug 339990 and changes as follows:
* branches are still cached with detailed paths
* in repositories view paths for branch are filtered: if we have a module and its submodule, the submodule will not be displayed
* if we have a submodule in the view and hit "refresh branches" the submodule will be replaced with the module (but only in the view, submodule still stays in the cache)
* I found out why previously we had to make an extra commit in tests to see tags: we where using "buildResources" instead of "addResources" and files wheren't added to the project and committed. Empty project doesn't store tags, because tags are stored only for files. I used addResources and now extra commit is not necessary.
Comment 4 Malgorzata Janczarska CLA 2012-01-19 10:16:18 EST
Created attachment 209750 [details]
mylyn/context/zip
Comment 5 Tomasz Zarna CLA 2012-02-09 11:30:09 EST
Gosia do we have a regression test for the scenario from comment 0?
Comment 6 Malgorzata Janczarska CLA 2012-02-09 11:53:30 EST
(In reply to comment #5)
> Gosia do we have a regression test for the scenario from comment 0?
No, I'll add it.
Comment 7 Malgorzata Janczarska CLA 2012-02-16 05:03:45 EST
We had a talk with Tomek yesterday and we came to the conclusion that the only way to make it work 100% correctly is to change the way cache is build and rendered to the user. Right now cache does not take into the account fact that structure on the server is hierarchical. Paths in cache are added whenever the check for tags in given path is made, no meter where exactly are the tags found (if this is directly under given path, or deeper in the hierarchy).
Comment 8 Malgorzata Janczarska CLA 2012-02-27 06:57:55 EST
Created attachment 211659 [details]
Hierarchical cache fix

This patch changes the cache structure to hierarchical and also changes the view to show only tagged CVS folders in the repository view.
This version is not final as I am still working on jUnits to cover the various repository structures tagging.
Comment 9 Malgorzata Janczarska CLA 2012-02-27 06:58:01 EST
Created attachment 211660 [details]
mylyn/context/zip
Comment 10 Malgorzata Janczarska CLA 2012-02-27 07:04:32 EST
While investigating this problem I also found that tags are not removed from cache if they where removed from the repository, see bug 372639.
Comment 11 Malgorzata Janczarska CLA 2012-02-27 13:35:15 EST
Created attachment 211682 [details]
Hierarchical cache + tests

Added some tests.
Comment 12 Malgorzata Janczarska CLA 2012-02-27 13:35:24 EST
Created attachment 211683 [details]
mylyn/context/zip
Comment 13 Tomasz Zarna CLA 2012-02-28 03:40:39 EST
(In reply to comment #11)
> Created attachment 211682 [details]
> Hierarchical cache + tests

Pushed to Gerrit: https://git.eclipse.org/r/#/c/5175/
Comment 14 Malgorzata Janczarska CLA 2012-02-29 10:45:41 EST
I opened Bug 372862 to address more extensive problems with cache and moved attachment 211682 [details] there. Hire we will solve only the current issue.
Comment 15 Malgorzata Janczarska CLA 2012-03-07 10:15:57 EST
Fixed with 37e006cad45d19a55c35dcb0e0123333f8cacb6f
Comment 16 Malgorzata Janczarska CLA 2012-03-07 10:16:43 EST
(In reply to comment #15)
> Fixed with 37e006cad45d19a55c35dcb0e0123333f8cacb6f
Sorry, wrong commit 9dc5b700ad5d2dc49a8ff00037ec8f5763cdc2b4