Bug 18807 - Compare with patch fails due to missing LF
Summary: Compare with patch fails due to missing LF
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 blocker (vote)
Target Milestone: 2.0 F3   Edit
Assignee: Andre Weinand CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-03 13:01 EDT by Dani Megert CLA
Modified: 2002-06-13 05:00 EDT (History)
0 users

See Also:


Attachments
Strange patch file (1.41 KB, patch)
2002-06-04 11:54 EDT, Andre Weinand CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2002-06-03 13:01:42 EDT
Build F2

Happens on Windows on 'CR' as line delimiter with files that have mixed line
delimiters i.e. also have (CR,LF) as line delimiter

1. Add J9 plug-in from CVS
2. Delete the package from the source folder
3. Create a patch for that project (note: to file or to clipboard)

Look at the patch with a binary editor (which does not do smart line termination.
Note: We looked at the patch in Notes editor which let us assume that '-' are
missing - but they are there.
Comment 1 Andre Weinand CLA 2002-06-04 09:02:33 EDT
F3 candidate.
Comment 2 Andre Weinand CLA 2002-06-04 11:52:26 EDT
I tried to narrow down the problem:
- Add org.eclipse.jdt.launching.j9 from CVS
- Delete the class J9LaunchingPlugin.java
- Create a patch for that project
I've attached the resulting patch file.

Observe:
the patch has 11 lines to be deleted.
However the original file has 39.
If you open the patch file with Notepad you can see that there are 3 lines with 
line delimiters not recognized by CVS although the file was checked into CVS as 
Text -kkv. These lines contain more than one original lines concatenated.

Question: is this a legal patch file? Should I be able to apply this 
successfully or should I flag an error?
Comment 3 Andre Weinand CLA 2002-06-04 11:54:10 EDT
Created attachment 1228 [details]
Strange patch file
Comment 4 Andre Weinand CLA 2002-06-04 11:57:25 EDT
If you view the file within Bugzilla it looks quite normal. However since it is 
the result of a file deletion all lines should have '-' as the first character.
Viewing it within Notepad reveals the problem better.
Comment 5 Michael Valenta CLA 2002-06-06 11:44:04 EDT
How did the file end up with CRs as line delimiters?
Comment 6 Dani Megert CLA 2002-06-06 12:43:06 EDT
We have tons of files that are like this. The Java editor can handle this that's
why we don't see it immediately.

Probably happend due to editing a file on different OSs and/or using copy&paste.
Comment 7 Michael Valenta CLA 2002-06-06 13:01:52 EDT
Although the patch looks strange, it is a well-formed patch. From a CVS 
perspective, a CR is not a character of interest. Could you apply the patch 
properly?
Comment 8 Dani Megert CLA 2002-06-07 02:42:47 EDT
The summary says it all ;-)


Comment 9 Michael Valenta CLA 2002-06-07 08:46:22 EDT
Moving to compare. The patch is a valid patch. The local file should only have 
CRs just as the remote file does. Therefore, the comparision should work. This 
is a strange case because it is actually a deletion so there is no local file.
Comment 10 Andre Weinand CLA 2002-06-07 13:45:35 EDT
Fixed for 20020607

Verified by Dirk Baeumer
Comment 11 Dirk Baeumer CLA 2002-06-13 05:00:49 EDT
Verified.