about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2018-12-28 10:16:11 +0000
committerEric Wong <e@80x24.org>2018-12-28 19:17:47 +0000
commit0e933ed9b8a751d70623f72fbee98ad77af7578c (patch)
tree65bd5a2c4ef8cec4908c645529c5417c5f0a3ec9 /lib
parentc5d3dc3122323bda426de9251fcbdb2561570c42 (diff)
downloadpublic-inbox-0e933ed9b8a751d70623f72fbee98ad77af7578c.tar.gz
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/V2Writable.pm5
1 files changed, 4 insertions, 1 deletions
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;
 }