[p4] How can I tell if a changelist was added to a label?

Neil MacMullen npm at csr.com
Tue Oct 17 07:57:19 PDT 2006


Weintraub, David wrote:
> I would think there could be something like this:
> 
>     $ p4 files //...@><changeList>,@=<label> 
> 

I haven't tested it thoroughly but the following perl probably
does roughly what you want...


my ($change,$label) = @ARGV ;
foreach my $file (`p4 files \@=$change`)
{
      my ($f,$r) = $file=~/(.+)\#(\d+)/ ;
      my $lab = `p4 files $f@=$label`;
      my ($f2,$r2) = $lab=~/(.+)\#(\d+)/ ;
      print "ERROR - $f\#$r from $change didn't make it into $label 
(\#$r2)\n" if ($r > $r2);
}


Neil


More information about the perforce-user mailing list