cext: fix most truncation warnings in revlog on Windows
There's one more, and I'm not sure why it isn't being tripped on other
platforms:
mercurial/cext/revlog.c(430) : warning C4244: '=' : conversion from
'Py_ssize_t' to 'char', possible loss of data
cext: fix Windows warning about implicit conversion of 32-bit shift to 64 bit
mercurial/cext/revlog.c(1541) : warning C4334: '<<' : result of 32-bit shift
implicitly converted to 64 bits (was 64-bit shift int ended?)
index: make capacity argument to nt_init be measured in revisions
The nodetree's internal capacity field is measures in nodetree nodes,
which is not something the caller should have to know about.
Differential Revision: https://phab.mercurial-scm.org/D4166
index: avoid duplicating capacity-growth expression
We were duplicating the "*2" instead of reusing it. It's overflow-safe
to reuse as long as the growth factor (i.e. currently 2) is not larger
than sizeof(nodetreenode) (currently 64 or 128).
Differential Revision: https://phab.mercurial-scm.org/D4165
index: move check for too large capacity into nt_init()
It's clearer to have the check just before the allocation happens.
Differential Revision: https://phab.mercurial-scm.org/D4164
shortest: don't include nullid in disambigution revset
As noted by Yuya in the review of D4118, the fact that the nodetree
always contains the nullid is not what we want for the disambiguation
case. It's not what the pure version of the code does.
Note that the updated test also passes before this patch, but it
wouldn't have passed in native-code mode once we start using the
nodetree for disambiguating nodeid prefixes.
Differential Revision: https://phab.mercurial-scm.org/D4163
index: don't include nullid in the internal "length" field
This is a follow-up to
781b2720d2ac (index: don't include nullid in
len(), 2018-07-20). I intentionally didn't update the "index stats",
so it will also not include the space for nullid after this patch.
Differential Revision: https://phab.mercurial-scm.org/D4162
tests: add test coverage for revlogindex[-1] which was previously missing
Differential Revision: https://phab.mercurial-scm.org/D4184