This is an archive of the discontinued Mercurial Phabricator instance.

pure-parsers: document index class constants

Authored by Alphare on Mar 4 2021, 3:31 AM.



This also adds the big endian prefix > to make the constants truly
platform-independent, even if no issue with this has been reported in the wild.

Diff Detail

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

Event Timeline

Alphare created this revision.Mar 4 2021, 3:31 AM
pulkit accepted this revision.Mar 4 2021, 3:57 AM
This revision is now accepted and ready to land.Mar 4 2021, 3:57 AM
SimonSapin added inline comments.

This description isn’t factually wrong, but wouldn’t it be a serious bug if the on-disk format ends up varying across different platforms?

SimonSapin added inline comments.Mar 4 2021, 6:22 AM

Correction: since index_format starts with >, it opts in both to big-endian and to "stardard sizes" so index_size is in fact platform-independent. See docs in

Maybe > should be added to the format string for big_int_size and int_size as well, just to be safe.

Alphare added inline comments.Mar 4 2021, 10:02 AM

Thanks for the catch, I'll add > to the other format strings

Alphare edited the summary of this revision. (Show Details)Mar 4 2021, 10:10 AM
Alphare updated this revision to Diff 26080.
pulkit accepted this revision.Mar 5 2021, 3:37 AM
This revision was automatically updated to reflect the committed changes.