# Usage: perl itest.pl SCRIPTFILE # # Contents of SCRIPTFILE are one of the following commands per line. # # info # setp4 /path/to/p4 ... # cd dirname # # add filename [numlines] # edit filename [ lineno [ text ... ] ] # delete filename # readd filename#rev # [-flags] branch source target # [-flags] copy source target # [-flags] delete source target # [-flags] dirty source target [ lineno [ text ... ] ] # [-flags] ignore source target # [-flags] merge source target # [-flags] rename source target # [-flags] move source target # [-flags] p4copy source target # # assert TEST args ... # test [-cMININUMGRADE] [-flags] [!]TEST args ... # # Tests: # exist file ... # equal file1 file2 ... # base source target best1|best2 good1 ok1|ok2|ok3 ... # integ source target [ destination ] # ichanges source target count # irange source target count # baseless source target # # Command modifiers: # -edit source target [ lineno [ text ... ] ] # -pend (skips submit) # -prompt (enters resolve option via prompt) # -revert (reverts after submit) use Cwd qw(chdir); # Cwd's chdir() sets PWD, which Perforce needs. $p4 = "p4"; # Changeable with the setp4 command. $scriptLine = 0; $editLine = 0; @path = (); # Check for potentially dangerous P4PORT. I don't trust myself. $_ = `$p4 set P4PORT`; chomp; if ( /1666/ ) { print "P4PORT contains 1666: \"$_\". Bailing.\n"; exit; } if ( !/\d/ ) { print "You don't seem to have a P4PORT set. Bailing.\n"; exit; } foreach( @ARGV ) { if( $_ eq "-3" ) { $threeTest = 1; } } foreach( @ARGV ) { if( /^-/ ) { next; } open SCRIPT, $_ or die "Unable to open $_: $!"; while(