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.
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHGe83327af26f1: pure-parsers: document index class constants
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
mercurial/pure/parsers.py | ||
---|---|---|
48–49 | 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? |
mercurial/pure/parsers.py | ||
---|---|---|
48–49 | 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 https://docs.python.org/3/library/struct.html#format-characters Maybe > should be added to the format string for big_int_size and int_size as well, just to be safe. |
mercurial/pure/parsers.py | ||
---|---|---|
48–49 | Thanks for the catch, I'll add > to the other format strings |
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?