]> Sergey Matveev's repositories - public-inbox.git/commitdiff
convert: fix --no-index switch
authorEric Wong <e@yhbt.net>
Sun, 2 Feb 2020 06:52:20 +0000 (06:52 +0000)
committerEric Wong <e@yhbt.net>
Sun, 2 Feb 2020 17:29:57 +0000 (17:29 +0000)
The (currently undocumented) "--no-index" flag did not trigger
the V2Writable->done call necessary to make the import
successful.

Fixes: eea47b676127bcdb ("convert: preserve highwater mark from v1 msgmap")
script/public-inbox-convert
t/convert-compact.t

index 281313e02873fb7bd7aa27ba8fcc5dbd0e2c188f..68b0b31a41ff57b4371517b5efb62af6b4794c05 100755 (executable)
@@ -151,7 +151,5 @@ if (my $mm = $old->mm) {
        chop(my $cmt = $epoch0->qx(qw(rev-parse --verify), $head));
        $v2w->last_epoch_commit(0, $cmt);
 }
-if ($index) {
-       $v2w->index_sync({reindex => 1});
-       $v2w->done;
-}
+$v2w->index_sync({reindex => 1}) if $index;
+$v2w->done;
index fc46083b74f02e9ef733458ccd3234fd47008d3e..f56d78170500ab12a27e56764e045a8ca95e98da 100644 (file)
@@ -76,6 +76,9 @@ my $hwm = do {
 };
 ok(defined($hwm) && $hwm > 0, "highwater mark set #$hwm");
 
+$cmd = [ '-convert', '--no-index', $ibx->{inboxdir}, "$tmpdir/no-index" ];
+ok(run_script($cmd, undef, $rdr), 'convert --no-index works');
+
 $cmd = [ '-convert', $ibx->{inboxdir}, "$tmpdir/v2" ];
 ok(run_script($cmd, undef, $rdr), 'convert works');
 @xdir = glob("$tmpdir/v2/xap*/*");