package VCP::UIMachines; =begin hackers DO NOT EDIT!!! GENERATED FROM ui_machines/vcp_ui.tt2 by /usr/local/bin/stml AT Wed May 21 22:15:04 2003 =end hackers =head1 NAME VCP::UIMachines - State machines for user interface =head1 SYNOPSIS Called by VCP::UI =head1 DESCRIPTION The user interface module L is a framework that bolts the implementation of the user interface to a state machine representing the user interface. Each state in this state machine is a method. =head1 METHOD =over =cut use strict; =item init Initialize the machine Next state: source_prompt =cut sub init { return 'source_prompt'; } =item source_prompt: Source SCM type Enter the kind of repository to copy data from. Valid answers: p4 => source_p4_run_p4d_prompt =cut sub source_prompt { my ( $ui ) = @_; ## Use single-quotish HERE docs as the most robust form of quoting ## so we don't have to mess with escaping. my $prompt = <<'END_PROMPT'; Source SCM type END_PROMPT chomp $prompt; my @valid_anwsers = ( [ 'p4', 'p4', 'source_p4_run_p4d_prompt' ], ); my $answer = $ui->ask( <<'END_DESCRIPTION', $prompt, \@valid_anwsers ); Enter the kind of repository to copy data from. END_DESCRIPTION return $answer->[-1]; } =item dest_prompt: Destination SCM type Enter the kind of repository to copy data to. Valid answers: => run =cut sub dest_prompt { my ( $ui ) = @_; ## Use single-quotish HERE docs as the most robust form of quoting ## so we don't have to mess with escaping. my $prompt = <<'END_PROMPT'; Destination SCM type END_PROMPT chomp $prompt; my @valid_anwsers = ( [ '', '', 'run' ], ); my $answer = $ui->ask( <<'END_DESCRIPTION', $prompt, \@valid_anwsers ); Enter the kind of repository to copy data to. END_DESCRIPTION return $answer->[-1]; } =item run Run VCP with the options entered =cut sub run { return undef; } =item source_p4_run_p4d_prompt: Launch a private p4d in a local directory If you are working with an offline repository in a local directory, vcp can launch a p4d in that directory on a random hi-numbered TCP port for you. Valid answers: No => source_p4_host_prompt yes => source_p4_p4d_dir_prompt =cut sub source_p4_run_p4d_prompt { my ( $ui ) = @_; ## Use single-quotish HERE docs as the most robust form of quoting ## so we don't have to mess with escaping. my $prompt = <<'END_PROMPT'; Launch a private p4d in a local directory END_PROMPT chomp $prompt; my @valid_anwsers = ( [ 'No', 'No', 'source_p4_host_prompt' ], [ 'yes', 'yes', 'source_p4_p4d_dir_prompt' ], ); my $answer = $ui->ask( <<'END_DESCRIPTION', $prompt, \@valid_anwsers ); If you are working with an offline repository in a local directory, vcp can launch a p4d in that directory on a random hi-numbered TCP port for you. END_DESCRIPTION return $answer->[-1]; } =item source_p4_p4d_dir_prompt: Directory to run p4d in Enter the directory to launch the p4d in. VCP will test to see if this is a valid directory when you hit Enter. Valid answers: => dest_prompt =cut sub source_p4_p4d_dir_prompt { my ( $ui ) = @_; ## Use single-quotish HERE docs as the most robust form of quoting ## so we don't have to mess with escaping. my $prompt = <<'END_PROMPT'; Directory to run p4d in END_PROMPT chomp $prompt; my @valid_anwsers = ( [ '', '', 'dest_prompt' ], ); my $answer = $ui->ask( <<'END_DESCRIPTION', $prompt, \@valid_anwsers ); Enter the directory to launch the p4d in. VCP will test to see if this is a valid directory when you hit Enter. END_DESCRIPTION return $answer->[-1]; } =item source_p4_host_prompt: P4 Host name, including port Enter the name and port of the p4d to read from, separated by a colon. Leave empty to use the p4's default of the P4HOST environment variable if set or "perforce:1666" if not. Valid answers: => source_p4_user_prompt =cut sub source_p4_host_prompt { my ( $ui ) = @_; ## Use single-quotish HERE docs as the most robust form of quoting ## so we don't have to mess with escaping. my $prompt = <<'END_PROMPT'; P4 Host name, including port END_PROMPT chomp $prompt; my @valid_anwsers = ( [ '', '', 'source_p4_user_prompt' ], ); my $answer = $ui->ask( <<'END_DESCRIPTION', $prompt, \@valid_anwsers ); Enter the name and port of the p4d to read from, separated by a colon. Leave empty to use the p4's default of the P4HOST environment variable if set or "perforce:1666" if not. END_DESCRIPTION return $answer->[-1]; } =item source_p4_user_prompt: P4 user id Enter the user_id (P4USER) value needed to access the server. Leave empty to use p4's default P4USER logic. Valid answers: => source_p4_password_prompt =cut sub source_p4_user_prompt { my ( $ui ) = @_; ## Use single-quotish HERE docs as the most robust form of quoting ## so we don't have to mess with escaping. my $prompt = <<'END_PROMPT'; P4 user id END_PROMPT chomp $prompt; my @valid_anwsers = ( [ '', '', 'source_p4_password_prompt' ], ); my $answer = $ui->ask( <<'END_DESCRIPTION', $prompt, \@valid_anwsers ); Enter the user_id (P4USER) value needed to access the server. Leave empty to use p4's default P4USER logic. END_DESCRIPTION return $answer->[-1]; } =item source_p4_password_prompt: Password If a password (P4PASSWD) needed to access the server, enter it here. WARNING: password will be echoed in plain text to the terminal. Valid answers: => source_p4_filespec_prompt =cut sub source_p4_password_prompt { my ( $ui ) = @_; ## Use single-quotish HERE docs as the most robust form of quoting ## so we don't have to mess with escaping. my $prompt = <<'END_PROMPT'; Password END_PROMPT chomp $prompt; my @valid_anwsers = ( [ '', '', 'source_p4_filespec_prompt' ], ); my $answer = $ui->ask( <<'END_DESCRIPTION', $prompt, \@valid_anwsers ); If a password (P4PASSWD) needed to access the server, enter it here. WARNING: password will be echoed in plain text to the terminal. END_DESCRIPTION return $answer->[-1]; } =item source_p4_filespec_prompt: Files to copy If you want to copy a portion of the source repository, enter a p4 filespec starting with the depot name. Do not enter any revision or change number information. Valid answers: //... => source_p4_follow_branch_into_prompt =cut sub source_p4_filespec_prompt { my ( $ui ) = @_; ## Use single-quotish HERE docs as the most robust form of quoting ## so we don't have to mess with escaping. my $prompt = <<'END_PROMPT'; Files to copy END_PROMPT chomp $prompt; my @valid_anwsers = ( [ '//...', '//...', 'source_p4_follow_branch_into_prompt' ], ); my $answer = $ui->ask( <<'END_DESCRIPTION', $prompt, \@valid_anwsers ); If you want to copy a portion of the source repository, enter a p4 filespec starting with the depot name. Do not enter any revision or change number information. END_DESCRIPTION return $answer->[-1]; } =item source_p4_follow_branch_into_prompt: Follow 'branch into' flag Causes VCP to notice "branch into" messages in the output of p4's filelog command and. If the file that's the target of the p4 integrate (branch) command is revision number #1, adds the target to the list of exported files. This usually needs a --rev-root option to set the rev root to be high enough in the directory tree to include all branches (it's an error to export a file that is not under the rev root). Valid answers: => dest_prompt =cut sub source_p4_follow_branch_into_prompt { my ( $ui ) = @_; ## Use single-quotish HERE docs as the most robust form of quoting ## so we don't have to mess with escaping. my $prompt = <<'END_PROMPT'; Follow 'branch into' flag END_PROMPT chomp $prompt; my @valid_anwsers = ( [ '', '', 'dest_prompt' ], ); my $answer = $ui->ask( <<'END_DESCRIPTION', $prompt, \@valid_anwsers ); Causes VCP to notice "branch into" messages in the output of p4's filelog command and. If the file that's the target of the p4 integrate (branch) command is revision number #1, adds the target to the list of exported files. This usually needs a --rev-root option to set the rev root to be high enough in the directory tree to include all branches (it's an error to export a file that is not under the rev root). END_DESCRIPTION return $answer->[-1]; } =back =head1 WARNING: AUTOGENERATED This module is autogenerated in the pre-distribution build process, so to change it, you need the master repository files in ui_machines/..., not a CPAN/PPM/tarball/.zip/etc. distribution. =head1 COPYRIGHT Copyright 2003, 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 L. =head1 AUTHOR Barrie Slaymaker =cut 1;