Mercurial > public > mercurial-scm > hg-stable
view rust/hg-core/src/operations/debugdata.rs @ 48605:a809f1465a76
filemerge: set default labels a little earlier
By setting the default labels a little earlier, we can rely on them
always being set, as far as I can tell. It may actually even be fine
to rely on that even if we don't set them earlier, but it makes more
sense to me to do it.
Differential Revision: https://phab.mercurial-scm.org/D12015
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 20 Jan 2022 13:43:43 -0800 |
parents | f2f57724d4eb |
children | bfc117647c71 |
line wrap: on
line source
// 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()) }