<html><head><title>VCP::Dest - A base class for VCP destinations</title></head><body><h1><a name="NAME">NAME
</a></h1><p>VCP::Dest - A base class for VCP destinations
<p><hr><h1><a name="SYNOPSIS">SYNOPSIS
</a></h1><p><hr><h1><a name="DESCRIPTION">DESCRIPTION
</a></h1><p><hr><h1><a name="SUBCLASSING">SUBCLASSING
</a></h1><p>This class uses the fields pragma, so you'll need to use base and
possibly fields in any subclasses.
<h2><a name="SUBCLASS_API">SUBCLASS API
</a></h2><p>These methods are intended to support subclasses.
<dl><pre>
</pre><dt><a name="digest_"><strong><p>digest
</strong></a><pre> $self->digest( "/tmp/readers" ) ;
</pre><dd>Returns the Base64 MD5 digest of the named file. Used to compare a base
rev (which is the revision *before* the first one we want to transfer) of
a file from the source repo to the existing head rev of a dest repo.
<p>The Base64 version is returned because that's what RevML uses and we might
want to cross-check with a .revml file when debugging.
<dt><a name="compare_base_revs_"><strong><p>compare_base_revs
</strong></a><pre> $self->compare_base_revs( $rev, $work_path ) ;
</pre><dd>Checks out the indicated revision from the destination repository and
compares it (using digest()) to the file from the source repository
(as indicated by $work_path). Dies with an error message if the
base revisions do not match.
<p>Calls $self->checkout_file( $rev ), which the subclass must implement.
<dt><a name="header_"><strong><p>header
</strong></a><dd>Gets/sets the $header data structure passed to handle_header().
<dt><a name="rev_map_"><strong><p>rev_map
</strong></a><dd>Returns a reference to the RevMapDB for this backend and repository.
Creates an empty one if need be.
<dt><a name="head_revs_"><strong><p>head_revs
</strong></a><dd>Returns a reference to the HeadRevsDB for this backend and repository.
Creates an empty one if need be.
<dt><a name="main_branch_id_"><strong><p>main_branch_id
</strong></a><dd>Returns a reference to the MainBranchIdDB for this backend and repository.
Creates an empty one if need be.
<dt><a name="files_"><strong><p>files
</strong></a><dd>Returns a reference to the FilesDB for this backend and repository.
Creates an empty one if need be.
</dl><h2><a name="SUBCLASS_OVERLOADS">SUBCLASS OVERLOADS
</a></h2><p>These methods are overloaded by subclasses.
<dl><dt><a name="backfill_"><strong><p>backfill
</strong></a><pre> $dest->backfill( $rev ) ;
</pre><dd>Checks the file indicated by VCP::Rev $rev out of the target repository
if this destination supports backfilling. Currently, only the revml and
the reporting & debugging destinations do not support backfilling.
<p>The $rev->workpath must be set to the filename the backfill was put
in.
<p>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.
<p>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.
<p>If FALSE is returned, then the revisions will be sent through with no
working path, but will have a delta record.
<p>MUST BE OVERRIDDEN.
<dt><a name="sort_filter_"><strong><p>sort_filter
</strong></a><pre> 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(), );
}
</pre><dd>This is passed a sort specification string and returns any filters
needed to presort data for this destination. It may return the
empty list (the default), or one or more instantiated filters.
<dt><a name="require_change_id_sort_"><strong><p>require_change_id_sort
</strong></a><dd>Destinations that care about the sort order usually want to use the
changesets filter, so they can overload the sort filter like so:
<pre> sub sort_filters { shift->require_change_id_sort( @_ ) }
</pre><dt><a name="handle_footer_"><strong><p>handle_footer
</strong></a><pre> $dest->handle_footer( $footer ) ;
</pre><dd>Does any cleanup necessary. Not required. Don't call this from the override.
<dt><a name="handle_header_"><strong><p>handle_header
</strong></a><pre> $dest->handle_header( $header ) ;
</pre><dd>Stows $header in $self->header. This should only rarely be overridden,
since the first call to handle_rev() should output any header info.
<dt><a name="rev_count_"><strong><p>rev_count
</strong></a><pre> $dest->rev_count( $number_of_revs_forthcoming );
</pre><dd>Sent by the last aggregating plugin in the filter chain just before
the first revision is sent to inform us of the number of revs to expect.
<dt><a name="skip_rev_"><strong><p>skip_rev
</strong></a><dd>Sent by filters that discard revisions in line.
<dt><a name="handle_rev_"><strong><p>handle_rev
</strong></a><pre> $dest->handle_rev( $rev ) ;
</pre><dd>Outputs the item referred to by VCP::Rev $rev. If this is the first call,
then $self->none_seen will be TRUE and any preamble should be emitted.
<p>MUST BE OVERRIDDEN. Don't call this from the override.
<dt><a name="last_rev_in_filebranch_"><strong><p>last_rev_in_filebranch
</strong></a><pre> my $rev_id = $dest->last_rev_in_filebranch(
$source_repo_id,
$source_filebranch_id
);
</pre><dd>Returns the last revision for the file and branch indicated by
$source_filebranch_id. This is used to support --continue.
<p>Returns undef if not found.
</dl><pre>
</pre><p><hr><h1><a name="NOTES">NOTES
</a></h1><p>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.
<p><hr><h1><a name="COPYRIGHT">COPYRIGHT
</a></h1><p>Copyright 2000, Perforce Software, Inc. All Rights Reserved.
<p>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
<a href="vcp.html">vcp</a>.
<p><hr><h1><a name="AUTHOR">AUTHOR
</a></h1><p>Barrie Slaymaker <barries@slaysys.com>
<p><hr><i><font size="-1">Last updated: Thu Jul 15 01:02:39 2004</font></i></body></html>