List Info

Thread: Problem with eol-style=CRLF.




Problem with eol-style=CRLF.
user name
2007-05-25 22:32:29
Hi,

I encountered the following issue converting a CVS
repository where all 
text files have to be CRLF (FreeDOS):

Used cvs2svn (1.5.0) on Linux, with
DefaultEOLStyleSetter('CRLF') in the 
options file, conversion happened without problems.

When checking out from the new SVN repository I noticed that
all checked 
out files had CRLF line endings (correct), but as soon as I
changed a file 
and 'svn diff'ed it reported that the whole file changed its
line endings 
from LF to CRLF (not correct).

The cause is that cvs2svn converts the text files to have LF
line endings 
whereas subversion expects them to have CRLF line endings in
the 
repository (only when eol-style is set to CRLF obviously).

I worked around it by changing dumpfile_delegate.py to do

     if s_item.needs_eol_filter:
       data_reader =
CRLF_EOL_Filter(LF_EOL_Filter(pipe.stdout))
     else:
       data_reader = pipe.stdout

and

class CRLF_EOL_Filter:
   """Filter a stream and convert all LF
end-of-line markers
   into CRLFs."""

   def __init__(self, stream):
     self.stream = stream
     self.eof = False

   def read(self, size):
     while True:
       buf = self.stream.read(size)
       self.eof = len(buf) == 0
       buf = buf.replace('n', 'rn')
       if buf or self.eof:
         return buf

this is just a quick workaround I could use for FreeDOS; a
proper solution 
would also care about CR line endings and do the right
thing.

Bart

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribecvs2svn.tigris.org
For additional commands, e-mail: dev-helpcvs2svn.tigris.org


Re: Problem with eol-style=CRLF.
user name
2007-10-17 17:53:13
Bart Oldeman wrote:
> I encountered the following issue converting a CVS
repository where all
> text files have to be CRLF (FreeDOS):
> 
> Used cvs2svn (1.5.0) on Linux, with
DefaultEOLStyleSetter('CRLF') in the
> options file, conversion happened without problems.
> 
> When checking out from the new SVN repository I noticed
that all checked
> out files had CRLF line endings (correct), but as soon
as I changed a
> file and 'svn diff'ed it reported that the whole file
changed its line
> endings from LF to CRLF (not correct).
> 
> The cause is that cvs2svn converts the text files to
have LF line
> endings whereas subversion expects them to have CRLF
line endings in the
> repository (only when eol-style is set to CRLF
obviously).

Thanks for pointing out this problem.  I have just fixed
cvs2svn to
handle this correctly for all EOL styles.  The changes are
in trunk,
r4224.  If you have a chance, please try the new version out
and let us
know if it works for you.

Michael

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribecvs2svn.tigris.org
For additional commands, e-mail: dev-helpcvs2svn.tigris.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )