about summary refs log tree commit homepage
path: root/script
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-11-15 09:50:39 +0000
committerEric Wong <e@80x24.org>2019-11-16 11:05:23 +0000
commitfe565af9e3e1634412c21fb2fe2bb7612c430e47 (patch)
treeaa6d75fd6467c0969691f68e4e7199c634757565 /script
parent16b69a6a99661df777affec547ef53bd9007f1f2 (diff)
downloadpublic-inbox-fe565af9e3e1634412c21fb2fe2bb7612c430e47.tar.gz
inboxwritable: add ->cleanup method
We've been using this in -edit, and will be using it in some
more scripts and tests to optimize for run_mode=2 with
run_script.

Keeping this in the *Writable modules since I don't see it being
useful for the WWW and NNTP read-only interfaces which use
PublicInbox::Inbox.
Diffstat (limited to 'script')
-rwxr-xr-xscript/public-inbox-edit4
1 files changed, 2 insertions, 2 deletions
diff --git a/script/public-inbox-edit b/script/public-inbox-edit
index b437b3c0..1900b267 100755
--- a/script/public-inbox-edit
+++ b/script/public-inbox-edit
@@ -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}) {