Bug 115395 - TextStreamMerger always uses '\n' as line ending
Summary: TextStreamMerger always uses '\n' as line ending
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.2 M4   Edit
Assignee: Andre Weinand CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-07 16:52 EST by Bogdan Gheorghe CLA
Modified: 2006-04-27 18:51 EDT (History)
1 user (show)

See Also:


Attachments
Patch to IStreamMerger (1.61 KB, patch)
2005-11-29 12:10 EST, Michael Valenta CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bogdan Gheorghe CLA 2005-11-07 16:52:45 EST
performThreeWayMerge in MergeContext makes use of Compare's IStreamMerger to
merge. Somehow the line endings get messed up after the merge.

Repro steps (using 3.2 M3):

1. Check out a project from CVS twice into the same workspace (using a different
name for the second one).

2. Turn on model merging Window>Preferences>Team>CVS>Work In Progress

3. Make a change in any file in Project1. Create a patch of your change from
Project1 and apply it to Project2.

4. Commit changes to Project2.

5. Update Project1. If you compare the file you just updated in Project1 with
the latest from HEAD, you will see that there are changes in the line endings.
(Or you can also try to Clean Timestamps and notice that it doesn't work).
Comment 1 Michael Valenta CLA 2005-11-29 12:10:24 EST
Created attachment 30783 [details]
Patch to IStreamMerger

Here's a patch to IStreamMerger that makes it use the platform line ending instead of just '\n'. This may not be the proper behavior either though. It may be better to use whatever line ending is used in the incoming streams or, if they are not the same, use the Eclipse platform new file line ending.
Comment 2 Michael Valenta CLA 2005-11-29 12:13:43 EST
Moving to Compare. Andre, was there a reason that the outgoing line-ending of the TextStreamMerge was just '\n'?

P.S. The patch is for TextStreamMerger, not IStreamMerger
Comment 3 Andre Weinand CLA 2005-12-07 17:11:13 EST
modified patch released and tests adapted
Comment 4 Dani Megert CLA 2005-12-13 04:40:44 EST
Start verifying...
Comment 5 Dani Megert CLA 2005-12-13 04:48:56 EST
The patch improves the situation but still has problems when the files are checked out with a line delimiter that's different from System.getProperty("line.separator").
Comment 6 Michael Valenta CLA 2005-12-13 08:51:22 EST
This is true (as stated in comment 1). The purpose of the patch was to make the TextStreamMerger usable on non-*nix platforms for most users.
Comment 7 Michael Valenta CLA 2005-12-13 16:12:40 EST
It does not appear that this is in the M4 test candidate build. The compare.map file has not been updated.
Comment 8 Andre Weinand CLA 2006-04-27 18:51:47 EDT
In build now.