NAME
SVN::Dump - A Perl interface to Subversion dumps
SYNOPSIS
use SVN::Dump;
my $file = shift;
my $dump = SVN::Dump->new( { file => $file } );
# compute some stats
my %type;
while ( my $record = $dump->next_record() ) {
$type{ $record->type() }++;
}
# print the results
print "Dump $file statistics:\n",
" version: ", $dump->version(), "\n",
" uuid: ", $dump->uuid(), "\n",
" revisions: ", $type{revision}, "\n",
" nodes: ", $type{node}, "\n";
DESCRIPTION
This module is an alpha release. The interfaces will probably change in the future, as I slowly learn my way inside the SVN dump format.
An SVN::Dump
object represents a Subversion dump.
This module follow the semantics used in the reference document (the file notes/fs_dumprestore.txt in the Subversion source tree).
Each class has a as_string()
method that prints its content in the dump format.
The most basic thing you can do with SVN::Dump
is simply copy a dump:
use SVN::Dump;
my $dump = SVN::Dump->new( 'mydump.svn' );
print $dump->as_string(); # only print the dump header
while( $rev = $dump->next_record() ) {
print $rev->as_string();
}
After the operation, the resulting dump should be identical to the original dump.
METHODS
SVN::Dump
provides the following methods:
- new()
-
Return a new
SVN::Dump
object. - next_record()
-
Return the next record read from the dump.
- version()
-
Return the dump format version, if the version record has already been read.
- uuid()
-
Return the dump UUID, if there is an UUID record and it has been read.
- as_string()
-
Return a string representation of the dump specific blocks (the
format
anduuid
blocks only).
SEE ALSO
SVN::Dump::Reader
.
COPYRIGHT & LICENSE
Copyright 2006 Philippe 'BooK' Bruhat, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.