VCP::Dest - A base class for VCP destinations
This class uses the fields pragma, so you'll need to use base and possibly fields in any subclasses.
These methods are intended to support subclasses.
digest
$self->digest( "/tmp/readers" ) ;
The Base64 version is returned because that's what RevML uses and we might want to cross-check with a .revml file when debugging.
compare_base_revs
$self->compare_base_revs( $rev, $work_path ) ;
Calls $self->checkout_file( $rev ), which the subclass must implement.
header
rev_map
head_revs
main_branch_id
files
These methods are overloaded by subclasses.
backfill
$dest->backfill( $rev ) ;
The $rev->workpath must be set to the filename the backfill was put in.
This is used when doing an incremental update, where the first revision of a file in the update is encoded as a delta from the prior version. A digest of the prior version is sent along before the first version delta to verify it's presence in the database.
So, the source calls backfill(), which returns TRUE on success, FALSE if the destination doesn't support backfilling, and dies if there's an error in procuring the right revision.
If FALSE is returned, then the revisions will be sent through with no working path, but will have a delta record.
MUST BE OVERRIDDEN.
sort_filter
sub sort_filter { my $self = shift; my @sort_keys = @_; return () if @sort_keys && $sort_keys[0] eq "change_id"; require VCP::Filter::changesets; return ( VCP::Filter::changesets->new(), ); }
require_change_id_sort
sub sort_filters { shift->require_change_id_sort( @_ ) }
handle_footer
$dest->handle_footer( $footer ) ;
handle_header
$dest->handle_header( $header ) ;
rev_count
$dest->rev_count( $number_of_revs_forthcoming );
skip_rev
handle_rev
$dest->handle_rev( $rev ) ;
MUST BE OVERRIDDEN. Don't call this from the override.
last_rev_in_filebranch
my $rev_id = $dest->last_rev_in_filebranch( $source_repo_id, $source_filebranch_id );
Returns undef if not found.
Several fields are jury rigged for "base revisions": these are fake revisions used to start off incremental, non-bootstrap transfers with the MD5 digest of the version that must be the last version in the target repository. Since these are "faked", they don't contain comments or timestamps, so the comment and timestamp fields are treated as "" and 0 by the sort routines.
Copyright 2000, Perforce Software, Inc. All Rights Reserved.
This module and the VCP package are licensed according to the terms given in the file LICENSE accompanying this distribution, a copy of which is included in vcp.
Barrie Slaymaker <barries@slaysys.com>