bldsystemtools/commonbldutils/DefectTrack.pl
branchRCL_3
changeset 24 d90029decf65
parent 20 a9d4531388d0
child 33 54aa4a06a075
child 34 5e522efbae7b
equal deleted inserted replaced
20:a9d4531388d0 24:d90029decf65
     1 #
       
     2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 # All rights reserved.
       
     4 # This component and the accompanying materials are made available
       
     5 # under the terms of "Eclipse Public License v1.0"
       
     6 # which accompanies this distribution, and is available
       
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 #
       
     9 # Initial Contributors:
       
    10 # Nokia Corporation - initial contribution.
       
    11 #
       
    12 # Contributors:
       
    13 #
       
    14 # Description: 
       
    15 #
       
    16 # This script scans through the changes submitted on the specified codeline, within the range specified, and detects all changes involving a Defect Fix 
       
    17 
       
    18 # Renaming Parameters  
       
    19 $Codeline=$ARGV[0];
       
    20 $OldNumber=$ARGV[1];
       
    21 $NewNumber=$ARGV[2];
       
    22 $query="$Codeline\@$OldNumber,$NewNumber";
       
    23 
       
    24 system("p4 changes $query >changes.tmp");
       
    25 @changes;
       
    26 open(TMP,"changes.tmp");
       
    27 while(<TMP>)
       
    28 {
       
    29     $_=split /\s+/,$_;
       
    30     push @changes, $_[1];
       
    31 }
       
    32 close(TMP);
       
    33 
       
    34 #print @changes;
       
    35     
       
    36 
       
    37 foreach $i(@changes){
       
    38         system("p4 describe -ds -s $i >>description.tmp");
       
    39 	open(DES,">>description.tmp");
       
    40 	print DES "\n\n";
       
    41 	close(DES);
       
    42     }
       
    43 
       
    44 
       
    45 open(DES,"description.tmp");
       
    46 $FileFlag=0;
       
    47 while(<DES>)
       
    48 {
       
    49     if ($_ =~/^Change\s(\d+)\s/){
       
    50 	@ChangeInfo=split /\s+/,$_;
       
    51 	$CurrentChange=$ChangeInfo[1];
       
    52 	}
       
    53     
       
    54     if ($_=~/([A-Z][A-Z][A-Z]-)/){		#V4 defects
       
    55 	print "$CurrentChange\n";
       
    56 	print $_;
       
    57     }
       
    58 	
       
    59     if ($_=~/([a-zA-Z]{3}\d{4,6})/){		#TeamTrack defects
       
    60  	print "$CurrentChange\n";
       
    61  	print $_;
       
    62     }
       
    63  
       
    64 
       
    65 }
       
    66 
       
    67 
       
    68 close(DES);
       
    69 close(TMP);
       
    70 system("del description.tmp");
       
    71 system("del changes.tmp");