-
- my @messages;
- my $git = try_git_pm($args->{git_dir});
- my ($first, $last) = each_recent_blob($args, sub {
- my $mime = do_cat_mail($git, $_[0])
- or return 0;
- if ($top && ($mime->header('In-Reply-To') ||
- $mime->header('References'))) {
- return 0;
+ my $atom_url = $feed_opts->{atomurl};
+
+ $fh->write("<html><head><title>$title</title>" .
+ "<link\nrel=alternate\ntitle=\"Atom feed\"\n".
+ "href=\"$atom_url\"\ntype=\"application/atom+xml\"/>" .
+ '</head><body>' . PublicInbox::View::PRE_WRAP .
+ "<b>$title</b> (<a\nhref=\"$atom_url\">Atom feed</a>)\n");
+
+ my $state;
+ my $git = PublicInbox::GitCatFile->new($ctx->{git_dir});
+ my $topics;
+ my $srch = $ctx->{srch};
+ $srch and $topics = [ [], {} ];
+ my (undef, $last) = each_recent_blob($ctx, sub {
+ my ($path, $commit, $ts, $u, $subj) = @_;
+ $state ||= [ undef, {}, $commit, 0 ];
+
+ if ($srch) {
+ add_topic($git, $srch, $topics, $path, $ts, $u, $subj);
+ } else {
+ my $mime = do_cat_mail($git, $path) or return 0;
+ PublicInbox::View::index_entry($fh, $mime, 0, $state);
+ 1;