|
NAMESVN::Dump - A Perl interface to Subversion dumpsVERSIONversion 0.08SYNOPSIS#!/usr/bin/perl use strict; use warnings; use SVN::Dump; my $file = shift; my $dump = SVN::Dump->new( { file => $file } ); # compute some stats my %type; my %kind; while ( my $record = $dump->next_record() ) { $type{ $record->type() }++; $kind{ $record->get_header('Node-action') }++ if $record->type() eq 'node'; } # print the results print "Statistics for dump $file:\n", " version: ", $dump->version(), "\n", " uuid: ", $dump->uuid(), "\n", " revisions: ", $type{revision}, "\n", " nodes: ", $type{node}, "\n"; print map { sprintf " - %-7s: %d\n", $_, $kind{$_} } sort keys %kind; DESCRIPTIONAn 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( { file => 'mydump.svn' } ); $dump->next_record; # read the format header $dump->next_record; # read the uuid header print $dump->as_string(); # only print the dump header while( $rec = $dump->next_record() ) { print $rec->as_string(); } After the operation, the resulting dump should be identical to the original dump. METHODSSVN::Dump provides the following methods:
SEE ALSOSVN::Dump::Reader, SVN::Dump::Record.The reference document for Subversion dumpfiles is at: <http://svn.apache.org/repos/asf/subversion/trunk/notes/dump-load-format.txt> COPYRIGHTCopyright 2006-2020 Philippe Bruhat (BooK), All Rights Reserved.LICENSEThis program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Visit the GSP FreeBSD Man Page Interface. |