From: Ian Jackson Date: Sun, 26 Feb 2012 00:26:29 +0000 (+0000) Subject: list works again X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=topbloke.git;a=commitdiff_plain;h=8b13342a48b077df1c1117087fa4c9c2e99c0984;hp=1a6262c839e4ed26b66cbbeb68910d89be52ac03 list works again --- diff --git a/Topbloke.pm b/Topbloke.pm index 130aa7b..ec929ff 100644 --- a/Topbloke.pm +++ b/Topbloke.pm @@ -11,6 +11,8 @@ use IPC::Open2; use File::Path qw(make_path remove_tree); use File::Basename; +use Data::Dumper; + BEGIN { use Exporter (); our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); @@ -414,6 +416,7 @@ sub patch_matches_spec ($$) { sub foreach_patch ($$$$) { my ($spec, $deleted_ok, $want, $body) = @_; +print STDERR Dumper(\@_); # runs $body->($patch, $parsedname, \%meta) # where $meta{} is, for in @$want: # undefined if metadata file doesn't exist @@ -426,7 +429,7 @@ sub foreach_patch ($$$$) { # which means to look in the corresponding base branch my @want = @$want; my $atfront = sub { - my $thing = @_; + my ($thing) = @_; @want = ($thing, grep { $_ ne $thing } @want); }; $atfront->(' patch'); @@ -439,13 +442,16 @@ sub foreach_patch ($$$$) { my $parsedname; my $patch = substr($',19); #'); my $wantix = 0; +print STDERR Dumper(\@want); foreach my $wantent (@want) { my $file = $wantent; my $stripnl = ($file =~ s/_$//); my $inbase = ($file =~ s/^B_//); if ($file eq ' patch') { +print STDERR "has spc patch\n"; if ($spec) { +print STDERR "hasspec\n"; $parsedname = parse_patch_name($patch); if (!patch_matches_spec($parsedname, $spec)) { debug("foreach_patch mismatch"); diff --git a/tb-list.pl b/tb-list.pl index 8fc3c3b..e31304a 100755 --- a/tb-list.pl +++ b/tb-list.pl @@ -57,11 +57,15 @@ foreach $sort (@sort) { our %patches; +use Data::Dumper; + foreach_patch($relatedto || $leaves || !$spec ? { } : $spec, $deleted || $deleted_only, [qw(B_deps +included)], sub { my ($patch,$parsedname,$meta) = @_; + +print Dumper($parsedname); $patches{$patch}{Meta} = $meta; $patches{$patch}{ParsedName} = $parsedname; $patches{$patch}{Deps} = @@ -187,7 +191,10 @@ foreach my $p (@output) { my $v = $patches{$p}; my $pa = $v->{ParsedName}; my ($msgkind, $msg) = git_get_object("$pa->{Ref}:.topbloke/msg"); - die "$p $msgkind ?" unless $msgkind eq 'blob'; + if ($msgkind ne 'blob') { + warn "$p $msgkind ?"; + next; + } my $subject = $msg =~ m/^Subject:\s*(?:\[[^][]*\]\s*)?(.*\S)\s*$/mi ? $1 : "[no subject]";