]> Sergey Matveev's repositories - public-inbox.git/blobdiff - script/public-inbox-convert
multi_git: hoist out common epoch/alternates handling
[public-inbox.git] / script / public-inbox-convert
index e6ee65296f0bdf27998856a06bf7c8d5b07ff626..01af846aa2502ac0001e156ed5fcfc4d4941a2ca 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w
-# Copyright (C) 2018-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2018-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <http://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use v5.10.1;
@@ -38,7 +38,7 @@ GetOptions($opt, qw(jobs|j=i index! help|h),
                qw(verbose|v+ rethread compact|c+ fsync|sync!
                indexlevel|index-level|L=s max_size|max-size=s
                batch_size|batch-size=s
-               sequential_shard|sequential-shard|seq-shard
+               sequential-shard|seq-shard
                )) or die $help;
 if ($opt->{help}) { print $help; exit 0 };
 my $old_dir = shift(@ARGV) // '';
@@ -179,7 +179,7 @@ if (my $old_mm = $old->mm) {
        $v2w->idx_init($opt);
        $v2w->{mm}->{dbh}->sqlite_backup_from_file($old_mm);
 
-       my $epoch0 = PublicInbox::Git->new($v2w->git_init(0));
+       my $epoch0 = PublicInbox::Git->new($v2w->{mg}->add_epoch(0));
        chop(my $cmt = $epoch0->qx(qw(rev-parse --verify), $head));
        $v2w->last_epoch_commit(0, $cmt);
 }