package VCP::Dest::null; =head1 NAME VCP::Dest::null - null destination driver =head1 SYNOPSIS vcp null: vcp null: =head1 DESCRIPTION Behaves like a normal destination but generates no output. =cut $VERSION = 1 ; use strict ; use Carp ; use File::Basename ; use File::Path ; use VCP::Debug ':debug' ; use VCP::Logger qw( pr_doing pr_done ); use VCP::Rev ; use base qw( VCP::Dest ); use fields ( 'NULL_GET_REVS', ## 0 => don't actually fetch the revs, otherwise do. ); sub new { my $class = shift ; $class = ref $class || $class ; my $self = $class->SUPER::new( @_ ) ; ## Parse the options my ( $spec, $options ) = @_ ; die "vcp: the null source takes no spec ('$1')\n" if defined $spec && $spec =~ m{\Anull:(.+)}i; $self->parse_repo_spec( $spec ) if defined $spec; $self->parse_options( $options ); return $self; } sub options_spec { return (); } sub handle_rev { my VCP::Dest::null $self = shift; my ( $r ) = @_; $r = VCP::Revs->get_source_file if ( ! defined $self->{NULL_GET_REVS} || $self->{NULL_GET_REVS} ) && ( $r->is_base_rev || ( ! $r->is_placeholder_rev && $r->action ne "delete" ) ); pr_doing; $r->previous( undef ); ## frees up any previous revs that are no longer needed. $r->set_work_path( undef ); ## makes sure that, even if no revs are freed (because some other ## plugin has references to them), the disk files are freed. } sub handle_footer { pr_done; } =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