# HG changeset patch # User Simon Howkins # Date 1253192723 -3600 # Node ID 67168a24b405af71dcdc4c6e4825de81b5b817b4 # Parent 7b39c2ae25269d683a8fbe3df4b24b5c2be71f2e Made test for interesting packages consider % files churned. >30% is considered interesting. Adjusted the number of files added/removed that make a package interesting to offset the items added by the churn check. diff -r 7b39c2ae2526 -r 67168a24b405 releaseAutomation/mercurialComparison.pl --- a/releaseAutomation/mercurialComparison.pl Thu Sep 17 11:40:59 2009 +0100 +++ b/releaseAutomation/mercurialComparison.pl Thu Sep 17 14:05:23 2009 +0100 @@ -25,7 +25,7 @@ defined shift and die "No more than three arguments please\n"; # Use external scripts to get the raw data and produce the CSV summary (to go into Excel, etc) -system("perl $FindBin::Bin\\..\\clone_packages\\clone_all_packages.pl -packagelist $bomInfoFile -exec -- hg status -C --rev $previousPdkLabel 2>&1 | perl $FindBin::Bin\\..\\williamr\\summarise_hg_status.pl 2> nul: > $detailsTsvFilename"); +#system("perl $FindBin::Bin\\..\\clone_packages\\clone_all_packages.pl -packagelist $bomInfoFile -exec -- hg status -A --rev $previousPdkLabel 2>&1 | perl $FindBin::Bin\\..\\williamr\\summarise_hg_status.pl 2> nul: > $detailsTsvFilename"); # The redirection above means that we discard STDERR from summarise_hg_status, # which lists packages for which it was unable to generate any data @@ -60,14 +60,27 @@ my %cookedData; foreach my $datum (@rawData) { - next if $datum->{Change} =~ m{^(same|M)$}; - $cookedData{$datum->{Package}} += $datum->{Count}; + # Accumulate the total number of files in the old revision of the pkg + $cookedData{$datum->{Package}}->{totalFiles} += $datum->{Count} unless $datum->{Change} eq "A"; + $cookedData{$datum->{Package}}->{same} += $datum->{Count} if $datum->{Change} eq "same"; + $cookedData{$datum->{Package}}->{addRemove} += $datum->{Count} if $datum->{Change} =~ m{^[AR]$}; } # Cut-off for "interesting" packages foreach my $package (keys %cookedData) { - delete $cookedData{$package} unless $cookedData{$package} >= 350; + # Ensure items are defined + $cookedData{$package}->{totalFiles} |= 1; + $cookedData{$package}->{same} |= 0; + $cookedData{$package}->{addRemove} |= 0; + $cookedData{$package}->{percentChurn} = 100 * (1 - ($cookedData{$package}->{same} / $cookedData{$package}->{totalFiles})); + + # More than N files added + removed + next if $cookedData{$package}->{addRemove} >= 400; + # More than M% churn + next if $cookedData{$package}->{percentChurn} > 30; + # Nothing interesting about this package + delete $cookedData{$package}; } # Output @@ -87,7 +100,8 @@ print <<"EOT"; === $package === -$cookedData{$package} files added/removed +$cookedData{$package}->{addRemove} files added/removed +$cookedData{$package}->{percentChurn}% churn * Cause1 * etc