##// END OF EJS Templates
doc: use an absolute path in sys.path...
doc: use an absolute path in sys.path The idea and rationale is similar to https://phab.mercurial-scm.org/D12599 (landed as 1b6e381521c5). Differential Revision: https://phab.mercurial-scm.org/D12622

File last commit:

r49980:399439c1 default
r50100:45e71954 stable
Show More
debugdata.rs
33 lines | 924 B | 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;
Antoine Cezar
hg-core: define a `DebugData` `Operation`...
r46098 use crate::revlog::revlog::{Revlog, RevlogError};
/// 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 };
Simon Sapin
rust: introduce Repo and Vfs types for filesystem abstraction...
r46782 let revlog = Revlog::open(repo, index_file, None)?;
Simon Sapin
rhg: centralize parsing of `--rev` CLI arguments...
r47162 let rev =
crate::revset::resolve_rev_number_or_hex_prefix(revset, &revlog)?;
let data = revlog.get_rev_data(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 }