locked.pl #1

  • //
  • guest/
  • jeff_grills/
  • triggers/
  • locked.pl
  • View
  • Commits
  • Open Download .zip Download (600 B)
#!/usr/bin/perl

if (!do "/home/perforce/script/p4.pl")
{
		print "include failed\n";
		exit 1;
}

# get and validate command line arguments
$changeNumber = shift;
if (!defined $changeNumber)
{
	print "no changelist specified\n";
	exit 1;
}

# snarf in the change description
if (!open(DESCRIBE, "$p4 describe $changeNumber |"))
{
	print "p4 describe failed\n";
	exit 1;
}
@describe = <DESCRIBE>;
close(DESCRIBE);

# check all the lines in the descriptions
foreach (@describe)
{
	if (/\[locked\]/i)
	{
		print "May not submit a changelist with [locked] in the description\n";
		exit 1;
	}
}

exit 0;
# Change User Description Committed
#1 3625 Jeff Grills Several perforce utilities I use frequently