package VCP::Dest::metadb ; =head1 NAME VCP::Dest::metadb - Store all metadata in to a serial store =head1 SYNOPSIS metadb:[] =head1 DESCRIPTION =head1 EXTERNAL METHODS =over =cut use strict ; use VCP::Logger qw( pr_doing ); use VCP::Utils qw( empty ); use vars qw( $VERSION ) ; $VERSION = 0.1 ; use base qw( VCP::Dest VCP::Utils::metadb ); use fields ( 'META_DB', ## The bulk data file with the revisions ) ; =item new Creates a new instance. The only parameter is '-dtd', which overrides the default DTD found by searching for modules matching RevML::DTD:v*.pm. Attempts to create the output file if one is specified. =cut sub new { my $class = shift ; $class = ref $class || $class ; my VCP::Dest::metadb $self = $class->SUPER::new( @_ ) ; my ( $spec, $options ) = @_ ; $self->parse_repo_spec( $spec ) unless empty $spec; $self->parse_options( $options ); return $self; } sub init { my VCP::Dest::metadb $self = shift ; $self->SUPER::init; die "VCP::Dest::metadb::repo_server not set" if empty $self->repo_server; $self->repo_id( "metadb:" . $self->repo_server ); $self->head_revs->delete_db; $self->meta_db ->delete_db; $self->head_revs->open_db; $self->meta_db ->open_db; return $self ; } sub handle_header { my VCP::Dest::metadb $self = shift ; my ( $h ) = @_ ; $self->write_header( $h ); } sub handle_rev { my VCP::Dest::metadb $self = shift ; my VCP::Rev $r ; ( $r ) = @_ ; $self->meta_db->set( [ $r->id ], $r->serialize ); pr_doing; $self->head_revs->set( [ $r->source_repo_id, $r->source_filebranch_id ], $r->source_rev_id ); } sub handle_footer { my VCP::Dest::metadb $self = shift ; my ( $footer ) = @_ ; $self->SUPER::handle_footer; return ; } =back =head1 AUTHOR Barrie Slaymaker =head1 COPYRIGHT Copyright (c) 2000, 2001, 2002 Perforce Software, Inc. All rights reserved. See L (C) for the terms of use. =cut 1