Calls the p4 command with the appropriate user, client, port, and password.
|p4_x||Run p4 -x, feeding args to STDIN.|
my %form = $self->parse_p4_form( $form ); my %form = $self->parse_p4_form( \@command_to_emit_form );
Parses a p4 form and returns a list containing the forms data elements in the order that they were accumulated. This is suitable for initializing a hash if orders not important, or an array if it is.
You can pass the form in verbatim, or a reference to a command to run to get the form. If the first parameter is an ARRAY reference, all parameters will be passed to $self-p4> with stdout redirected to a temporary variable.
NOTE: This does not implement 100% compatible p4 forms parsing; it should be upwards compatible and one day we should implement full forms parsing.
my $form = $self->build_p4_form( @form_fields ); my $form = $self->build_p4_form( %form_fields ); $self->build_p4_form( ..., \@command_to_emit_form );
Builds a p4 form and either returns it or submits it to the indicated command.
Calls $self->parse_repo_spec, then 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.
|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.|
|p4_get_settings||gets all p4 variables/config info available from the p4 set command, and puts them into a hash and returns a reference to it. These are the settings which were set via a p4 config file or environment variables (*nix), or the registry (windows).|
$self->queue_p4_restore_client_spec( $client_spec ) ;
Saves a copy of the named p4 client and arranges for its 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...
$self->p4_set_client_spec( $client_spec ) ;
Writes a client spec to the repository.
Splits the repo_server field in to $host and $port sections, where
$host may be a directory name (when --run-p4d or --init-p4d in effect).
This is a separate method in order to encapsulate splitting of paths with a volumn name on Win32 (can extend to other OSs as needed).
Runs a p4d instance in the directory indicated by repo_server (use a directory
path in place of a host name). If repo_server contains a port, that port
will be used, otherwise a random port will be used (and placed back in to
repo_server so the p4 client can find it).
Dies unless the directory exists and contains files matching db.* (to help prevent unexpected initting of empty directories).
VCP can use its own p4d, this sub is used to launch it and queue its
demise when the program exits.
The $p4root argument is required. The $p4port is optional; if undefined, a random p4 port is chosen (if the random port is already in use, successive random ports will be chosen up to 10 times until an unused port is found)
The return value is the p4 port.
|kill_all_vcp_p4ds||Kills all p4ds that have been started by this VCP process.|
Converts special characters (#, @, whitespace and non-printing character
codes) in branch, label, and client names in to other symbols.
NOTE: I have not been able to find a description of the set of legal p4 names (namelength, character set, etc). This is purely a first attempt, if you have details on this, please let me know.
Copyright 2000, Perforce Software, Inc. All Rights Reserved.
|perl v5.20.3||VCP::UTILS::P4 (3)||2004-11-04|