1166: view diff failed for files contain Mac newline char (i.e. CR \r) -- use SVN client
- WontFix
- Review Board
ff**@datasyn******** (Google Code) (Is this you? Claim this profile.) | |
Jan. 22, 2012 | |
1743 |
What version are you running? RB 1.0rc2 on linux RBTools-0.2beta1-py2.5 on windows What's the URL of the page containing the problem? click "view diff" What steps will reproduce the problem? 1. in my svn repos, i have a file that uses \r as line separater in portions, make some change in working copy and use post-review to create review request 2. click "view diff" it says "The patch to '/modules/cpp- support/trunk/build/openssl/pom.win32-vc6.xml' didn't apply cleanly, blah blah" What is the expected output? What do you see instead? click "view diff" it says "The patch to '/modules/cpp- support/trunk/build/openssl/pom.win32-vc6.xml' didn't apply cleanly, blah blah" What operating system are you using? What browser? run post-review on windows; ReviewBoard server on linux; SVN Please provide any additional information below. As some portion of the file contains only \r, GNU diff doesn't treat it as a line separator, the generated patch file has very small line number in chunk range and long single context lines contains \r. However post-review sets 'universal_newlines=True' in execute(), when long context lines are splitted when "svn diff" returns from execute() and thus generates a corrupted patch file. What's more review board also tries to normalize new lines in reviewboard/diffviewer/diffutils.py, so this will damage patches lines that contains only '\r' I'm attaching the source file and the corrupted diff file, as you can see, also the chunk range says @@ -1,3 +1,3 @@, there are around a dozen context lines in the chunk.
my xml file contains only \r in some part. it's stored in SVN. also upload the corrupted diff file, wireshark shows that it's already corrupted on the post-review side.
-
+ +
Would you mind upgrading to the nightly of RBTools? This should be fixed. There will be a release in a few days, if you want to wait until then.
-
+ NeedInfo
I couldn't figure out how to apply nightly post-review and review-board upgrades, is there any FAQ url? Thanks for the fix and the great product.
It seemed it's not fixed for svn client on post-review side. I tried the RC3 release and RBTools 0.2beta2 nightly dev kit.
Using the following file as an example (all termination characters are CR (or \r)): Sample file. Should contain only CR (\r) as line termination. (I used scite editor to convert an examine the line termination.) $ post-review -d -n default >>> Processing add of //depot/prod/code-quality/code-review/rbtools/sample.cronly >>> p4 -G where //depot/prod/code-quality/code-review/rbtools/sample.cronly >>> diff -urNp /tmp/tmpFhtK-S /u/laurentn/p4/code-review/rbtools/sample.cronly --- //depot/prod/code-quality/code-review/rbtools/sample.cronly //depot/prod/code-quality/code-review/rbtools/sample.cronly#1 +++ //depot/prod/code-quality/code-review/rbtools/sample.cronly 2010-03-10 21:39:27 @@ -0,0 +1 @@ the line termination.)o convert an examine \ No newline at end of file ======================================================================== Note that the issue really comes from the underlying diff utility. This is with rbtools 0.2RC2 on linux, but the same issue is seen on Windows as well, the whole file is seen as a single line by diff (though I only change scite to SciTE: C:\Python25\Scripts>..\diff.exe sample.cronly sample2.cronly 1c1 the line termination.)o convert an examine \ No newline at end of file --- the line termination.)o convert an examine \ No newline at end of file C:\Python25\Scripts>
-
+
Having investigated this a little more, there's really nothing we can do. Having mixed/partial line endings is fatal for almost any tool that needs to try to parse the file, and especially for something as complicated as review board. You'll find that everything works much, much better if you just fix the files in source control.
-
- New + WontFix