]> Sergey Matveev's repositories - public-inbox.git/blobdiff - script/public-inbox-edit
treewide: "require" + "use" cleanup and docs
[public-inbox.git] / script / public-inbox-edit
index b437b3c0ac1f23c3408bb33e384b61623d5cea7c..e408c7bccdd260f1e37086d41e095240e873552d 100755 (executable)
@@ -8,13 +8,13 @@ use strict;
 use warnings;
 use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev);
 use PublicInbox::AdminEdit;
-use File::Temp ();
+use File::Temp 0.19 (); # 0.19 for TMPDIR
 use PublicInbox::ContentId qw(content_id);
 use PublicInbox::MID qw(mid_clean mids);
 PublicInbox::Admin::check_require('-index');
-require PublicInbox::MIME;
-require PublicInbox::InboxWritable;
-require PublicInbox::Import;
+use PublicInbox::MIME;
+use PublicInbox::InboxWritable;
+use PublicInbox::Import;
 
 my $usage = "$0 -m MESSAGE_ID [--all] [INBOX_DIRS]";
 my $opt = { verbose => 1, all => 0, -min_inbox_version => 2, raw => 0 };
@@ -57,7 +57,7 @@ sub find_mid ($$$) {
                        my $tuple = [ $ibx, $smsg ];
                        push @{$found->{$cid} ||= []}, $tuple
                }
-               delete @$ibx{qw(over mm git search)}; # cleanup
+               PublicInbox::InboxWritable::cleanup($ibx);
        }
        $found;
 }
@@ -131,7 +131,7 @@ foreach my $to_edit (values %$found) {
        my $edit_fn = $edit_fh->filename;
        my ($ibx, $smsg) = @{$to_edit->[0]};
        my $old_raw = $ibx->msg_by_smsg($smsg);
-       delete @$ibx{qw(over mm git search)}; # cleanup
+       PublicInbox::InboxWritable::cleanup($ibx);
 
        my $tmp = $$old_raw;
        if (!$opt->{raw}) {