From 0e933ed9b8a751d70623f72fbee98ad77af7578c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 28 Dec 2018 10:16:11 +0000 Subject: init: allow --skip of old epochs for -V2 repos This allows archivists to publish incomplete archives with newer mail while allowing "0.git" (or "1.git" and so on) epochs to be added-after-the-fact (without affecting "git clone" followers). A reindex will be necessary for Xapian and SQLite to catch up once the old epochs are added; but the reindexing code is also capable of tolerating missing epochs. --- lib/PublicInbox/V2Writable.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index 0396d9f5..152d90ab 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -83,11 +83,14 @@ sub new { } sub init_inbox { - my ($self, $parallel) = @_; + my ($self, $parallel, $skip) = @_; $self->{parallel} = $parallel; $self->idx_init; my $epoch_max = -1; git_dir_latest($self, \$epoch_max); + if (defined $skip && $epoch_max == -1) { + $epoch_max = $skip; + } $self->git_init($epoch_max >= 0 ? $epoch_max : 0); $self->done; } -- cgit v1.2.3-24-ge0c7