<html><head><title>VCP::Process - How vcp works</title></head><body><h1><a name="NAME">NAME
</a></h1><p>VCP::Process - How vcp works
<p><hr><h1><a name="DESCRIPTION">DESCRIPTION
</a></h1><p><a href="../vcp.html">vcp</a> is designed to be a general purpose repository
import/export tool. This document describes some of the techniques used
to keep <code>vcp</code> general purpose.
<h2><a name="Phases_of_Operation">Phases of Operation
</a></h2><p><code>vcp</code> works in several phases:
<dl><dt><a name="1_Metadata_Scanning_"><strong><p>1. Metadata Scanning
</strong></a><dd>Before anything else can happen, <code>vcp</code> must take the source repository
spec, something like <code>cvs:module/dir/...</code> and use the appropriate
repository interface (<code>cvs log</code> in this case) to extract the metadata.
<p>The metadata is currently kept all in memory; if you run in to a
repository so big that this is troublesome, do the transfer in phases or
pester us to provide a swap file capability for this data.
<p>In the case of a RevML source, it is not practical to scan the input for
metadata alone (the RevML may be coming from the standard input, for
instance), so all of the files in a RevML source file are extracted
during the scanning phase, as mentioned in <a href="Source/revml.html">VCP::Source::revml</a>.
<dl><dt><a name="1a_Base_revisions_and_backfilling_"><strong><p>1a. Base revisions and backfilling
</strong></a><dd>When sourcing from incremental RevML transfers, an additional step must
be taken for each text file in the transfer. An incremental RevML file
does not usually contain the entire body of any revision of a text file;
it only contains deltas between revisions. This is not so for binary
files, which are currently always shipped in their entirety, or for when
the --bootstrap option has been provided during the extraction.
<p><code>vcp</code> therefore needs to be able to recreate the first revision of a
text file in an incremental transfer when RevML is in use. This is
addressed by a process called "backfilling the base revision".
<p>The "base" revision of a file is the revision that immediately precedes
the first revision being transfered. It is also the last revision in
the previous transfer and must be the most recent revision (on the
appropriate branch) in the destination repository.
<p><code>vcp</code> "backfills" the base revision by checking it out of the
destination repository, then reconstitutes the first revision by
applying the (base revision => first revision) delta to the base
revision. Each revision in a RevML file contains an <a>MD5</a>
checksum to make sure that all backfilling and patching is implemented
accurately.
<dt><a name="1b_Selecting_"><strong><p>1b. Selecting
</strong></a><dd>In the case of <a href="Source/cvs.html">VCP::Source::cvs</a>, the initial scan
often nets too much data, so the data scanned is winnowed down to the
desired set (see <a href="Source/cvs.html#Files_that_aren_t_tagged">VCP::Source::cvs/Files that aren't tagged</a> for
details).
</dl><dt><a name="2_Sorting_and_Change_Aggregation_"><strong><p>2. Sorting and Change Aggregation
</strong></a><dd>The order that the soruce repository presents revisions in is often not
the order they need to be inserted in, so the destination driver
(<a href="Dest/p4.html">VCP::Dest::p4</a>, for example) is given the opportunity to sort the
revisions.
<p>This is primarily used to do change number aggregation when converting from a
repository that does not provide change set metadata (like CVS) to one that
does (like p4).
<p>This is also important when generating RevML files because the order of
appearance of files in a log file may hinge on exactly when the files
were inserted along with their names, at least in the case of CVS.
Sorting the revisions provides for consistent RevML files, which is
important in testing situations.
<dt><a name="3_File_transfer_"><strong><p>3. File transfer.
</strong></a><dd>The final stage is to do the file transfer. When the entire source file
is available, it is simply added to the result repository in the correct
order.
<p>For incremental transfers an extra step is taken to ensure that
incremental transfers leave no gaps. The base revision is backfilled
from the destination repository (using the process for backfilling
described in phase 1 above) and compared to the base revision from the
source repository.
</dl><p><hr><h1><a name="Command_Line_Tools">Command Line Tools
</a></h1><p>Currently, <code>vcp</code> shells out to command line tools like <code>cvs</code> and
<code>p4</code>. This is a "least common denominator" approach that allows VCP to
operate at a safe distance from the underlying implementations. It is
also the primary bottleneck in transferring files. We will gladly
accept donations of drivers that use direct library interfaces or remote
procedure call (SOAP, RMI, etc., etc.) techniques to speed this process
up.
<p><hr><h1><a name="AUTHOR">AUTHOR
</a></h1><p>Barrie Slaymaker <barries@slaysys.com>
<p><hr><h1><a name="COPYRIGHT">COPYRIGHT
</a></h1><p>Copyright (c) 2000, 2001, 2002 Perforce Software, Inc.
All rights reserved.
<p>See <a href="License.html">VCP::License</a> (<code>vcp help license</code>) for the terms of use.
<p><hr><i><font size="-1">Last updated: Fri Nov 8 13:07:23 2002</font></i></body></html>