SVN::Dumpfile - Perl extension to access and manipulate Subversion dumpfiles
use SVN::Dumpfile; # Opens existing dumpfile: my $olddf = SVN::Dumpfile->new(file => "old.dump"); # Creates new dumpfile with same version and UUID as old one: my $newdf = $olddf->copy->create(file => "new.dump"); # Read old dumpfile node by node while ( my $node = $olddf->read_node ) { # Manipulate current node: $node->header("some header","new value"); $node->property("some property","new value"); $node->changed; # Write to new dumpfile $newdf->write_node($node); }
SVN::Dumpfile represents a Subversion (http://subversion.tigris.org/) dumpfile. It provides methods to read existing and write modified or new dumpfiles. It supports dumpfiles with the version number 1 - 3 but was written in a tolerant way to also support newer versions as long no major changes are made.
This module is a OO redesign and generalisation of SVN::Dumpfilter v0.21. Newer versions of SVN::Dumpfilter are using it to access the input and output dumpfiles.
The ability to create new dumpfiles sets it apart from the similar module SVN::Dump. The submodule SVN::Dumpfile::Node::Properties also allows the processing of Subversion revision property files (i.e. the files lying in the $REPOSITORY/db/revprops/ directory holding the author, date and log entry of every revision).
Nothing, because it's an Object Oriented module.
Authors Module Website: http://www.scharrer-online.de/svn/
Other man pages of sub-classes:
Martin Scharrer, <martin@scharrer-online.de>; http://www.scharrer-online.de/
Copyright (C) 2006-2008 by Martin Scharrer
This library is free software; you can redistribute it and/or modify it under the GPL v3 or the same terms as Subversion or Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
Constructor. Returns a new SVN::Dumpfile object. Attributes can be given as hash reference or as even array with key/value pairs. If only one argument is given it will be taken as dumpfile name. The following attributes can be used:
The file name of the dumpfile.
The version number of the dumpfile.
The UUID of the dumpfile.
Please note that if the represented dumpfile is given by name it is not opened yet. open() has to be called first.
Returns or sets the UUID of the dumpfile. A lvalue of the internal UUID is returned, so the new UUID can be given as the first argument or assigned directly to the function:
$df->uuid # Returns uuid $df->uuid($newuuid) # Set new uuid $df->uuid = $newuuid # Set new uuid
Returns or sets the version of the dumpfile. A lvalue of the internal version is returned, so the new version can be given as the first argument or assigned directly to the function:
$df->version # Returns version $df->version($newuuid) # Sets new version $df->version = $newuuid # Sets new version
Opens a existing dumpfile. The file name can be given as argument or is taken from the instance. Will reopen the file if called a second time. Can be called as class or instance method. Returns a reference on the new or calling object or undef on failure.
Creates a new SVN::Dumpfile instance with the same version and UUID as the instance it was called upon. No other informations are copied.
Creates and opens a new dumpfile on the harddisk. Can be called as class or instance method. The file name can be given as an argument or is taken from the instance. Returns a reference on the new or calling object or undef on failure.
Returns the dumpfile header lines as string. These are the first lines of the dumpfile and do not hold any node information, i.e. this doesn't return the whole dumpfile. At the moment the only header lines are the dumpfile version and, starting from version 2, the UUID. This method is called by create() to write out the dumpfile head.
Returns the next node of the dumpfile as SVN::Dumpfile::Node instance. Alternative names are get_node or next_node.
get_node
next_node
Awaits a SVN::Dumpfile::Node instance and writes this to the dumpfile.
Closes the dumpfile. This will be called automatically when the dumpfile reference is going out of scope.
Returns true if given version number is supported by SVN::Dumpfile. Can be called as class or instance method. If called on an instance and the version number is not given as an argument the internal version is taken.
Dumps the object to STDERR using Data::Dumper for debugging.
To install SVN::Dumpfile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SVN::Dumpfile
CPAN shell
perl -MCPAN -e shell install SVN::Dumpfile
For more information on module installation, please visit the detailed CPAN module installation guide.