]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
v2writable: drop experimental DEBUG_DIFF support
authorEric Wong <e@80x24.org>
Sat, 8 Apr 2023 09:23:44 +0000 (09:23 +0000)
committerEric Wong <e@80x24.org>
Sat, 8 Apr 2023 20:12:28 +0000 (20:12 +0000)
I haven't used it in 5 years, and I doubt anybody else has,
either.  In any case, we have both `lei mail-diff' and diff
support in the WWW UI, now, so more convenient options are
available.

lib/PublicInbox/V2Writable.pm

index 856442a9ca4e1773455e39dfb83f75d731f8e25c..ae8d778f8e151636bdcf1a8864fba2614595ac7d 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2018-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 
 # This interface wraps and mimics PublicInbox::Import
@@ -22,7 +22,6 @@ use PublicInbox::Spawn qw(spawn popen_rd run_die);
 use PublicInbox::Search;
 use PublicInbox::SearchIdx qw(log2stack is_ancestor check_size is_bad_blob);
 use IO::Handle; # ->autoflush
-use File::Temp ();
 use POSIX ();
 
 my $OID = qr/[a-f0-9]{40,}/;
@@ -660,23 +659,6 @@ sub import_init {
        $im;
 }
 
-# XXX experimental
-sub diff ($$$) {
-       my ($mid, $cur, $new) = @_;
-
-       my $ah = File::Temp->new(TEMPLATE => 'email-cur-XXXX', TMPDIR => 1);
-       print $ah $cur->as_string or die "print: $!";
-       $ah->flush or die "flush: $!";
-       PublicInbox::Import::drop_unwanted_headers($new);
-       my $bh = File::Temp->new(TEMPLATE => 'email-new-XXXX', TMPDIR => 1);
-       print $bh $new->as_string or die "print: $!";
-       $bh->flush or die "flush: $!";
-       my $cmd = [ qw(diff -u), $ah->filename, $bh->filename ];
-       print STDERR "# MID conflict <$mid>\n";
-       my $pid = spawn($cmd, undef, { 1 => 2 });
-       waitpid($pid, 0) == $pid or die "diff did not finish";
-}
-
 sub get_blob ($$) {
        my ($self, $smsg) = @_;
        if (my $im = $self->{im}) {
@@ -700,9 +682,6 @@ sub content_exists ($$$) {
                }
                my $cur = PublicInbox::Eml->new($msg);
                return 1 if content_matches($chashes, $cur);
-
-               # XXX DEBUG_DIFF is experimental and may be removed
-               diff($mid, $cur, $mime) if $ENV{DEBUG_DIFF};
        }
        undef;
 }