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

Re: dumpfile grammar

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Mon, 10 Mar 2008 16:16:30 -0400

John Peacock wrote:
> Martin Furter wrote:
>> There are also a few other scripts on the net which parse and create
>> subversion dumpfiles.
>
> Yeah, like
>
> http://search.cpan.org/search?query=SVN::Dump
>
> though you should check the RT queue and potentially apply one or more
> of the patches there:
>
> http://rt.cpan.org/Public/Bug/Display.html?id=26386
> http://rt.cpan.org/Public/Bug/Display.html?id=25467
>
> I have a mostly rewritten version to deal with the fact that `svnadmin
> dump` appends an apparently random number of blank lines between certain
> elements (sometimes two and sometimes three). This means that you can
> miss out on a delete+add (i.e. rename) for certain files. :(

A decent dumpstream parser shouldn't be caring much about the number of
blank lines, save for knowing that a single blank line is used to terminate
a header block. The dumpstream is defined to have two record types
(revisions and nodes), each of which is identifiable by a particular header
in the corresponding header block ("Revision-number" or "Node-path"). And
header blocks are required to contain Content-length headers which indicate
to parsers how many bytes of data related to that record immediately follow
that header-block-ending single blank line.

-- 
C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on 2008-03-10 21:16:44 CET

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