chiark / gitweb /
wip found
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 3 Feb 2012 18:49:00 +0000 (18:49 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 3 Feb 2012 18:49:00 +0000 (18:49 +0000)
tb-update.pl

index 6005d9e..cd4e177 100755 (executable)
@@ -91,7 +91,7 @@ sub update_base ($) {
                push @sources, { 
                    Name => $depline,
                    Ref => "$tiprefs/$depline", 
-                   Kind => 'tb',
+                   Kind => 'topbloke',
                };
            }
        }
@@ -120,14 +120,46 @@ sub update_base ($) {
        # ie we are ahead of the source.  Skip those sources.
        @sources = grep { $source->{MergeBase} ne $source->{Head} } @sources;
 
+       if (!@sources) {
+           print "$patch base is up to date\n" or die $!;
+           last;
+       }
+
        my $best = $sources[0];
        foreach my $source (@sources[1..$#sources]) {
            next if compare_source_ages($best->{Ref}, $source->{Ref}) <= 0;
            $best = $source;
-               
        }
-       
 
+       my $sref = $source->{Ref};
+
+       if ($source->{Kind} eq 'topbloke') {
+           # Check for unwanted dependency removals
+           my (%source_inc,%anc_inc);
+           $source_inc{$_}=1 foreach split /\n/, 
+               git_get_object("$sref:.topbloke/+included");
+           $anc_inc{$_}=1 foreach split /\n/, 
+               git_get_object("$source->{MergeBase}:.topbloke/+included");
+           my @unwanted_dr;
+           foreach my $dep (keys %desired) {
+               next if $source_inc{$dep};
+               unless unless $anc_inc{$dep};
+               my $unw_dr = { Name => $dep };
+               run_git(sub {
+                   my ($cand, @parents) = split;
+                   return if dep_included_in($dep, $cand);
+                   return if grep { !dep_included_in($dep, $_) } @parents;
+                   # OK, it's missing from $cand but included in
+                   # all of $cand's parents.
+                   
+                   },
+                       qw(git-rev-list --date-order --remove-empty)
+                       '--pretty=format:%H %P%n',
+                       $dep, '--', '.topbloke/+included');
+               
+               
+               push @unwanted_dr, { Name => $dep };
+           
 
 sub done ($) { 
     our %done;