This is an archive of the discontinued Mercurial Phabricator instance.

dirstate-tree: Maintain a counter of DirstateEntry’s and copy sources
ClosedPublic

Authored by SimonSapin on Apr 20 2021, 10:17 AM.

Details

Summary

This allows implementing len for DirstateMap and CopyMap efficiently,
without traversing the tree.

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

SimonSapin created this revision.Apr 20 2021, 10:17 AM
baymax updated this revision to Diff 27137.Apr 20 2021, 1:03 PM

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

Alphare accepted this revision.Apr 22 2021, 4:48 AM
Alphare added a subscriber: Alphare.
Alphare added inline comments.
rust/hg-core/src/dirstate_tree/dirstate_map.rs
125

I'd have used a dedicated enum, but this is fine for a private function.

This revision is now accepted and ready to land.Apr 22 2021, 4:48 AM
SimonSapin added inline comments.May 3 2021, 5:51 AM
rust/hg-core/src/dirstate_tree/dirstate_map.rs
125

Yeah, it’s not great, but a later refactor removes that parameter anyway (pushes its handling to callers).

I could potentially backport that change to simplify review, but it’s not trivial because there’s a number of other changesets in-between.