@$todo = @pending;
}
+# sort per-inbox scores from public-inbox-cindex --join
+sub _cr_score_sort ($$) {
+ my ($gits, $cr_score) = @_;
+ use sort 'stable'; # preserve manual ordering in config file
+ @$gits = sort {
+ $cr_score->{$b->{nick}} <=> $cr_score->{$a->{nick}}
+ } @$gits;
+}
+
sub load_coderepos { # each_cindex callback
my ($self, $pi_cfg) = @_;
my $name = $self->{name};
}
if (@$gits) {
push @{$ibx->{-csrch}}, $self if $ibx2self;
+ _cr_score_sort $gits, $cr_score;
} else {
delete $ibx->{-repo_objs};
delete $ibx->{-cr_score};
push @$gits, @alls_gits;
my $cr_score = $ALL->{-cr_score} //= {};
$cr_score->{$_->{nick}} //= scalar(@{$_->{ibx_score}//[]}) for @$gits;
+ _cr_score_sort $gits, $cr_score;
}
sub repos_sorted {
my $cr = $cfg->repo_objs($ctx->{ibx}) or return ();
my $buf = 'Code repositories for project(s) associated with this '.
$ctx->{ibx}->thing_type . ":\n";
- my @recs = PublicInbox::CodeSearch::repos_sorted($cfg, @$cr);
my $cr_score = $ctx->{ibx}->{-cr_score};
my $env = $ctx->{env};
- for (@recs) {
- my ($t, $git) = @$_;
+ for my $git (@$cr) {
for ($git->pub_urls($env)) {
my $u = m!\A(?:[a-z\+]+:)?//!i ? $_ : $top_url.$_;
my $nr = $cr_score->{$git->{nick}};
$buf .= "\n";
$buf .= $nr ? sprintf('% 9u', $nr) : (' 'x9);
- $buf .= ' '.fmt_ts($t).' '.prurl($env, $u);
+ $buf .= ' '.prurl($env, $u);
}
}
($buf);