Philippe Bruhat via RT wrote:
Show quoted text> <URL:
http://rt.cpan.org/Ticket/Display.html?id=25467 >
>
> On Thu Mar 15 11:12:30 2007, JPEACOCK wrote:
>> While trying to use the supplied svndump_replace_author.pl script on a
>> CVS repository converted with cvs2svn, I discovered that
>> SVN::Dump::Reader::read_record is chopping lines that are not empty from
>> an otherwise legitimate dumpfile.
>
> Can you send me your dump (or an extract of it that show the problem)?
> I'd like to add it to the test suite.
Let me manufacture one - not that my data is necessarily secure, but I'd
rather have a very straightforward reconstruction recipe (which makes
for better tests).
Show quoted text>
>> I have a proposed patch which makes SVN::Dump::Reader a subclass of
>> IO::File (instead of IO::Handle), then uses getpos() and setpos() to
>> rewind the filehandle if the "blank" line isn't actually blank, e.g.
>
> I want SVN::Dump to be able to read dumps from STDIN, to allow it to
> receive dumps from 'svnadmin dump'. Wouldn't its being a subclass
> of IO::File prevent this?
I'm not sure if it is possible to use IO::File to seek on a non-seekable
handle (like STDIN) outside of using IO::Block (which uses layers to
cache IO). This is the best argument for just ignoring leading blank
lines at the beginning of read_header_block, etc., rather than trying to
figure out when you can safely chop.
Show quoted text>
>> I think a much better fix would be to make read_record() leading blank
>> line agnostic (i.e. an unknown number of blank lines will be consumed at
>> the start of read_record(), rather than trying to chop trailing blank
>> lines. I can produce a patch to do this instead if you would like.
>
> When I first wrote SVN::Dump, my first test was to be able to produce
> dumps that were identical to the one I was reading (see t/25dump.t
> for example). In my opinion, being able to create the "identity"
> function would demonstrate I correctly reversed-engineered the dump
> format.
>
> Is the number of blank lines really not significant?
Not as far as I can tell (short of pulling up svndmin/load.c). It
appears that the places where your code assumes that there will be *two*
blank lines may not be required by the underlying dump format. I have
to assume that cvs2svn is going to produce 100% compatible dumpfiles
(and indeed I can load up either with or without the doubled blank lines).
John
--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5748