##// END OF EJS Templates
branching: merge stable into default
branching: merge stable into default

File last commit:

r51870:1928b770 default
r52011:98910135 merge default
Show More
debugdata.rs
38 lines | 1.1 KiB | application/rls-services+xml | RustLexer
Antoine Cezar
hg-core: define a `DebugData` `Operation`...
r46098 // debugdata.rs
//
// Copyright 2020 Antoine Cezar <antoine.cezar@octobus.net>
//
// This software may be used and distributed according to the terms of the
// GNU General Public License version 2 or any later version.
Simon Sapin
rust: introduce Repo and Vfs types for filesystem abstraction...
r46782 use crate::repo::Repo;
Martin von Zweigbergk
rust-revlog: move check for nodemap requirement to caller...
r49978 use crate::requirements;
Raphaël Gomès
rust-clippy: merge "revlog" module definition and struct implementation...
r50832 use crate::revlog::{Revlog, RevlogError};
Antoine Cezar
hg-core: define a `DebugData` `Operation`...
r46098
/// Kind of data to debug
#[derive(Debug, Copy, Clone)]
pub enum DebugDataKind {
Changelog,
Manifest,
}
/// Dump the contents data of a revision.
Simon Sapin
rust: replace most "operation" structs with functions...
r46751 pub fn debug_data(
Simon Sapin
rust: introduce Repo and Vfs types for filesystem abstraction...
r46782 repo: &Repo,
Simon Sapin
rhg: centralize parsing of `--rev` CLI arguments...
r47162 revset: &str,
Antoine Cezar
hg-core: define a `DebugData` `Operation`...
r46098 kind: DebugDataKind,
Simon Sapin
rust: remove three enums that were identical to `RevlogError`...
r47166 ) -> Result<Vec<u8>, RevlogError> {
Simon Sapin
rust: replace most "operation" structs with functions...
r46751 let index_file = match kind {
Simon Sapin
rust: introduce Repo and Vfs types for filesystem abstraction...
r46782 DebugDataKind::Changelog => "00changelog.i",
DebugDataKind::Manifest => "00manifest.i",
Simon Sapin
rust: replace most "operation" structs with functions...
r46751 };
Martin von Zweigbergk
rust-revlog: move check for nodemap requirement to caller...
r49978 let use_nodemap = repo
.requirements()
.contains(requirements::NODEMAP_REQUIREMENT);
Martin von Zweigbergk
rust-revlog: make unaware of `Repo`...
r49980 let revlog =
Revlog::open(&repo.store_vfs(), index_file, None, use_nodemap)?;
Simon Sapin
rhg: centralize parsing of `--rev` CLI arguments...
r47162 let rev =
crate::revset::resolve_rev_number_or_hex_prefix(revset, &revlog)?;
Raphaël Gomès
rust: use the new `UncheckedRevision` everywhere applicable...
r51870 let data = revlog.get_rev_data_for_checked_rev(rev)?;
Simon Sapin
rhg: Add RevlogEntry::data that does delta resolution...
r49373 Ok(data.into_owned())
Antoine Cezar
hg-core: define a `DebugData` `Operation`...
r46098 }