230: The "View Diff" does not show correctly file differences

stanim*******@gmai***** (Google Code) (Is this you? Claim this profile.)
chipx86
chipx86
Oct. 5, 2007
What's the URL of the page containing the problem?
http://reviewboard.eng.vmware.com/r/2945/diff/#index_header

What steps will reproduce the problem?
1. Just open the page
2. Look at the link: tocWizard.py: 2 changes [ 1  2   ]
3. Now go the the diff for this file.

What is the expected output? What do you see instead?

The expected output is a diff which will show only the two differences and
hide the unmodified parts of the file.

What you see instead is the whole file shown in yellow. The differences are
not correctly highlighted at all.

What operating system are you using? What browser?
OS: Windows XP Professional SP2, Firefox 2.0.06


Please provide any additional information below.
david
#1 david
  • +Component-DiffViewer
#2 stanim*******@gmai***** (Google Code) (Is this you? Claim this profile.)
After some observation we started to suspect that the problem is due to the fact that
in the repository (perforce) some files were submitted with DOS line endings. So
maybe the DiffViewer does not handle 100% correctly that particular case
#3 email.*******@gmai***** (Google Code) (Is this you? Claim this profile.)
#4 email.*******@gmai***** (Google Code) (Is this you? Claim this profile.)
(For the patch see previous comment, somehow deleted the text)

We had the same problem, the attached patch fixes our case.
chipx86
#5 chipx86
The patch was proposed once before but breaks a lot of cases. The "\n" is intentional
(we moved away from splitlines()). The case normalization needs to happen in the
patching process. Which we do already, so I'm confused as to why this is happening.
But no, using splitlines() is the wrong solution and will break a whole lot of common
uses, as we've discovered.
chipx86
#6 chipx86
I should be more specific. splitlines(), when operating on files with lots of unicode
characters, will split lines at places you wouldn't expect. I have a fix in mind that
I will test tomorrow, and hopefully we'll have this fixed soon.
  • +chipx86
chipx86
#7 chipx86
Fixed in SVN. We'll do a server upgrade this weekend.
  • +Fixed