This is an archive of the discontinued Mercurial Phabricator instance.

rust: Add a Filelog struct that wraps Revlog
ClosedPublic

Authored by SimonSapin on Sep 13 2021, 2:13 PM.

Details

Summary

Some filelog-specific logic is moved from code rhg cat into this struct
where it can better be reused.

Additionally, a missing end delimiter for metadata causes an error
to be returned instead of being silently ignored.

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

SimonSapin created this revision.Sep 13 2021, 2:13 PM
Alphare accepted this revision.Sep 13 2021, 4:26 PM
Alphare added a subscriber: Alphare.
Alphare added inline comments.
rust/hg-core/src/revlog/filelog.rs
40

The more I look at get_rev the more it feels confusing to me. I'm saying this for all revlogs: having a get_rev(rev) feels weird, maybe it should be get_entry(rev) or something. This would be for another patch, of course, but I thought I'd discuss it

This revision is now accepted and ready to land.Sep 13 2021, 4:26 PM
SimonSapin added inline comments.Sep 13 2021, 4:36 PM
rust/hg-core/src/revlog/filelog.rs
40

How about get_by_rev and get_by_node? But yes, for another patch

Alphare added inline comments.Sep 14 2021, 3:47 AM
rust/hg-core/src/revlog/filelog.rs
40

Sounds good to me.

This revision was automatically updated to reflect the committed changes.