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
context: safegaurd from 'lx' being passed as file flag in manifest
Follows up for
d558e53cd6b619d5f671a7580513bfc66a398eac.
Differential Revision: https://phab.mercurial-scm.org/D4259
debugcommands: urlerror only has a read() method in Python 2
Differential Revision: https://phab.mercurial-scm.org/D4258
debugcommands: get_method should always return a sysstr
Differential Revision: https://phab.mercurial-scm.org/D4257
stringutil: if we get a memoryview in escapestr, coerce it to bytes
Otherwise we get an exception. Sadly, this manifesting deep inside the
wireproto code, inside a future. For some reason the exception was
/causing a hang/ rather than actually propagating out, which seems
like it might merit some investigation in the future.
Differential Revision: https://phab.mercurial-scm.org/D4256