manifest: use the same logic for handling flags in _parse as elsewhere
Differential Revision: https://phab.mercurial-scm.org/D8684
manifest: tigher manifest parsing and flag use
In the manifest line, flags are put directly after the hash, so the
parser has been guessing the presence of flags based on the length of
the hash. Replace this assumption by an enumeration of the valid flags
and removing them from the hash first as they are distinct input values.
Consistently handle the expected 256bit length of the SHA1-replacement
in the pure Python parser. Check that setting flags will use one of the
blessed values.
Extend write logic in the C version to handle 256bit hashes as well.
Verify that hashes always have exactly the expected length. Since
1070df141718 we should no longer depend on the old extra-byte hack.
Differential Revision: https://phab.mercurial-scm.org/D8679
phases: sparsify phase lists
When the internal and archived phase was added, allphase became a large,
sparsely populated list. This dramatically increased the number of
lookup operations for public relations in `phasecache.phase`. As a first
step, define allphases and related lists explicitly to contain only the
actual phases. Make phasenames a dictionary and create corresponding
dictionaries for mapping phase names back to numbers. Adjust various
list to be sparse as well with the exception of phaseroots and phasesets
members of phasecache. Keep those as a separate step as it involves
changes to the C module.
Differential Revision: https://phab.mercurial-scm.org/D8697