##// END OF EJS Templates
precheck: fix false warning about content-divergence creation...
precheck: fix false warning about content-divergence creation Before this patch, if we try to `hg prune` (without any successors) an already obsoleted cset which has at least one successor, it would false warn about new content-divergence. As we know, pruning cset without any successors can not create any divergence. Differential Revision: https://phab.mercurial-scm.org/D12002

File last commit:

r49373:f2f57724 default
r49848:d4752aeb stable
Show More
debugdata.rs
33 lines | 924 B | application/rls-services+xml | RustLexer
// 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.
use crate::repo::Repo;
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.
pub fn debug_data(
repo: &Repo,
revset: &str,
kind: DebugDataKind,
) -> Result<Vec<u8>, RevlogError> {
let index_file = match kind {
DebugDataKind::Changelog => "00changelog.i",
DebugDataKind::Manifest => "00manifest.i",
};
let revlog = Revlog::open(repo, index_file, None)?;
let rev =
crate::revset::resolve_rev_number_or_hex_prefix(revset, &revlog)?;
let data = revlog.get_rev_data(rev)?;
Ok(data.into_owned())
}