Bug 350905 - Resources Filter
Summary: Resources Filter
Status: CLOSED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 4.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Serge Beauchamp CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2011-07-01 05:09 EDT by Nicolas.Del.Col-EXT CLA
Modified: 2011-07-18 06:37 EDT (History)
3 users (show)

See Also:


Attachments
How to create a linked resource folder (78.07 KB, image/jpeg)
2011-07-05 03:10 EDT, Serge Beauchamp CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas.Del.Col-EXT CLA 2011-07-01 05:09:00 EDT
Build Identifier: 20110615-0604

Hi,

I work on an existing project, with lot of files.
My work is to exclude some of this files, and keep only a specific list.

To avoid copy each time a file was modify, I use 'file system repertory link'.
I don't create a new source repertory, but I link on the common repertory.

I use the Resources Filter to select only the file list I want. And I fill a big list with 400 files more or less.
Each time I validate my list, it's take soooo much time !
I search into my workspace files, and I discover the .project with 48000 lines ! and my list of 400 files repeat many many times !

I correct with an editor the redundancy, but I think it's a big bug.
when I modify the 'Resources Filter' it seems to concatenate the current list, without regarding the duplicate.

It's takes so much time I haven't look for this to confirmate my theory of concatenation.

Reproducible: Always

Steps to Reproduce:
1. create a folder with advanced option "linked to alternate location"
2. properties of this repertory : "Resources Filter"
3. add somes files in include, validate, save le .project in .project_bck
4. add one more file in include, validate, compare the new .project with the .project_bck
Comment 1 Dani Megert CLA 2011-07-05 02:56:24 EDT
>2. properties of this repertory : "Resources Filter"

How exactly do you do this?
Comment 2 Serge Beauchamp CLA 2011-07-05 03:07:30 EDT
Hi, 

From what I can understand, you are creating a large set (400) of linked resource files, which are recorded in the .project.

Resources filters do not affect linked resource files, since those files are explicitly created.

To use resource filters, you have to set them on a linked resource folder, which will be recorded in the .project file as a single entry.
Comment 3 Serge Beauchamp CLA 2011-07-05 03:10:54 EDT
Created attachment 199089 [details]
How to create a linked resource folder

Here's a screenshot that shows how to create a linked resource folder when drag and dropping files and folder onto a project in the navigator.

From what I understand, you selected the 3rd option (a set of linked resource files and virtual folders) instead of the 2nd option (a single linked resource folder).
Comment 4 Serge Beauchamp CLA 2011-07-05 03:11:31 EDT
I'll flag this bug as invalid.  Feel free to re-open it if you think I missed something.
Comment 5 Nicolas.Del.Col-EXT CLA 2011-07-05 04:00:05 EDT
(In reply to comment #4)
> I'll flag this bug as invalid.  Feel free to re-open it if you think I missed
> something.

I don't create files in my link folder, I filter files in the link folder.

The only thing I do, it's to force the abort of the refresh workspace process... when it takes more than 1 hours... And during this time I can't do a single task on my project... I don't have all this time to do this, and I do this only the evening for the next day.

When I kill the process running, I think it's at this time the .project is polluted. Perhaps it's at the end of the proccess the duplicates are deleted in .project ?

I think you could also think about a way to get a big list of file in the Resources filter, because add 400 items one by one... it's long !
I can't sort them in alphbetical order or rearrange them to see if I don't miss one when I update my list.

I don't have time to test how I can reproduced this, but I know my .project with 48000 lines is not normal.
I create another new project and filter my ressource with a single occurence of file : it takes 8000 lines only. How I get the 48000 lines file with a lot of duplicates ?

If you haven't time to correct this, or find a way to reduce the workspace refresh after Resources filter update, I understand :-)
But there is a problem.

Thx
Comment 6 Serge Beauchamp CLA 2011-07-05 04:56:43 EDT
(In reply to comment #5)
> (In reply to comment #4)
> > I'll flag this bug as invalid.  Feel free to re-open it if you think I missed
> > something.
> 
> I don't create files in my link folder, I filter files in the link folder.
> 
> The only thing I do, it's to force the abort of the refresh workspace
> process... when it takes more than 1 hours... And during this time I can't do a
> single task on my project... I don't have all this time to do this, and I do
> this only the evening for the next day.


I'm not to reproduce this issue.  Creating resource filters on a linked resource folder creates a single entry (~10 lines) in the .project file.

The steps you specified below are ambiguous:

3. add somes files in include, validate, save le .project in .project_bck
4. add one more file in include, validate, compare the new .project with the
.project_bck

How exactly are you 'adding some files'?  What resource filter do you specify?

Adding files by specifying an 'Include' resource filter does not record those files in the .project file, only the resource filter itself is recorded.

Can you provide a snippet of your .project file to see what it contains?
Comment 7 Serge Beauchamp CLA 2011-07-05 09:34:10 EDT
Something comes to mind, are you manually adding a single resource filter for each single file that you want to be visible in the project?

This would indeed create an entry in the .project file for each of those filters.

This is not the intended usage of the resources filters, although.

You can either add a filter that contains a generalization of what those files have in common (say, they all end with .foo, or their modification date is such and such), and add a resource filter for this generalization.

Otherwise, if you want only to include a specific set of random files, you can select them in explorer, and drag and drop them onto the project, and choose to create link files.
Comment 8 Nicolas.Del.Col-EXT CLA 2011-07-05 09:57:57 EDT
Hi,

I send you an email this morning with 2 .project and one extra error. Have you receive it ?

For the context, I will all explain.
I work on a big project, specific for a microcontroller.
My work is to build a tool with only the applicative part (my list of file from the project reference) and don't take the specific part and build it to run on PC, compile with GCC. (A big deal !)
As I don't control the main project, I know the list of file I want, but from a release to another, there migth be new files, not to integrate for reason X or Y. It's easier for me to put the list files I wan't, than exclude all the others files...

there are a lot of files in the main project : .xml, .txt, .a, .lib, etc but I take only .h and .c
I made a first folder "inc" linked to $dirRef : $dirRef/src + $dirRef/obj folder and *.h recursive from $dir (the .h are compile only if a .c include it, so it doesn't matter if I take them all : we are ok with this :-) )
and I made a second folder "src" linked to $dirRef : $dirRef/src + $dirRef/obj folder and my list of 400 files recursive from $dir
Why I place on $dirRef ? I know the list of files, but I don't know where there are physicaly. It's the complex file configuration of the main project who manage this.


My problem is : I work on a versionning tool, and I can only modify them from this tool. Not directly from the workspace (I loose my modification instead)
This is for this reason I can't copy/paste all my 400 .c files in the folder fill with the 300 other .c, a lot of .h and a lot of another files...
That's why I use folder link + Resources Filter.

I wish you understand all my context :-)

How I manage to get a .project with 48000 lines ? I don't know... but read my email from this morning, you have another case reproductible describe in it.

Thx
Comment 9 Serge Beauchamp CLA 2011-07-05 10:08:45 EDT
(In reply to comment #8)
> Hi,
> 
> I send you an email this morning with 2 .project and one extra error. Have you
> receive it ?
> 

Oh, I got them, yes, sorry, it got sorted in the bugzilla notification bin.

> For the context, I will all explain.
> I work on a big project, specific for a microcontroller.
> My work is to build a tool with only the applicative part (my list of file from
> the project reference) and don't take the specific part and build it to run on
> PC, compile with GCC. (A big deal !)
> As I don't control the main project, I know the list of file I want, but from a
> release to another, there migth be new files, not to integrate for reason X or
> Y. It's easier for me to put the list files I wan't, than exclude all the
> others files...
> 
> there are a lot of files in the main project : .xml, .txt, .a, .lib, etc but I
> take only .h and .c
> I made a first folder "inc" linked to $dirRef : $dirRef/src + $dirRef/obj
> folder and *.h recursive from $dir (the .h are compile only if a .c include it,
> so it doesn't matter if I take them all : we are ok with this :-) )
> and I made a second folder "src" linked to $dirRef : $dirRef/src + $dirRef/obj
> folder and my list of 400 files recursive from $dir
> Why I place on $dirRef ? I know the list of files, but I don't know where there
> are physicaly. It's the complex file configuration of the main project who
> manage this.
> 
> 
> My problem is : I work on a versionning tool, and I can only modify them from
> this tool. Not directly from the workspace (I loose my modification instead)
> This is for this reason I can't copy/paste all my 400 .c files in the folder
> fill with the 300 other .c, a lot of .h and a lot of another files...
> That's why I use folder link + Resources Filter.
> 
> I wish you understand all my context :-)
> 
> How I manage to get a .project with 48000 lines ? I don't know... but read my
> email from this morning, you have another case reproductible describe in it.
> 
> Thx

I understand your case.  What I would do, instead of tediously creating 400 resource filters for each single of those files, I would either:

- Create linked files for those 400 files.  You can create them with drag and drop, and it's much faster than creating those 400 resource filters.

OR 
- Create a single resource filter (that applies to all children) that include something like *.c

Resource filters have to be verified for each single file system entry, so if you have 400 resource filters, Eclipse has to verify for each single file system object if it matches one of those filters.  

Resources filters, by design, are not suitable for including a large set of random files.  Linked files are.  Resource filters are made to exclude or include large amount of files based on general characteristics (their file extensions, type, etc...)
Comment 10 Szymon Brandys CLA 2011-07-18 06:37:45 EDT
(In reply to comment #9)
> I would either:
> 
> - Create linked files for those 400 files.  You can create them with drag and
> drop, and it's much faster than creating those 400 resource filters.

This is what I would suggest too. You want to include some exact set of files, so do it using linked resources which are meant for such a thing.