]> git.michaelhowe.org Git - packages/b/bup.git/commit
cmd/midx: --auto mode can combine existing midx files now.
authorAvery Pennarun <apenwarr@gmail.com>
Thu, 2 Sep 2010 20:12:12 +0000 (13:12 -0700)
committerAvery Pennarun <apenwarr@gmail.com>
Mon, 6 Sep 2010 10:14:07 +0000 (03:14 -0700)
commit5e0db6f26ee2b1d3f1f1a3c221f5e11207f86694
treec6dfca451809157e2e8b8af8a76b4ca020b5b369
parent575ab7ef264d29ec8e39c9381f68c68b48394494
cmd/midx: --auto mode can combine existing midx files now.

Previously, --auto would *only* create a midx from not-already-midxed .idx
files.  This wasn't optimal since you'd eventually end up with a tonne of
.midx files, which is just as bad as a tonne of .idx files.

Now we'll try to maintain a maximum number of midx files using a
highwater/lowwater mark.  That means the number of active midx files should
now stay between 2 and 5, and you can run 'bup midx -a' as often as you
want.

'bup midx -f' will still make sure everything is in a single .midx file,
which is an efficient thing to run every now and then.

'bup midx -af' is the same, but uses existing midx files rather than forcing
bup to start from only .idx files.  Theoretically this should always be
faster than, and never be worse than, 'bup midx -f'.

Bonus: 'bup midx -a' now works when there's a limited number of file
descriptors.  The previous fix only worked properly with 'bup midx -f'.
(This was rarely a problem since 'bup midx -a' would only ever touch the
last few .idx files, so it didn't need many file descriptors.)

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
cmd/midx-cmd.py
lib/bup/git.py