return '<pre>debug log seek error</pre>';
}
$log = do { local $/; <$log> } // do {
- warn "readline(log): $!";
- return '<pre>debug log read error</pre>';
+ if (!eof($log)) {
+ warn "readline(log): $!";
+ return '<pre>debug log read error</pre>';
+ }
+ '';
};
return '' if $log eq '';
$ctx->{-linkify} //= PublicInbox::Linkify->new;
$au =~ s/>/>$x/;
}
$_ = ascii_html($_) for ($au, $co);
+ my $ibx_url = ibx_url_for($ctx) // $upfx;
$au =~ s!(> +)([0-9]{4,}-\S+ \S+)!
my ($gt, $t) = ($1, $2);
$t =~ tr/ :-//d;
qq($gt<a
-href="$upfx?t=$t"
+href="$ibx_url?t=$t"
title="list contemporary emails">$2</a>)
!e;
+
$ctx->{-title_html} = $s = $ctx->{-linkify}->to_html($s);
my ($P, $p, $pt) = delete @$ctx{qw(-cmt_P -cmt_p -cmt_pt)};
$_ = qq(<a href="$upfx$_/s/">).shift(@$p).'</a> '.shift(@$pt) for @$P;
return show_tree($ctx, $res) if $type eq 'tree';
return show_tag($ctx, $res) if $type eq 'tag';
return show_other($ctx, $res) if $type ne 'blob';
+ my $fn = $di->{path_b} // $hints->{path_b};
my $paths = $ctx->{-paths} //= do {
- my $fn = $di->{path_b} // $hints->{path_b};
my $path = to_filename($fn // 'blob');
my $raw_more = qq[(<a\nhref="$path">raw</a>)];
"\nname: ${\ascii_html($fn)} \t # note: path name is non-authoritative";
[ $path, $raw_more ];
};
+ $ctx->{-q_value_html} //= do {
+ my $s = defined($fn) ? 'dfn:'.ascii_html($fn).' ' : '';
+ $s.'dfpost:'.substr($oid, 0, 7);
+ };
if ($size > $MAX_SIZE) {
return stream_large_blob($ctx, $res) if defined $ctx->{fn};
}
$ctx->{fn} = $fn;
$ctx->{-tmp} = File::Temp->newdir("solver.$oid_b-XXXX", TMPDIR => 1);
- open $ctx->{lh}, '+>>', "$ctx->{-tmp}/solve.log" or die "open: $!";
+ unless ($ctx->{lh}) {
+ open $ctx->{lh}, '+>>', "$ctx->{-tmp}/solve.log" or
+ die "open: $!";
+ }
my $solver = PublicInbox::SolverGit->new($ctx->{ibx},
\&solve_result, $ctx);
$solver->{gits} //= [ $ctx->{git} ];