[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Bug: "svn diff" regards CR (^M) as EOL under Unix

From: Vincent Lefevre <vincent+svn_at_vinc17.org>
Date: 2007-05-14 17:30:30 CEST

Under Unix (both Linux and Mac OS X, with svn 1.4.2 and 1.4.3
respectively), svn regards the CR (^M) character as an end-of-line,
though the svn:eol-style property isn't set.

To reproduce this bug, commit file diff-cr-bug1 (attached). This file
contains:

00000000 31 0d 61 0d 0a 32 0d 62 0d 0a 33 0d 63 0d 0a 34 |1.a..2.b..3.c..4|
00000010 0d 64 0d 0a 35 0d 65 0d 0a 36 0d 66 0d 0a 37 0d |.d..5.e..6.f..7.|
00000020 67 0d 0a 38 0d 68 0d 0a 39 0d 69 0d 0a |g..8.h..9.i..|
0000002d

Then do "svn cp diff-cr-bug1 diff-cr-bug2" and modify diff-cr-bug2
according to the attachment. This file contains:

00000000 31 0d 61 61 0d 0a 32 0d 62 0d 0a 33 0d 63 0d 0a |1.aa..2.b..3.c..|
00000010 34 0d 64 0d 0a 35 0d 65 0d 0a 36 0d 66 0d 66 0a |4.d..5.e..6.f.f.|
00000020 37 0d 67 0d 0a 38 0d 68 0d 0a 39 0d 69 0d 0a |7.g..8.h..9.i..|
0000002f

"svn diff diff-cr-bug2 | less" shows here:

Index: diff-cr-bug2
===================================================================
--- diff-cr-bug2 (revision 17290)
+++ diff-cr-bug2 (working copy)
@@ -1,5 +1,5 @@
 1^M-a
+aa
 2^M b
 3^M@@ -9,7 +9,8 @@
 5^M e
 6^M-f
+f^M+f
 7^M g
 8

while "svn diff --diff-cmd =diff diff-cr-bug2 | less" shows that the
system diff behaves correctly:

Index: diff-cr-bug2
===================================================================
--- diff-cr-bug2 (revision 17290)
+++ diff-cr-bug2 (working copy)
@@ -1,9 +1,9 @@
-1^Ma
+1^Maa
 2^Mb
 3^Mc
 4^Md
 5^Me
-6^Mf
+6^Mf^Mf
 7^Mg
 8^Mh
 9^Mi

Note: The real files are HTML files with mixed LF and CRLF end of lines,
so that I can't change the svn:eol-style property as a workaround. Mixed
end of lines are a bad idea, but this is correct from a HTML point of
view.

-- 
Vincent Lefèvre <vincent_at_vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Mon May 14 17:30:45 2007

This is an archived mail posted to the Subversion Dev mailing list.