The data file may not be shorter than its size given by the docket.
It may be longer, but additional data is ignored.
Details
Details
- Reviewers
 Alphare - Group Reviewers
 hg-reviewers - Commits
 - rHG48aec076b8fb: dirstate-v2: Enforce data size read from the docket file
 
Diff Detail
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
Comment Actions
Either I am missing something or we could so something much simpler here.
| mercurial/dirstatemap.py | ||
|---|---|---|
| 637–643 | Why dont' we simply ready docket.data_size data from disk ? instead of doing later filtering ?  | |
| mercurial/dirstatemap.py | ||
|---|---|---|
| 637–643 | Yeah that should work, I didn’t think of that. I went with doing the slicing on the Rust side because slicing a Python bytes object allocates a new one and copies. I don’t know how that will work when we use mmap. It’ll probably involve a memoryview?  | |
Why dont' we simply ready docket.data_size data from disk ? instead of doing later filtering ?