The new code is a simple but effective way to detect this information. We might
be able to move it inside the various conditionnal above, but I want to focus
on simplicity until we have a full working stack.
It is worth noting that if we record the information in the ChangingFiles
object, it is not persisted yet. This will comes with later changesets.
Coming from a Rust development perspective, _stateextras would be a private method and you wouldn't be able to access it here.
I've seen a lot of "abstraction leakage" in the Python codebase, so I'm wondering if this is justified, as in "this is a temporary solution and will disappear in a few patches or "this would require a huge refactor otherwise", or even "this should be a public attribute".