rust/hg-core/src/operations/debugdata.rs
changeset 49087 bfc117647c71
parent 48541 f2f57724d4eb
child 49089 399439c12223
equal deleted inserted replaced
49086:704e993e8ee9 49087:bfc117647c71
     4 //
     4 //
     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::repo::Repo;
     8 use crate::repo::Repo;
       
     9 use crate::requirements;
     9 use crate::revlog::revlog::{Revlog, RevlogError};
    10 use crate::revlog::revlog::{Revlog, RevlogError};
    10 
    11 
    11 /// Kind of data to debug
    12 /// Kind of data to debug
    12 #[derive(Debug, Copy, Clone)]
    13 #[derive(Debug, Copy, Clone)]
    13 pub enum DebugDataKind {
    14 pub enum DebugDataKind {
    23 ) -> Result<Vec<u8>, RevlogError> {
    24 ) -> Result<Vec<u8>, RevlogError> {
    24     let index_file = match kind {
    25     let index_file = match kind {
    25         DebugDataKind::Changelog => "00changelog.i",
    26         DebugDataKind::Changelog => "00changelog.i",
    26         DebugDataKind::Manifest => "00manifest.i",
    27         DebugDataKind::Manifest => "00manifest.i",
    27     };
    28     };
    28     let revlog = Revlog::open(repo, index_file, None)?;
    29     let use_nodemap = repo
       
    30         .requirements()
       
    31         .contains(requirements::NODEMAP_REQUIREMENT);
       
    32     let revlog = Revlog::open(repo, index_file, None, use_nodemap)?;
    29     let rev =
    33     let rev =
    30         crate::revset::resolve_rev_number_or_hex_prefix(revset, &revlog)?;
    34         crate::revset::resolve_rev_number_or_hex_prefix(revset, &revlog)?;
    31     let data = revlog.get_rev_data(rev)?;
    35     let data = revlog.get_rev_data(rev)?;
    32     Ok(data.into_owned())
    36     Ok(data.into_owned())
    33 }
    37 }