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 ; @ISA = qw( VCP::Source ); use strict ; use Carp ; use File::Spec; use File::Temp; use VCP::Debug ":debug" ; use VCP::Source; use VCP::Utils qw( is_win32 ); #use base qw( VCP::Source ); sub new { my $self = shift->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->repo_id( "null" ); $self->parse_repo_spec( $spec ) if defined $spec; $self->parse_options( $options ); return $self ; } sub options_spec { return (); } sub handle_header { my $self = shift ; my ( $header ) = @_ ; $self->dest->handle_header( $header ); return ; } my $null_fn; sub get_source_file { my $self = shift; my ( $r ) = @_; if ( !defined $null_fn ) { ## On Win32, "NUL" is not a file like '/dev/null' is on Unix, ## so you can't link() to it. Also, we need to be on the same ## file system as the other temp files for link()'s sake. my $fh; ( $fh, $null_fn ) = File::Temp::tempfile( "vcp_empty_file_XXXX", UNLINK => 1 ); close $fh; ## close it so files link()ed to this one may be unlink()ed ## on Win32 } return $null_fn; } =head1 SEE ALSO L<VCP::Dest::null>, L<vcp>. =head1 AUTHOR Barrie Slaymaker <barries@slaysys.com> =head1 COPYRIGHT Copyright (c) 2000, 2001, 2002 Perforce Software, Inc. All rights reserved. See L<VCP::License|VCP::License> (C<vcp help license>) for the terms of use. =cut 1
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 6118 | Dimitry Andric | Integ from //public/revml to //guest/dimitry_andric/revml/main. | ||
//guest/perforce_software/revml/lib/VCP/Source/null.pm | |||||
#17 | 4479 | Barrie Slaymaker |
- Always use a tempfile() to improve link()'s chances of working by using a real file and making it more likely to be on the same filesystem. |
||
#16 | 4468 | Barrie Slaymaker | - Win32 "NUL" is not a real file, unlike /dev/null, so use a tempfile | ||
#15 | 4165 | Barrie Slaymaker |
- VCP::Source::null now returns /dev/null or NUL for files - VCP::Dest::p4 now watches is_branch_rev() to detect branches - t/99p4_label_branch_rev_1.t reproduces a bug reported by Matt Attaway < matt at perforce com > |
||
#14 | 4021 | Barrie Slaymaker |
- Remove all phashes and all base & fields pragmas - Work around SWASHGET error |
||
#13 | 4012 | Barrie Slaymaker | - Remove dependance on pseudohashes (deprecated Perl feature) | ||
#12 | 3970 | Barrie Slaymaker |
- VCP::Source handles rev queing, uses disk to reduce RAM - Lots of other fixes |
||
#11 | 3855 | Barrie Slaymaker |
- vcp scan, filter, transfer basically functional - Need more work in re: storage format, etc, but functional |
||
#10 | 3811 | Barrie Slaymaker | - fetch_*() and get_rev() renamed get_source_file() | ||
#9 | 3466 | Barrie Slaymaker |
- --output-config-file now usable with vcp:- specification - --output-config-file now tested - VCP::{Source,Dest}::null now sets a repo_scheme so they may be emitted to config files. - Dest: is now emitted right after Source: when there are filters to dump. |
||
#8 | 3460 | Barrie Slaymaker |
- Revamp Plugin/Source/Dest hierarchy to allow for reguritating options in to .vcp files |
||
#7 | 3133 | Barrie Slaymaker |
Make destinations call back to sources to check out files to simplify the architecture (is_metadata_only() no longer needed) and make it more optimizable (checkouts can be batched). |
||
#6 | 3120 | Barrie Slaymaker | Move changeset aggregation in to its own filter. | ||
#5 | 3014 | Barrie Slaymaker | minor warnings cleanups | ||
#4 | 2837 | John Fetkovich |
Use parse_options rather than using Getopt::Long directly. |
||
#3 | 2802 | John Fetkovich |
Added a source_repo_id to each revision, and repo_id to each Source and Dest. The repo_ids include repository type (cvs,p4,revml,vss,...) and the repo_server fields. Changed the $self->...->set() and $self->...->get() lines in VCP::Dest::* to pass in a conglomerated key value, by passing in the key as an ARRAY ref. Also various restructuring in VCP::DB.pm, VCP::DB_file.pm and VCP::DB_file::sdbm.pm related to this change. |
||
#2 | 2322 | Barrie Slaymaker | Fix jack-in-the-bug options parsing exposed by .vcp files | ||
#1 | 2282 | Barrie Slaymaker | Add in support for *.vcp files |