Mercurial > public > mercurial-scm > hg
comparison rust/hg-core/src/operations/debugdata.rs @ 52156:039b7caeb4d9
rust-revlog: introduce an `options` module
This helps group all the relevant revlog options code and makes the `mod.rs`
more readable.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Wed, 25 Sep 2024 18:24:15 +0200 |
parents | 69b804c8e09e |
children | bd8081e9fd62 |
comparison
equal
deleted
inserted
replaced
52155:426696af24d3 | 52156:039b7caeb4d9 |
---|---|
5 // This software may be used and distributed according to the terms of the | 5 // This software may be used and distributed according to the terms of the |
6 // GNU General Public License version 2 or any later version. | 6 // GNU General Public License version 2 or any later version. |
7 | 7 |
8 use crate::errors::HgError; | 8 use crate::errors::HgError; |
9 use crate::repo::Repo; | 9 use crate::repo::Repo; |
10 use crate::revlog::options::default_revlog_options; | |
10 use crate::revlog::Revlog; | 11 use crate::revlog::Revlog; |
11 use crate::{exit_codes, RevlogError, RevlogType}; | 12 use crate::{exit_codes, RevlogError, RevlogType}; |
12 | 13 |
13 /// Dump the contents data of a revision. | 14 /// Dump the contents data of a revision. |
14 pub fn debug_data( | 15 pub fn debug_data( |
29 }; | 30 }; |
30 let revlog = Revlog::open( | 31 let revlog = Revlog::open( |
31 &repo.store_vfs(), | 32 &repo.store_vfs(), |
32 index_file, | 33 index_file, |
33 None, | 34 None, |
34 repo.default_revlog_options(RevlogType::Changelog)?, | 35 default_revlog_options( |
36 repo.config(), | |
37 repo.requirements(), | |
38 RevlogType::Changelog, | |
39 )?, | |
35 )?; | 40 )?; |
36 let rev = | 41 let rev = |
37 crate::revset::resolve_rev_number_or_hex_prefix(revset, &revlog)?; | 42 crate::revset::resolve_rev_number_or_hex_prefix(revset, &revlog)?; |
38 let data = revlog.get_rev_data_for_checked_rev(rev)?; | 43 let data = revlog.get_rev_data_for_checked_rev(rev)?; |
39 Ok(data.into_owned()) | 44 Ok(data.into_owned()) |