trouble with mixed-EOL files with svn:eol-style=native

Bug #256050 reported by Colin Watson
10
Affects Status Importance Assigned to Milestone
Launchpad CSCVS
Triaged
Low
Unassigned
SciPy
New
Undecided
Unassigned

Bug Description

Occasionally somebody manages to create a Subversion repository in which some revisions of a file contain a mixture of end-of-line styles, but svn:eol-style=native. This requests Subversion to perform end-of-line character translation on checkout, which it will refuse to do in the presence of mixed EOL styles. For instance:

  $ svn cat -r998 svn://svn.tartarus.org/sgt/putty/x11fwd.c >/dev/null
  svn: Inconsistent line ending style

This broke the putty import:

  http://launchpadlibrarian.net/16631291/putty-trunk-log.txt

While Subversion itself doesn't make it easy to do this, it is possible to end up in this situation due to a conversion from CVS, as indeed is the case for putty. We should somehow arrange to be able to import such branches anyway.

There are a couple of possibilities, which mostly look like they would involve reimplementing svn_client_cat2. We could ignore the svn:eol-style property on anything that raises this exception, or we could arrange to set the repair flag for svn_subst_stream_translated. I think the former will produce a mixed-EOL output file while the latter will just blat all the newlines in the file into the native format.

From what I can tell, Subversion's pedantry here is in order to avoid corrupting binary files that mistakenly have svn:eol-style=native set. Yes, those will end up corrupted anyway if you check them out on a platform with a different EOL style, but at least you can repair them on the original platform, which is probably the common case anyway. However, I think this is less of an issue for code imports. Not only is it perhaps more likely that people will be checking out the branch on a different platform, but also the original branch remains available and in extremis one could always retrieve the binary file from there. In most cases, I suspect that later revisions of the file will have had their EOL inconsistency repaired or the svn:eol-style property removed, as appropriate; in the case at hand, 'svn cat svn://svn.tartarus.org/sgt/putty/x11fwd.c' (the current revision) succeeds.

Tags: svn
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Oh, interesting, we've seen this error code a bunch of times before:

https://help.launchpad.net/VcsImportRequests#[svn]%20ClientError:%20Code:%2000020f58

Thanks for digging into it! No thanks for how grotty the problem turns out to be, but I guess that's not your fault :)

Revision history for this message
Colin Watson (cjwatson) wrote :

If you'd like to indicate which of the options I suggested you'd prefer (producing a mixed-EOL output file vs. blatting all the newlines in the file into the native format; or perhaps something else entirely), I might have some time to work up a patch.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I'm not sure I'm the best person to ask, to be honest -- you, as a client of the service, probably have a much better idea :) I guess I'd lean slightly towards mixed newlines -- seems a bit more honest, somehow.

I also think it's unlikely to make much difference -- if the mixed newline files date from a CVS conversion, probably it's long ago enough for noone to care...

Revision history for this message
Jarrod Millman (jarrod-millman) wrote :

I think that either of your two suggestions (mixed-EOL output file vs. blatting all the newlines into the native format) would be perfectly fine. I will ask on the NumPy/SciPy developer's lists to see if anyone else has an opinion. Thanks for offering to work on this!

Revision history for this message
David Cournapeau (david-ar) wrote :

I think keeping the mixed EOL is more "honest", indeed. For scipy, I don't think we care because a EOL which is not unix is a bug and is fixed right away whenever we find on of those anyway.

Paul Hummer (rockstar)
Changed in launchpad-cscvs:
importance: Undecided → Medium
status: New → Triaged
tags: added: svn
Revision history for this message
Robert Collins (lifeless) wrote :

FWIW Launchpad uses bzr-svn now, not cscvs, so this bug shouldn't be affecting scipy anymore.

Changed in launchpad-cscvs:
importance: Medium → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.