testlib: add `--raw-sha1` option to `f`
This will be used in the patch fixing the ignore hash collision in
dirstate-v2 to check the behavior of the new hashing function.
rust-status: save new dircache even if just invalidated
There was a functional race between invalidating the cache (not acted upon
until the end of the status algorithm) and populating the new cache (which
relies upon an up-to-date version of the cache).
We simply inform the cache populating function that we've just invalidated
the cache for this particular directory since the information is present in
the same scope.
upgrade: no longer keep all revlogs in memory at any point
Keeping all object open is unsustainable, so we will open them on demand. This
mean opening them multiple times, but this is a lesser evil.
Each revlog consume a small amount of memory (index content, associated nodemap,
etc). While there are few "big" revlog, the sheer amount of small filelog can
become a significant issue memory wise, consuming multiple GB of memory. If you
combines this extra usage with the use of multiprocessing, this usage can
quickly get out of control. This can effectively block the upgrade of larger
repository. This changeset fixes this issue.
demandimport: convert ignored modules from bytes -> str in extensions
The default list of ignored modules are str, and test for bypassing the lazy
import is `module.__name__ in ignores`, so these were effectively NOT ignored.
Most of these date back to the grand byteification in
687b865b95ad, with some
subsequent additions that followed the existing example.
I have no idea if these modules in fact need to bypass lazy importing, but at
least it follows the intent of the code.
dirstate-v2: fix edge case where entries aren't sorted
See previous commit for more details.
dirstate-v2: highlight a bug when Python-packed but used in `rhg`
The Python packer creates unsorted entries in the edge case that a file
starts with the same name as a sibling folder.
This bug has no effect on the Python `hg status` since Python ignores
directories. `rhg` assumes that all on-disk entries are sorted (which is
a property of the format) including folder, hence the issue highlighted.
This is also technically broken in Rust-augmented `hg status`, but it
makes setting up the test more complex than necessary, since it requires
the packing to be Python only (which it isn't if you have Rust extensions).
Fix is in the next commit.