This is an archive of the discontinued Mercurial Phabricator instance.

revlog: implement fast_rank retrieval in C
ClosedPublic

Authored by pacien on Feb 21 2022, 12:13 PM.

Details

Summary

This will be useful in particular to avoid going through the Python interpreter
in native Rust functions.

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 21 2022, 12:13 PM
indygreg requested changes to this revision.Mar 1 2022, 8:04 PM
indygreg added a subscriber: indygreg.
indygreg added inline comments.
mercurial/cext/revlog.c
584–588

I _think_ our clang-format policy requires braces around if. I could be wrong. But, I personally prefer we always use if { to avoid bugs.

3280

This version (and its reference in the Python code I believe) needs to be incremented to 3 since a field was added to Revlog_CAPI.

This revision now requires changes to proceed.Mar 1 2022, 8:04 PM
Alphare added a subscriber: Alphare.Mar 2 2022, 4:32 AM
Alphare added inline comments.
mercurial/cext/revlog.c
584–588

It does not, but I agree that this is easily prone to bugs.

pacien updated this revision to Diff 32392.Mar 2 2022, 1:16 PM
pacien marked 3 inline comments as done.Mar 2 2022, 1:17 PM

Amended.

Alphare accepted this revision.Mar 3 2022, 6:02 AM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.