- my $git = $inbox->git;
- my $name = $inbox->{name};
- my $addr = $inbox->{-primary_address};
- PublicInbox::Import->new($git, $name, $addr, $inbox);
+ my $v = $inbox->{version} || 1;
+ if ($v == 2) {
+ eval { require PublicInbox::V2Writable };
+ die "v2 not supported: $@\n" if $@;
+ PublicInbox::V2Writable->new($inbox);
+ } elsif ($v == 1) {
+ my $git = $inbox->git;
+ my $name = $inbox->{name};
+ my $addr = $inbox->{-primary_address};
+ PublicInbox::Import->new($git, $name, $addr, $inbox);
+ } else {
+ die "unsupported inbox version: $v\n";
+ }