( )⚙ D12178 revlog: implement changelogv2 packing and unpacking in C

This is an archive of the discontinued Mercurial Phabricator instance.

revlog: implement changelogv2 packing and unpacking in C
ClosedPublic

Authored by pacien on Feb 14 2022, 1:06 PM.

Details

Summary

This introduces a C implementation of changelogv2 records packing and unpacking
operations matching the pure Python counterpart, similarly to what we already
have for revlogv1 and revlogv2.

This is also necessary to access changelogv2 record fields from future Rust
code without going through the Python part, which would annihilate any
performance benefit.

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

pacien created this revision.Feb 14 2022, 1:06 PM
Alphare added inline comments.
mercurial/cext/revlog.c
466

Maybe a small comment here saying that we need the base_rev and link_rev because they're declared but they're useless in clv2?

Alphare accepted this revision.Feb 15 2022, 9:38 AM

Amended manually to keep churn down

This revision is now accepted and ready to land.Feb 15 2022, 9:38 AM
This revision was automatically updated to reflect the committed changes.
Alphare added inline comments.Feb 15 2022, 11:35 AM
mercurial/cext/revlog.c
705

For posterity: this was missing putbe32(rank, data + entry_cl2_offset_rank); here