Mercurial > public > mercurial-scm > hg-stable
diff rust/hg-core/src/revlog/manifest.rs @ 47985:d44740725b95
rust: Rename Manifest to Manifestlog, ManifestEntry to Manifest
This appears to match the terminology used in Python code
and on https://www.mercurial-scm.org/wiki/Manifest
Differential Revision: https://phab.mercurial-scm.org/D11404
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Mon, 13 Sep 2021 13:01:25 +0200 |
parents | 645ee7225fab |
children | 001d747c2baf |
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/manifest.rs Thu Sep 09 21:04:55 2021 +0200 +++ b/rust/hg-core/src/revlog/manifest.rs Mon Sep 13 13:01:25 2021 +0200 @@ -5,12 +5,12 @@ use crate::utils::hg_path::HgPath; /// A specialized `Revlog` to work with `manifest` data format. -pub struct Manifest { +pub struct Manifestlog { /// The generic `revlog` format. revlog: Revlog, } -impl Manifest { +impl Manifestlog { /// Open the `manifest` of a repository given by its root. pub fn open(repo: &Repo) -> Result<Self, RevlogError> { let revlog = Revlog::open(repo, "00manifest.i", None)?; @@ -18,31 +18,25 @@ } /// Return the `ManifestEntry` of a given node id. - pub fn get_node( - &self, - node: NodePrefix, - ) -> Result<ManifestEntry, RevlogError> { + pub fn get_node(&self, node: NodePrefix) -> Result<Manifest, RevlogError> { let rev = self.revlog.get_node_rev(node)?; self.get_rev(rev) } /// Return the `ManifestEntry` of a given node revision. - pub fn get_rev( - &self, - rev: Revision, - ) -> Result<ManifestEntry, RevlogError> { + pub fn get_rev(&self, rev: Revision) -> Result<Manifest, RevlogError> { let bytes = self.revlog.get_rev_data(rev)?; - Ok(ManifestEntry { bytes }) + Ok(Manifest { bytes }) } } -/// `Manifest` entry which knows how to interpret the `manifest` data bytes. +/// `Manifestlog` entry which knows how to interpret the `manifest` data bytes. #[derive(Debug)] -pub struct ManifestEntry { +pub struct Manifest { bytes: Vec<u8>, } -impl ManifestEntry { +impl Manifest { /// Return an iterator over the lines of the entry. pub fn lines(&self) -> impl Iterator<Item = &[u8]> { self.bytes