rust: use `entry.tracked()` directly
This is the new API
Differential Revision: https://phab.mercurial-scm.org/D12534
rust-hg-cpython: remove use of `EntryState`
Let's use the new API
Differential Revision: https://phab.mercurial-scm.org/D12533
rust-dirstatemap: use a checked sub instead of a potentially underflowing one
This was missed in
2593873cda0f
Differential Revision: https://phab.mercurial-scm.org/D12532
rust-dirstatemap: add simpler version of `get_node_mut`
This will help reduce code and footgun potential for simpler callers.
Differential Revision: https://phab.mercurial-scm.org/D12531
rust-dirstatemap: use `get_node_mut` instead or `get_or_insert_node`
This (along with the docstring), makes it more obvious that we're not expecting
to insert a node here. This is less prone to bugs in later refactorings.
Differential Revision: https://phab.mercurial-scm.org/D12530
rust-dirstatemap: add `each_ancestor` argument to `get_node_mut`
This forces the callers to think about if the counters in the ancestors
need to be adjusted.
Differential Revision: https://phab.mercurial-scm.org/D12529
rust-dirstatemap: add simpler method `get_or_insert_node` for the common case
All but one case use the exact same input for most arguments, this simplifies
code and reduces footgun potential.
Differential Revision: https://phab.mercurial-scm.org/D12528
rust-dirstatemap: inline the last `get_or_insert` call
The `get_or_insert` method was dangerous because it did not take the
`DirstateMap` counters into account. This particular instance does not need
to update the counters.
Differential Revision: https://phab.mercurial-scm.org/D12527
rust-dirstatemap: add `set_cached_mtime` helper method
This will help remove the `get_or_insert` method, which is dangerous because it
does not take the `DirstateMap` counters into account
Differential Revision: https://phab.mercurial-scm.org/D12526
rust-dirstatemap: add `clear_cached_mtime` helper method
This will help remove the `get_or_insert` method, which is dangerous because it
does not take the `DirstateMap` counters into account.
Differential Revision: https://phab.mercurial-scm.org/D12525