williamr/summarise_hg_status.pl
changeset 20 54785ea4cd2e
parent 18 4ed8ba809509
--- a/williamr/summarise_hg_status.pl	Mon Jul 20 15:38:47 2009 +0100
+++ b/williamr/summarise_hg_status.pl	Wed Jul 22 15:38:32 2009 +0100
@@ -19,6 +19,7 @@
 my %listings;
 my $current_repo = "";
 my @filelist = ();
+my %all_repos;
 
 sub record_file($$)
   {
@@ -31,11 +32,15 @@
 
 sub finished_repo()
   {
-  if ($current_repo ne "" && scalar @filelist > 0)
+  if ($current_repo ne "")
     {
     $current_repo =~ s/^.*CL\/sf/sf/; # remove leading MCL or FCL stuff
-    @{$listings{$current_repo}} = sort @filelist;
-    # printf STDERR "* %s %d\n", $current_repo, scalar @filelist;
+    $all_repos{$current_repo} = 1;
+    if (scalar @filelist > 0)
+      {
+      @{$listings{$current_repo}} = sort @filelist;
+      # printf STDERR "* %s %d\n", $current_repo, scalar @filelist;
+      }
     }
   @filelist = ();
   $current_repo = "";
@@ -55,7 +60,7 @@
   if ($line =~ /^abort/)
     {
     # ignore the current repo, as it probably didn't have the right tag
-    $current_repo = "";
+    # $current_repo = "";
     next;
     }
   if ($line =~ /^([MARC]) (\S.*\S)\s*$/)
@@ -69,6 +74,12 @@
 
 finished_repo();
 
+foreach my $repo (sort keys %all_repos)
+  {
+  next if (defined $listings{$repo});
+  print STDERR "No valid comparison for $repo\n";
+  }
+
 print "Package\tChange\tComponent\tFilename\tCount\n";
 foreach my $repo (sort keys %listings)
   {