die "Only conversion from v1 inboxes is supported\n" if $old->version >= 2;
require PublicInbox::Admin;
die "Only conversion from v1 inboxes is supported\n" if $old->version >= 2;
require PublicInbox::Admin;
require PublicInbox::AltId;
foreach my $i (0..$#$alt) {
my $src = PublicInbox::AltId->new($old, $alt->[$i], 0);
require PublicInbox::AltId;
foreach my $i (0..$#$alt) {
my $src = PublicInbox::AltId->new($old, $alt->[$i], 0);
$? == 0 or die "fast-export failed: $?\n";
$r = $w = undef; # v2w->done does the actual close and error checking
$v2w->done;
$? == 0 or die "fast-export failed: $?\n";
$r = $w = undef; # v2w->done does the actual close and error checking
$v2w->done;
# we want to trigger a reindex, not a from scratch index if
# we're reusing the msgmap from an existing v1 installation.
$v2w->idx_init($opt);
# we want to trigger a reindex, not a from scratch index if
# we're reusing the msgmap from an existing v1 installation.
$v2w->idx_init($opt);
my $epoch0 = PublicInbox::Git->new($v2w->git_init(0));
chop(my $cmt = $epoch0->qx(qw(rev-parse --verify), $head));
$v2w->last_epoch_commit(0, $cmt);
my $epoch0 = PublicInbox::Git->new($v2w->git_init(0));
chop(my $cmt = $epoch0->qx(qw(rev-parse --verify), $head));
$v2w->last_epoch_commit(0, $cmt);