SVN::Dump(3pm)
β¨ SVN::Dump β a Perl interface to Subversion dumps β¨
okay bestie, welcome to the SVN::Dump(3pm) page π this is the User Contributed Perl Documentation section, and we're about to make Subversion dump files make sense. no cap.
Version: 0.08 β yes she's been around a while and she's still slaying π«Ά
π SYNOPSIS π
#!/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;
like literally look at her go π counting revisions and nodes and printing a whole little report. iconic behaviour.
π¦ DESCRIPTION π¦
An SVN::Dump object represents a Subversion dump. that's the whole vibe. one object, one dump. π
This module follows the semantics used in the reference document β that's the file notes/fs_dumprestore.txt in the Subversion source tree. iykyk.
Here's the mental model, bestie, memorise it:
- A dump is a collection of records (which are
SVN::Dump::Recordobjects). - A record is made of a set of headers (an
SVN::Dump::Headersobject), a set of properties (anSVN::Dump::Propertyobject), and an optional block of text (anSVN::Dump::Textobject). - Some special records β the "delete" records that have a
Node-kindheader β recursively contain included records. yes, records inside records. nested. main character energy πͺ
Every one of these classes has an as_string() method that prints its content in the dump format. super handy.
The most basic thing you can do with SVN::Dump is simply copy a dump. it's giving "copy-paste but make it architecture":
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. take that to the bank, fr fr π
π METHODS π
SVN::Dump provides the following methods. let's go through them one by one, no skipping, periodt.
new( \%args )β Return a newSVN::Dumpobject. The argument list is a hash reference. If theSVN::Dumpobject is going to read information from a file, you use thefileargument (and like always,-meansSTDIN); if the dump is read from a filehandle, you usefhinstead. Any extra options get passed along to theSVN::Dump::Readerobject that gets created. And if yourSVN::Dumpisn't being used to read information, you can use theversionanduuidparameters to initialise the values of theSVN-fs-dump-format-versionandUUIDheaders. versatile queen β¨next_record()β Return the next record read from the dump. That's aSVN::Dump::Recordobject. one at a time, bestie, we're pacing ourselves π¦version()format()β Return the dump format version, if the version record has already been read, or if it was given in the constructor. two names, same energy πuuid()β Return the dump UUID, if there is a UUID record and it has been read, or if it was given in the constructor. she's only speaking up if she actually knows it π₯as_string()β Return a string representation of the dump's specific blocks β and that's theformatanduuidblocks only. don't come for more, that's not what she does π
πΈ SEE ALSO πΈ
SVN::Dump::ReaderSVN::Dump::Record
The reference document for Subversion dumpfiles lives at: http://svn.apache.org/repos/asf/subversion/trunk/notes/dump-load-format.txt
go read it, it's the source of truth, no cap π
π COPYRIGHT π
Copyright 2006-2020 Philippe Bruhat (BooK), All Rights Reserved.
π LICENSE π
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
ok that's the whole page bestie, you ate π go copy some dumps π
and a lil sign-off: this was SVN::Dump(3pm) from the User Contributed Perl Documentation, generated by perl v5.36.0 on 2022-10-14. mwah π π¦
π¦ where this page comes from
- ubuntu noble: libsvn-dump-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libsvn-dump-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libsvn-dump-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms