VCP::Dest::p4 - p4 destination driver
vcp <source> p4:user:password@p4port:<dest>
vcp <source> p4:user(client):password@p4port:<dest>
vcp <source> p4:<dest>
The <dest> spec is a perforce repository spec and must begin with // and a
depot name ("//depot"), not a local filesystem spec or a client
spec. There should be a trailing "/..." specified.
If no user name, password, or port are given, the underlying p4 command will
look at that standard environment variables.
VCP sets the environment P4PASSWD rather than giving p4 the password on the
command line so it won't be logged in debugging or error messages. The other
options are passed on the command line.
If no client name is given, a temporary client name like
"vcp_tmp_1234" will be created and used. The P4CLIENT environment
variable will not be used. If an existing client name is given, the named
client spec will be saved off, altered, used, and restored. If the client was
created for this import, it will be deleted when complete, regardless of
whether the client was specified by the user or was randomly generated.
WARNING: If perl coredumps or is killed with a signal that prevents
cleanup--like a SIGKILL (9)--the the client deletion or restoral will not
occur. The client view is not saved on disk, either, so back it up manually if
you care.
THE CLIENT SAVE/RESTORE FEATURE IS EXPERIMENTAL AND MAY CHANGE BASED ON USER
FEEDBACK.
VCP::Dest::p4 attempts change set aggregation by sorting incoming revisions. See
"rev_cmp_sub" in VCP::Dest for the order in which revisions are
sorted. Once sorted, a change is submitted whenever the change number (if
present) changes, the comment (if present) changes, or a new rev of a file
with the same name as a revision that's pending. THIS IS EXPERIMENTAL, PLEASE
DOUBLE CHECK EVERYTHING!
If the P4::Client Perl module is installed, this will be used instead of the p4
command line utility. If this causes undesirable results, set the environment
variable VCPP4API equal to "0" (zero).
- --run-p4d
- Runs a p4d instance in the directory indicated by repo_server (use a
directory path rather than a host name). If repo_server contains a port,
that port will be used, otherwise a random port will be used.
Dies unless the directory exists and contains files matching db.* (to help
prevent unexpected initializing of empty directories).
VCP will kill this p4d when it's done.
- --init-p4d
- Initializes a directory and starts a p4d in it on the given port. Refuses
to init a non-empty directory. In this case the p4port portion of the
destination specification must point to a directory; and the port, if
present, will be used for the port (otherwise a randomized port number
other than p4d's 1666 default will be used.)
A temporary p4d will be started that should be shut down upon process exit.
If the process does not exit cleanly (for instance, if sent the QUIT
signal), this shutdown may not occur.
- --delete-p4d-dir
- If "--init-p4d" is passed and the target directory is not empty,
it will be removed before running the p4d. THIS IS DANGEROUS AND SHOULD
ONLY BE USED IN TEST ENVIRONMENTS.
- --change-branch-rev-1
- Some SCMs don't create a branch of a file until there is actually a change
made to that file. So the first revision of a file on a branch is
different from its parent on the main branch. Normally, p4 does not work
this way: rev #1 of a branched file is a very inexpensive copy of the
parent revision: you do a p4 integrate, submit, edit, submit sequence to
branch a file and introduce it's changes.
This option forces VCP to do a p4 integrate, add, submit sequence to branch
files, thus capturing the branch and the file alterations in one change.
Using this option allows VCP to more exactly model the source repository in
the destination repository revision-for-revision, but leaves you with a
perforce repository that may not be consistent with your work practices,
so it is not the default behavior.
The p4 destination driver allows branching from deleted revisions of files to
accomodate source repositories that allow it. It does this by branching from
the revision prior to the deleted revision.
The p4 destination driver also allows the first revision of a file to be a
deleted revision by forcing an empty "add" followed by a
"delete". CVS does this on the main trunk (rev 1.1 is
"dead", ie deleted) when you add a file on a branch.
- repo_client
- The p4 client name. This is an accessor for a data member in each class.
The data member should be part of VCP::Utils::p4, but the fields pragma
does not support multiple inheritance, so the accessor is here but all
derived classes supporting this accessor must provide for a key named
"P4_REPO_CLIENT".
## Prevent VCP::Plugin from rmtree-ing the workspace we're borrowing ## TODO:
see if this code is still needed sub DESTROY {
my $self = shift ;
$self->work_root( undef ) ;
$self->SUPER::DESTROY ;
}
Barrie Slaymaker <barries@slaysys.com>
Copyright (c) 2000, 2001, 2002 Perforce Software, Inc. All rights reserved.
See VCP::License ("vcp help license") for the terms of use.