#!/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;