about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-01-11 08:46:35 +0000
committerEric Wong <e@80x24.org>2017-01-15 01:08:00 +0000
commit0ecc9528951ceec5d416bbd50cded8b60added86 (patch)
tree242a6a2adb0f01509d776b4016fed6911ce5d763
parent104021d888ef31b41bd6fdb41c272b3d14105935 (diff)
downloadpublic-inbox-0ecc9528951ceec5d416bbd50cded8b60added86.tar.gz
We don't need these legacy routines anymore and use the
newer stream-friendly _sed interface.
-rw-r--r--lib/PublicInbox/RepobrowseGitDiffCommon.pm40
1 files changed, 0 insertions, 40 deletions
diff --git a/lib/PublicInbox/RepobrowseGitDiffCommon.pm b/lib/PublicInbox/RepobrowseGitDiffCommon.pm
index bca50e15..968ca7a7 100644
--- a/lib/PublicInbox/RepobrowseGitDiffCommon.pm
+++ b/lib/PublicInbox/RepobrowseGitDiffCommon.pm
@@ -8,8 +8,6 @@ use warnings;
 use PublicInbox::RepobrowseGit qw/git_unquote git_commit_title/;
 use PublicInbox::Hval qw/utf8_html to_attr/;
 use base qw/Exporter/;
-our @EXPORT_OK = qw/git_diffstat_emit
-        git_diff_ab_index git_diff_ab_hdr git_diff_ab_hunk/;
 our @EXPORT = qw/git_diff_sed_init git_diff_sed_close git_diff_sed_run
         DSTATE_INIT DSTATE_STAT DSTATE_LINES/;
 
@@ -158,44 +156,6 @@ sub git_diffstat_rename ($$$) {
         @base ? "$base/{$from =&gt; $to}" : "$from =&gt; $to";
 }
 
-sub git_diffstat_emit ($$$) { # XXX deprecated
-        my ($req, $fh, undef) = @_;
-        my @stat = split("\0", $_[2]); # avoiding copy for $_[2]
-        my $nr = 0;
-        my ($nadd, $ndel) = (0, 0);
-        my $s = '';
-        while (defined(my $l = shift @stat)) {
-                $l =~ s/\n?(\S+)\t+(\S+)\t+// or next;
-                my ($add, $del) = ($1, $2);
-                if ($add =~ /\A\d+\z/) {
-                        $nadd += $add;
-                        $ndel += $del;
-                        $add = "+$add";
-                        $del = "-$del";
-                }
-                my $num = sprintf('% 6s/%-6s', $del, $add);
-                if (length $l) {
-                        my $anchor = to_attr(git_unquote($l));
-                        $req->{anchors}->{$anchor} = $l;
-                        $l = utf8_html($l);
-                        $l = qq(<a\nhref="#$anchor">$l</a>);
-                } else {
-                        my $from = shift @stat;
-                        my $to = shift @stat;
-                        $l = git_diffstat_rename($req, $from, $to);
-                }
-                ++$nr;
-                $s .= ' '.$num."\t".$l."\n";
-        }
-        $s .= "\n $nr ";
-        $s .= $nr == 1 ? 'file changed, ' : 'files changed, ';
-        $s .= $nadd;
-        $s .= $nadd == 1 ? ' insertion(+), ' : ' insertions(+), ';
-        $s .= $ndel;
-        $s .= $ndel == 1 ? " deletion(-)\n\n" : " deletions(-)\n\n";
-        $fh->write($s);
-}
-
 sub DSTATE_INIT () { 0 }
 sub DSTATE_STAT () { 1 }
 sub DSTATE_LINES () { 2 }