package VCP::Source::null ; =head1 NAME VCP::Source::null - A null source, for testing purposes =head1 SYNOPSIS vcp null: =head1 DESCRIPTION Takes no options, delivers no data. =cut $VERSION = 1.0 ; use strict ; use Carp ; use Getopt::Long ; use VCP::Debug ":debug" ; use base qw( VCP::Source ); sub new { my $class = shift ; $class = ref $class || $class ; my VCP::Source::null $self = $class->SUPER::new( @_ ) ; ## Parse the options my ( $spec, $options ) = @_ ; die "vcp: the null source takes no spec ('$1')\n" if $spec =~ m{\Anull:(.+)}; $self->repo_id( "null:" . $self->repo_server ); local *ARGV = $options; GetOptions( 'TAKESNOOPTIONS' => \undef, ) or $self->usage_and_exit ; return $self ; } sub handle_header { my VCP::Source::null $self = shift ; my ( $header ) = @_ ; $self->dest->handle_header( $header ) ; return ; } sub copy_revs { my VCP::Source::null $self = shift ; $self->dest->sort_revs( $self->revs ) ; ## Discard the revs so they'll be DESTROYed and thus ## clean up after themselves. my $metadata_only = $self->dest->metadata_only; while ( my VCP::Rev $r = $self->revs->shift ) { $self->get_rev( $r ) unless $metadata_only; $self->dest->handle_rev( $r ) ; } } =head1 SEE ALSO L, L. =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