[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: Benjamin Smith-Mannschott <bsmith.occs_at_gmail.com>
Date: Mon, 10 Mar 2008 22:48:25 +0100

On Mar 10, 2008, at 21:09, 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. :(

I didn't find the number of blank lines to be entirely random when I
wrote my streaming parser for svn's dumpfile format. I worked around
the problem though by simply passing non-optional blank lines through
the pipeline as explicit parse events.

You might take a look at:

http://pypi.python.org/pypi/revisionist/1.0.0

While it doesn't include a formal EBNF of the dumpfile format, the
same is derivable from the implementation:

(1) The parser is simple recursive decent. One method per grammar
production.
(2) The syntax describing all possible sequences of parse events is
specified in an EBNF-like form, thus describing the abstract structure
of the dumpfile.
(3) The generated parse events all represented by objects whose
__str__() methods format them for output to a dump file, so you can
see the concrete syntax parsed here by example if the parse procedures
leave you scratching your head.

// ben smith-mannschott

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-03-10 22:48:46 CET

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

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