revlog: fix for generaldelta distance calculation
The decision whether or not to store a full snapshot instead of a delta is done
based on the distance value calculated in _addrevision.builddelta(rev).
This calculation traditionally used the fact of deltas only using the previous
revision as base. Generaldelta mechanism is changing this, yet the calculation
still assumes that current-offset minus chainbase-offset equals chain-length.
This appears to be wrong.
This patch corrects the calculation by means of using the chainlength function
if Generaldelta is used.
tests: reduce spurious failures when run with generaldelta
Quite a few tests fail in noisy but meaningless ways when the test suite
is run with generaldelta enabled:
./run-tests.py --extra-config-opt=format.generaldelta=1
This reduces the amount of noise introduced by the debugindex command,
the main source of differences. In my environment, when testing with
generaldelta enabled, this change reduces the number of completely
failing tests from 21 to 8.
histedit: add extension docstring from external README
Made a couple of tweaks to try and fit better with the hg docstring
style and fix up some ReST errors in the README.
revlog: make compress a method
This allows an extension to optionally use a new compression type based
on the options applied by the repo to the revlog's opener.
(decompress doesn't need the same treatment, as it can be replaced using
extensions.wrapfunction, and can figure out which compression algorithm
is in use based on the first byte of the compressed payload.)
largefiles: batch statlfile requests when pushing a largefiles repo (
issue3386)
This implements a part of issue 3386. It batches the request for the status of
all largefiles in the revisions that are about to be pushed into a single
request, instead of doing N separate requests.
In a real world test case, this change was verified to save 1,116 round-trips to
the server. It only requires a client-side change; it is backwards-compatible
with an older version of the server.