rust/hg-core/src/revlog/manifest.rs
changeset 50989 27e773aa607d
parent 50988 1928b770e3e7
child 51212 13f58ce70299
equal deleted inserted replaced
50988:1928b770e3e7 50989:27e773aa607d
     2 use crate::revlog::{Node, NodePrefix};
     2 use crate::revlog::{Node, NodePrefix};
     3 use crate::revlog::{Revlog, RevlogError};
     3 use crate::revlog::{Revlog, RevlogError};
     4 use crate::utils::hg_path::HgPath;
     4 use crate::utils::hg_path::HgPath;
     5 use crate::utils::SliceExt;
     5 use crate::utils::SliceExt;
     6 use crate::vfs::Vfs;
     6 use crate::vfs::Vfs;
     7 use crate::{Revision, UncheckedRevision};
     7 use crate::{Graph, GraphError, Revision, UncheckedRevision};
     8 
     8 
     9 /// A specialized `Revlog` to work with `manifest` data format.
     9 /// A specialized `Revlog` to work with `manifest` data format.
    10 pub struct Manifestlog {
    10 pub struct Manifestlog {
    11     /// The generic `revlog` format.
    11     /// The generic `revlog` format.
    12     revlog: Revlog,
    12     revlog: Revlog,
       
    13 }
       
    14 
       
    15 impl Graph for Manifestlog {
       
    16     fn parents(&self, rev: Revision) -> Result<[Revision; 2], GraphError> {
       
    17         self.revlog.parents(rev)
       
    18     }
    13 }
    19 }
    14 
    20 
    15 impl Manifestlog {
    21 impl Manifestlog {
    16     /// Open the `manifest` of a repository given by its root.
    22     /// Open the `manifest` of a repository given by its root.
    17     pub fn open(store_vfs: &Vfs, use_nodemap: bool) -> Result<Self, HgError> {
    23     pub fn open(store_vfs: &Vfs, use_nodemap: bool) -> Result<Self, HgError> {