Community
Participate
Working Groups
I'd like to compare two Java source directories ind two different projects located in the same workspace. To perform this task, I select directory A and B and "Compare With -> Each Other". The result is a little bit confusing and so not correct. 1. Files are compared using their timestamp and not using there contents. Thus, Java source files are shown as "changed" although they have no difference. 2. The selection order is not considered. It is always assumed that the first directory that comes first in the "Package Explorer" view is the base directory and the second directory is the target directory. 3. Added/Removed resources (files/directories) are not handled. I couldn't found a way to copy resources that exist in "B" into "A" and to delete resources in "A" that don't exist in "B". Background: The source project is located in CVS and the target in our local repository (ClearCase). It is currently not possible to place on project into two different repositories. But I need a way to easy merge changed done in the source projects CVS into the target project located in ClearCase. A good way is the "Compare With -> Each Other" action, because its comparer also uses the auto-checkout option.
Compare With->Each Other is provided by the Compare component, so moving bug. Wrt. #1 though, when you open the Compare editor you get a toolbar button (in the top toolbar, not the editor's) with hover help "Ignore Whitespaces where Applicable". This should give you what you want. I will leave Compare to comment on #2 and #3.
I know of this option but it is useless. Whether it is active or not the file list always contains elements with different timestamps although their filecontent is equal. Also ignoring whitespace is not enough if whitespaces only consist of tabs and spaces. It should also be possible to ignore different line seperators between Unix and Windows. ClearCase for example handles them automatically. It converts line seperators on checkin and checkout.
- "Compare with Each Other" doesn't look at timestamps. It just considers contents. So if the file is listed in the resource view of "Compare With Each other" it must have differences. - If files have different line separators but otherwise have the same content, they are considered "different" (we have a feature request for this) - ignore whitespace is handled in the structure compare viewer (right pane) and the content compare viewer (bottom pane). In case of Java files "ignore whitespace" even eliminates formatting differences (across multiple lines). - SWT doesn't provide "selection order". SWT returns the native order (whatever that is).
Do you know the id of the feature request? I didn't found (or find?) it doing a query before filling this report. According to your comments I suggest changing this bug into a feature request for adding an "Compare With -> Local Folder/File" action. Is it ok?
The bug is: #30883: Compare viewer shows false positives with "ignore whitespace" turned on Yes, please go ahead and rename this bug and change severity into "enhancement". Thanks.
The propose of this feature request is to add an action into the "Compare With" group. It should enabled the user to compare a file or folder (container) with a file or folder located in the local filesystem (or workspace). The "Compare With -> Each Other" is not suitable for this because it is not possible to set the difference between source and target folder, although it might the easily enhanced to provide the new action. The action must decide between source and target folder. As a result is must be possible to merge the content of the source folder into the target folder (eg. delete files/folders in the target folder that doesn't exists in the source folder and copy new/changed files/folder from the source folder into the target folder).
I'm going to make this one a duplicate of #21817, which is alread planned for 2.2. However, did you try to use a "linked" folder? Just create a folder in an existing (or new) project and press the "Advanced >" button. Here you can specify an external folder to "link to". With this setup you can compare workspace files to external files without having to copy them into the workspace first. *** This bug has been marked as a duplicate of 21817 ***