This is an archive of the discontinued Mercurial Phabricator instance.

rust-dirstatemap: add `set_clean` method
ClosedPublic

Authored by Alphare on Apr 6 2022, 10:11 AM.

Details

Summary

This is the new dirstate API that has already been moved to in Python.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Alphare created this revision.Apr 6 2022, 10:11 AM

looks overall good, but I have a small question.

rust/hg-core/src/dirstate_tree/dirstate_map.rs
783

Why can we have an empty closure here ?

Alphare added inline comments.Apr 8 2022, 8:22 AM
rust/hg-core/src/dirstate_tree/dirstate_map.rs
783

set_clean can't be called on a fully untracked node (because of the check in the public function), but could be theoretically be called on a removed file, which would change the tracked_descendants_count variable. It just happens that this does not happen in the code, so I probably forgot to check this.

I'll update this, thanks.

marmoute added inline comments.Apr 8 2022, 8:48 AM
rust/hg-core/src/dirstate_tree/dirstate_map.rs
783

If this cannot be called on a fully untracked node, it seems like we should not use a _or_insert method.

This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.
baymax updated this revision to Diff 32928.Apr 8 2022, 12:29 PM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

baymax updated this revision to Diff 33030.Apr 12 2022, 10:57 AM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

baymax updated this revision to Diff 33111.Apr 12 2022, 12:06 PM

✅ refresh by Heptapod after a successful CI run (🐙 💚)