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