williamr/summarise_hg_status.pl
changeset 20 54785ea4cd2e
parent 18 4ed8ba809509
equal deleted inserted replaced
19:a101a0b5d6d7 20:54785ea4cd2e
    17 use strict;
    17 use strict;
    18 
    18 
    19 my %listings;
    19 my %listings;
    20 my $current_repo = "";
    20 my $current_repo = "";
    21 my @filelist = ();
    21 my @filelist = ();
       
    22 my %all_repos;
    22 
    23 
    23 sub record_file($$)
    24 sub record_file($$)
    24   {
    25   {
    25   my ($file, $change) = @_;
    26   my ($file, $change) = @_;
    26   
    27   
    29   return;
    30   return;
    30   }
    31   }
    31 
    32 
    32 sub finished_repo()
    33 sub finished_repo()
    33   {
    34   {
    34   if ($current_repo ne "" && scalar @filelist > 0)
    35   if ($current_repo ne "")
    35     {
    36     {
    36     $current_repo =~ s/^.*CL\/sf/sf/; # remove leading MCL or FCL stuff
    37     $current_repo =~ s/^.*CL\/sf/sf/; # remove leading MCL or FCL stuff
    37     @{$listings{$current_repo}} = sort @filelist;
    38     $all_repos{$current_repo} = 1;
    38     # printf STDERR "* %s %d\n", $current_repo, scalar @filelist;
    39     if (scalar @filelist > 0)
       
    40       {
       
    41       @{$listings{$current_repo}} = sort @filelist;
       
    42       # printf STDERR "* %s %d\n", $current_repo, scalar @filelist;
       
    43       }
    39     }
    44     }
    40   @filelist = ();
    45   @filelist = ();
    41   $current_repo = "";
    46   $current_repo = "";
    42   }
    47   }
    43   
    48   
    53     }
    58     }
    54   # abort: unknown revision 'PDK_2.0.c'!
    59   # abort: unknown revision 'PDK_2.0.c'!
    55   if ($line =~ /^abort/)
    60   if ($line =~ /^abort/)
    56     {
    61     {
    57     # ignore the current repo, as it probably didn't have the right tag
    62     # ignore the current repo, as it probably didn't have the right tag
    58     $current_repo = "";
    63     # $current_repo = "";
    59     next;
    64     next;
    60     }
    65     }
    61   if ($line =~ /^([MARC]) (\S.*\S)\s*$/)
    66   if ($line =~ /^([MARC]) (\S.*\S)\s*$/)
    62     {
    67     {
    63     my $change = $1;
    68     my $change = $1;
    66     next;
    71     next;
    67     }
    72     }
    68   }
    73   }
    69 
    74 
    70 finished_repo();
    75 finished_repo();
       
    76 
       
    77 foreach my $repo (sort keys %all_repos)
       
    78   {
       
    79   next if (defined $listings{$repo});
       
    80   print STDERR "No valid comparison for $repo\n";
       
    81   }
    71 
    82 
    72 print "Package\tChange\tComponent\tFilename\tCount\n";
    83 print "Package\tChange\tComponent\tFilename\tCount\n";
    73 foreach my $repo (sort keys %listings)
    84 foreach my $repo (sort keys %listings)
    74   {
    85   {
    75   my @filelist = @{$listings{$repo}};
    86   my @filelist = @{$listings{$repo}};