diff mbox series

[OSSTEST,3/4] cs-bisection-step: need_repro: Support $consider_parents

Message ID 20200604124459.18453-4-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series bisection: Skip some useless repros | expand

Commit Message

Ian Jackson June 4, 2020, 12:44 p.m. UTC
This flag tells need_repro to look at parent commits of the indicated
rtuple node, as well as the node itself.  We walk up the tree.  If
there are multiple parents, we stop; likewise if we find any rtuple
which doesn't have the expected results.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 cs-bisection-step | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/cs-bisection-step b/cs-bisection-step
index 90e0601a..bc6fb794 100755
--- a/cs-bisection-step
+++ b/cs-bisection-step
@@ -822,13 +822,31 @@  sub need_repro_sequence ($$) {
     }
 }
 
-sub need_repro ($$$) {
-    my ($st, $n, $what) = @_;
+sub need_repro ($$$;$) {
+    my ($st, $n, $what, $consider_parents) = @_;
 
     return 1 if conflicted_warning($n, $what);
 
     my $fl= $n->{Flights} || [];
     my $xinfo='';
+    if ($consider_parents) {
+        $fl = [ @$fl ];
+	my $nloop = $n;
+	my $iters = 0;
+	for (;;) {
+	    last unless @{ $nloop->{Parents} } == 1;
+	    $nloop = $nloop->{Parents}[0];
+	    $iters++;
+	    $xinfo = " (at ancestor ~$iters)";
+	    my @others = grep { $_->{Result} ne $st } @{ $nloop->{Flights} };
+	    if (@others) {
+	        print STDERR
+ " For $what, parent search stopping at $nloop->{Rtuple}, results @others";
+	    }
+	    push @$fl, @{ $nloop->{Flights} };
+	}
+    }
+
     foreach my $f (sort { $a->{Flight} <=> $b->{Flight} } @$fl) {
         next unless $f->{Flight} > $repro_lastflight;
 	if ($f->{Result} ne $st) {