This is an archive of the discontinued Mercurial Phabricator instance.

rhg: centralize index header parsing
ClosedPublic

Authored by aalekseyev on Dec 7 2021, 1:58 PM.

Details

Summary

Centralize index header parsing, parse the generaldelta flag,
and leave breadcrumbs to relate the code to python.

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

aalekseyev created this revision.Dec 7 2021, 1:58 PM
aalekseyev updated this revision to Diff 31366.Dec 7 2021, 2:04 PM
martinvonz requested changes to this revision.Dec 7 2021, 3:12 PM
martinvonz added a subscriber: martinvonz.
martinvonz added inline comments.
rust/hg-core/src/revlog/index.rs
410–411
error[E0425]: cannot find function `is_inline` in this scope
   --> hg-core/src/revlog/index.rs:390:20
    |
390 |         assert_eq!(is_inline(&bytes), false)
    |                    ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `is_inline` in this scope
   --> hg-core/src/revlog/index.rs:401:20
    |
401 |         assert_eq!(is_inline(&bytes), true)
    |                    ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `is_inline` in this scope
   --> hg-core/src/revlog/index.rs:412:20
    |
412 |         assert_eq!(is_inline(&bytes), true)
    |                    ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `get_version` in this scope
   --> hg-core/src/revlog/revlog.rs:414:20
    |
414 |         assert_eq!(get_version(&bytes).map_err(|_err| ()), Ok(1))
    |                    ^^^^^^^^^^^ not found in this scope
This revision now requires changes to proceed.Dec 7 2021, 3:12 PM
aalekseyev updated this revision to Diff 31392.Dec 8 2021, 6:40 AM
aalekseyev marked an inline comment as done.Dec 8 2021, 6:41 AM
aalekseyev added inline comments.
rust/hg-core/src/revlog/index.rs
410–411

Oh, missed those. Thanks!
Pushed a fix now.

Alphare accepted this revision.Dec 10 2021, 5:56 AM
aalekseyev marked an inline comment as done.Dec 10 2021, 6:10 AM
aalekseyev updated this revision to Diff 31404.
Alphare accepted this revision.Dec 13 2021, 6:35 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.