Summary: | [Patch] Create Patch ignores lines at end of file | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Philip Mayer <eclipsetalk2> | ||||||
Component: | CVS | Assignee: | Tomasz Zarna <tomasz.zarna> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | benno.baumgartner, markus.kell.r, martinae, pawel.pogorzelski1, tobias_widmer | ||||||
Version: | 3.2 | ||||||||
Target Milestone: | 3.5 M2 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Philip Mayer
2005-11-11 10:17:19 EST
Just stumbled over this again. A target milestone of 3.4 would be much appreciated. OK Thanks :-) Mass update - removing 3.4 target. This was one of the bugs marked for investigation (and potential fixing) in 3.4 but we ran out of time. Please ping on the bug if fixing it would be really important for 3.4, and does not require API changes or feature work. Please fix for 3.5. We fall into this trap in every release cycle (this time, it was bug 102020). Created attachment 109774 [details]
Fix v01
The problem here was caused by the fact that when adding new files fileReader#readLine used in DiffOperation#addFileToDiff gave us no information if a read line had a line ending character. The patch changes it, so the last line for an added file is now carefully scanned (char by char) and if it doesn't have CR or LF an extra line is added which informs about that fact (ie "\ \ No newline at end of file").
There is one more thing, the patching mechanism (LineReader to be more precise) uses a flag called "ignoreSingleCR" which when set to true doesn't treat single CR's as line delimiters. I turned this off, but I think it should has the same value as the one used while patching (which is on "to be consistent with command line patch").
Created attachment 109775 [details]
mylyn/context/zip
Released to HEAD. Please let me know if this fixes the issues you had, have or would have when creating patches. Verified on build I20080918-0100. |