| Summary: | Compare marks differences in incorrect places | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Malgorzata Janczarska <malgorzata.tomczyk> | ||||||||
| Component: | Client | Assignee: | libing wang <libingw> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | major | ||||||||||
| Priority: | P3 | ||||||||||
| Version: | 2.0 | ||||||||||
| Target Milestone: | 3.0 M2 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows 7 | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Malgorzata Janczarska
Created attachment 227673 [details]
Incorrectly marked diffrences
At this screenshot you can see that the second difference should be in fact a line higher.
Created attachment 227675 [details]
Left side file
Created attachment 227676 [details]
Right side compare file
was able to reproduce it by comparing the two files in Orion. Will dig out further... narrowed down a little bit with something really simple LEFT: 123 456 789 RIGHT: 321 654 789 It seems if the first line has diff on both side jsdiff treats the line delimeter as a new line common to both side. This fools the compare engine there is a common line on the second line. As a result, all the diff parts are drifting 1 line below. I also tried a pair like below : 111 123 456 789 AND, 111 123 456 789 As the first line is the same, jsdiff does not hit that hole. Everything is fine then.
> 111
> 123
> 456
> 789
> As the first line is the same, jsdiff does not hit that hole. Everything is
> fine then.
111
321
654
789
fixed with http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=a984fc3ad46e41236ac0f8a4f55069bb485250e3. It turned out that the jsdiff gives back the following stream items, when line ending has "\r\n". LEFT : first line added, without line end RIGHT: first line removed, without line end LEFT&RIGHT: a common line , value is barely a line end LEFT : second line added, without line end RIGHT: second line removed, without line end LEFT&RIGHT: a common line , value is barely a line end LEFT&RIGHT: a common line , value is "789\r\n" This stream will mislead the compare engine to generate more diff blocks than expected. I've improved the jsdiff adapter to handle this hole and added more test cases in compare tests. Gosia, good catch. This will prevent some potential issues in jazzHub if compare page come up because jazzHub's diff does not come from server any more. |