From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 1AA332008A for ; Tue, 27 Oct 2020 07:54:58 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 27/52] v2writable: rename {v2w} field to {self} Date: Tue, 27 Oct 2020 07:54:28 +0000 Message-Id: <20201027075453.19163-28-e@80x24.org> In-Reply-To: <20201027075453.19163-1-e@80x24.org> References: <20201027075453.19163-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This will make it easier to reuse some indexing code for ExtSearchIdx. --- lib/PublicInbox/V2Writable.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index c0306e82..3d3c25ec 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -882,7 +882,7 @@ sub index_oid { # cat_async callback my $eml = PublicInbox::Eml->new($$bref); my $mids = mids($eml); my $chash = content_hash($eml); - my $self = $arg->{v2w}; + my $self = $arg->{self}; if (scalar(@$mids) == 0) { warn "E: $oid has no Message-ID, skipping\n"; @@ -1065,7 +1065,7 @@ sub sync_prepare ($$) { # our code and blindly injects "d" file history into git repos if (my @leftovers = keys %{delete($sync->{D}) // {}}) { warn('W: unindexing '.scalar(@leftovers)." leftovers\n"); - my $arg = { v2w => $self }; + my $arg = { self => $self }; my $unindex_oid = $self->can('unindex_oid'); for my $oid (@leftovers) { $oid = unpack('H*', $oid); @@ -1099,7 +1099,7 @@ sub unindex_oid_aux ($$$) { sub unindex_oid ($$;$) { # git->cat_async callback my ($bref, $oid, $type, $size, $sync) = @_; - my $self = $sync->{v2w}; + my $self = $sync->{self}; my $unindexed = $sync->{in_unindex} ? $sync->{unindexed} : undef; my $mm = $self->{mm}; my $mids = mids(PublicInbox::Eml->new($bref)); @@ -1172,7 +1172,7 @@ sub sync_ranges ($$) { sub index_xap_only { # git->cat_async callback my ($bref, $oid, $type, $size, $smsg) = @_; - my $self = $smsg->{v2w}; + my $self = $smsg->{self}; my $idx = idx_shard($self, $smsg->{num}); $smsg->{raw_bytes} = $size; $idx->index_raw($bref, undef, $smsg); @@ -1192,7 +1192,7 @@ sub index_xap_step ($$$;$) { } for (my $num = $beg; $num <= $end; $num += $step) { my $smsg = $ibx->over->get_art($num) or next; - $smsg->{v2w} = $self; + $smsg->{self} = $self; $ibx->git->cat_async($smsg->{blob}, \&index_xap_only, $smsg); if ($self->{transact_bytes} >= $self->{batch_bytes}) { ${$sync->{nr}} = $num; @@ -1245,7 +1245,7 @@ sub xapian_only { $sync //= { need_checkpoint => \(my $bool = 0), -opt => $opt, - v2w => $self, + self => $self, nr => \(my $nr = 0), -regen_fmt => "%u/?\n", }; @@ -1290,7 +1290,7 @@ sub index_sync { unindex_range => {}, # EPOCH => oid_old..oid_new reindex => $opt->{reindex}, -opt => $opt, - v2w => $self, + self => $self, ibx => $self->{ibx}, epoch_max => $epoch_max, };