diff options
author | Eric Wong <e@yhbt.net> | 2020-02-02 06:52:20 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-02-02 17:29:57 +0000 |
commit | 4bb77753fbbc30ab396a1b01d70cf65b629b6276 (patch) | |
tree | 4a27d0deef4e32a8a88c57960027344e321a3b28 | |
parent | 2fef8c4500fc00a15b36552c2a22da1582af033d (diff) | |
download | public-inbox-4bb77753fbbc30ab396a1b01d70cf65b629b6276.tar.gz |
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")
-rwxr-xr-x | script/public-inbox-convert | 6 | ||||
-rw-r--r-- | t/convert-compact.t | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/script/public-inbox-convert b/script/public-inbox-convert index 281313e0..68b0b31a 100755 --- a/script/public-inbox-convert +++ b/script/public-inbox-convert @@ -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; diff --git a/t/convert-compact.t b/t/convert-compact.t index fc46083b..f56d7817 100644 --- a/t/convert-compact.t +++ b/t/convert-compact.t @@ -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*/*"); |