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

RE: svn corrupts binary files on import

From: Paul Koning <pkoning_at_equallogic.com>
Date: 2005-09-23 23:58:16 CEST

>>>>> "Federico" == Federico Sacerdoti <Sacerdoti> writes:

 Federico> I think Paul hit the nail on the head - I had not marked
 Federico> files as binary in CVS. Not that I ever had to (because of
 Federico> the reasons he mentioned), but I think many people run CVS
 Federico> without concerning themselves about binary file types.

In that case they are simply lucky that their files are still intact.
The book is quite explicit (see "how to store binary files" in the CVS
info file).

I know you're right about many people not doing this, though -- which
explains why I found 2250 files in our repository that were not
correctly marked!

 Federico> If svn has a heuristic for guessing binaries, then cvs2svn
 Federico> should use it too I would think.

SVN treats all files as binary (in the sense of not modifying the file
content) unless you tell it otherwise. cvs2svn by default assumes
that you marked binary files in CVS as is the rule for CVS. I think
that all makes sense. It's reasonable for cvs2svn to default to using
the CVS -kb markings given that the CVS book says that flag exists for
this precise purpose.

A nice way to catch this problem: check out your CVS repository,
convert it, check out the converted SVN repository. diff -r the
files. You may get some differences from RCS keyword substitution
(fewer of them if you turn off that silly feature). And you may get
differences due to line endings being native vs. not native. (I added
a --ignore-eol switch to my diff to deal with that.) Finally, you'll
get some differences due to incorrectly marked files. Most of them
will show up as "Binary files foo and bar differ". Occasionally, diff
may not recognize a file as binary, and then you'll get blobs of
"text" that don't match. Very entertaining, text mode compares of PDF

Edit out the differences that aren't due to the binary issue, extract
the filenames of the binary file mismatches, generate from that a
script with "cvs admin -kb" applied to each of those names, and
presto, your CVS repository is repaired. Convert again, and now
diff -r should be clean.


To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat Sep 24 00:00:10 2005

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.