Author image Barrie Slaymaker

NAME

VCP::Utils::p4 - utilities for dealing with the p4 command

SYNOPSIS

   use base qw( ... VCP::Utils::p4 ) ;

DESCRIPTION

A mix-in class providing methods shared by VCP::Source::p4 and VCP::Dest::p4, mostly wrappers for calling the p4 command.

METHODS

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".

p4

Calls the p4 command with the appropriate user, client, port, and password.

parse_p4_repo_spec

Calls $self->parse_repo_spec, the post-processes the repo_user in to a user name and a client view. If the user specified no client name, then a client name of "vcp_tmp_$$" is used by default.

This also initializes the client to have a mapping to a working directory under /tmp, and arranges for the current client definition to be restored or deleted on exit.

init_p4_view
   $self->init_p4_view

Borrows or creates a client with the right view. Only called from VCP::Dest::p4, since VCP::Source::p4 uses non-view oriented commands.

p4_clients

Returns a list of known clients.

p4_get_client_spec

Returns the current client spec for the named client. The client may or may not exist first, grep the results from "p4_clients" to see if it already exists.

queue_p4_restore_client_spec
   $self->queue_p4_restore_client_spec( $client_spec ) ;

Saves a copy of the named p4 client and arranges for it's restoral on exit (assuming END blocks run). Used when altering a user-specified client that already exists.

If $client_spec is undefined, then the named client will be deleted on exit.

Note that END blocks may be skipped in certain cases, like coredumps, kill -9, or a call to POSIX::exit(). None of these should happen except in debugging, but...

p4_set_client_spec
   $self->p4_set_client_spec( $client_spec ) ;

Writes a client spec to the repository.

COPYRIGHT

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.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 28:

'=item' outside of any '=over'

Around line 277:

You forgot a '=back' before '=head1'