diff options
author | Eric Wong <e@80x24.org> | 2019-05-23 09:36:58 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-05-23 17:43:50 +0000 |
commit | 3e894f400e588246f529dd4fb1257e19e63a17ed (patch) | |
tree | 22c03bcb053394043bc832ce39abfc557ea670c7 /lib/PublicInbox/Xapcmd.pm | |
parent | 24363017ffeba73f5b02c5e2d1dc465c682c676b (diff) | |
download | public-inbox-3e894f400e588246f529dd4fb1257e19e63a17ed.tar.gz |
Emit information about reindexing git revision ranges when used with xcpdb. Additionally, distinguish Xapian copy output from v2 git epoch counting by increasing directory context info. For now, v1 batches batches are emitted. v2 indexing is still missing progress reporting for batches, as the data structures for reindexing would benefit from a refactoring, first. This does not currently affect the use of public-inbox-index, but may in the future.
Diffstat (limited to 'lib/PublicInbox/Xapcmd.pm')
-rw-r--r-- | lib/PublicInbox/Xapcmd.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/PublicInbox/Xapcmd.pm b/lib/PublicInbox/Xapcmd.pm index aa3e4c09..0e448047 100644 --- a/lib/PublicInbox/Xapcmd.pm +++ b/lib/PublicInbox/Xapcmd.pm @@ -222,10 +222,11 @@ sub cpdb { $it = $src->postlist_begin(''); $end = $src->postlist_end(''); - $pfx = (split('/', $old))[-1].':'; if ($pr) { $nr = 0; $tot = $src->get_doccount; + my @p = split('/', $old); + $pfx = "$p[-2]/$p[-1]:"; $fmt = "$pfx % ".length($tot)."u/$tot\n"; $pr->("$pfx copying $tot documents\n"); } @@ -255,7 +256,6 @@ sub cpdb { return unless $opt->{compact}; $src = $dst = undef; # flushes and closes - $pfx = undef unless $fmt; $pr->("$pfx compacting...\n") if $pr; # this is probably the best place to do xapian-compact @@ -268,11 +268,11 @@ sub cpdb { } my ($r, $w); - if ($pfx && pipe($r, $w)) { + if ($pr && pipe($r, $w)) { $rdr->{1} = fileno($w); } my $pid = spawn($cmd, $env, $rdr); - if ($pfx) { + if ($pr) { close $w or die "close: \$w: $!"; foreach (<$r>) { s/\r/\r$pfx /g; |