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-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED 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 972B91F609 for ; Thu, 30 May 2019 06:52:27 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/4] v2writable: split off unindex_range mapping Date: Thu, 30 May 2019 06:52:24 +0000 Message-Id: <20190530065227.17641-2-e@80x24.org> In-Reply-To: <20190530065227.17641-1-e@80x24.org> References: <20190530065227.17641-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It'll make it easier to detect if we have anything to unindex and run git-log on, at all. --- lib/PublicInbox/V2Writable.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index 6b01171..df8cfb4 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -861,7 +861,7 @@ Rewritten history? (in $git->{git_dir}) reindexing $git->{git_dir} starting at $range - $sync->{"unindex-range.$i"} = "$base..$cur"; + $sync->{unindex_range}->{$i} = "$base..$cur"; } $range; } @@ -993,6 +993,7 @@ sub index_sync { my $sync = { mm_tmp => $self->{mm}->tmp_clone, D => {}, # "$mid\0$cid" => $oid + unindex_range => {}, # EPOCH => oid_old..oid_new reindex => $opt->{reindex}, -opt => $opt }; @@ -1009,7 +1010,7 @@ sub index_sync { -d $git_dir or next; # missing parts are fine fill_alternates($self, $i); my $git = PublicInbox::Git->new($git_dir); - my $unindex_range = delete $sync->{"unindex-range.$i"}; + my $unindex_range = delete $sync->{unindex_range}->{$i}; unindex($self, $sync, $git, $unindex_range) if $unindex_range; defined(my $range = $sync->{ranges}->[$i]) or next; $pr->("$i.git indexing $range\n") if $pr; -- EW