blackbox: initialize repo attribute properly
And ditch the "bb" prefix as it's no longer a ui extension class.
blackbox: extract logger class from ui wrapper
This moves most functions to new blackboxlogger class. The ui wrapper will
be removed later.
blackbox: rename variables to prepare extracting core logic from ui wrapper
I'm going to add ui.setlogger() function so that I can enable logging feature
in command server without extending ui.__class__. This prepares for it.
"self" will be a logger instance, so this patch renames some of them to "ui".
sparse-revlog: rework the way we enforce chunk size limit
We move from a O(N) algorithm to a O(log(N)) algorithm.
The previous algorithm was traversing the whole delta chain, looking for the
exact point where it became too big. This would result in most of the delta
chain to be traversed.
Instead, we now use a "binary" approach, slicing the chain in two until we
have a chunk of the appropriate size.
We still keep the previous algorithm for the snapshots part. There are few of
them and they are large bits of data distant from each other. So the previous
algorithm should work well in that case.
To take a practical example of restoring manifest revision '
59547c40bc4c' for
a reference NetBeans repository (using sparse-revlog). The media time of the
step `slice-sparse-chain` of `perfrevlogrevision` improve from 1.109 ms to
0.660 ms.
tests: add `revlogutils.deltas` module to doctests
The doctest in these module have been from `mercurial.revlog` but the module was
not added to the doctests.
Spotted by Yuya Nishihara.