#!/usr/bin/env perl -w use strict; my $p4 = "p4"; my $command = "opened -a"; my $rcommand = "revert"; my @accessUpdate= `$p4 $command`; my @revertList = (); foreach (@accessUpdate) { chomp; if(/^(.*)#.*\s-\s(add)\s.*$/) { print "$1: $2\n"; push @revertList,$1; } } foreach (@revertList) { chomp; print "Reverted file for opened for add: $_\n"; `$p4 $rcommand $_`; }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 8645 | Stephen Moon | removing not up-to-date scripts | ||
#1 | 6481 | Stephen Moon | revertAdd.pl added |