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 5BCCD1FFA6 for ; Tue, 27 Oct 2020 07:54:54 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 06/52] v2writable: make OO calls to last_commit-related methods Date: Tue, 27 Oct 2020 07:54:07 +0000 Message-Id: <20201027075453.19163-7-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: We'll try to reuse as much V2Writable code as possible for external indices, but the way "last_commit" info is stored must be different as external indices will deal with last_commit info for multiple inboxes. --- lib/PublicInbox/V2Writable.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index 9d08549f..de89b729 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -953,7 +953,7 @@ sub index_oid { # cat_async callback } # only update last_commit for $i on reindex iff newer than current -sub update_last_commit ($$$$) { +sub update_last_commit { my ($self, $git, $i, $cmt) = @_; my $last = last_epoch_commit($self, $i); if (defined $last && is_ancestor($git, $last, $cmt)) { @@ -1034,7 +1034,7 @@ sub sync_prepare ($$$) { # reindex stops at the current heads and we later rerun index_sync # without {reindex} - my $reindex_heads = last_commits($self, $epoch_max) if $sync->{reindex}; + my $reindex_heads = $self->last_commits($epoch_max) if $sync->{reindex}; for (my $i = $epoch_max; $i >= 0; $i--) { my $git_dir = git_dir_n($self, $i); @@ -1229,7 +1229,7 @@ sub index_epoch ($$$) { } } $all->async_wait_all; - update_last_commit($self, $git, $i, $stk->{latest_cmt}); + $self->update_last_commit($git, $i, $stk->{latest_cmt}); } sub xapian_only {