[Updated] D11404: rust: Rename Manifest to Manifestlog, ManifestEntry to Manifest
SimonSapin
phabricator at mercurial-scm.org
Tue Sep 14 08:19:54 UTC 2021
Closed by commit rHGd44740725b95: rust: Rename Manifest to Manifestlog, ManifestEntry to Manifest (authored by SimonSapin).
This revision was automatically updated to reflect the committed changes.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D11404?vs=30222&id=30232
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D11404/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D11404
AFFECTED FILES
rust/hg-core/src/operations/cat.rs
rust/hg-core/src/operations/list_tracked_files.rs
rust/hg-core/src/revlog/manifest.rs
CHANGE DETAILS
diff --git a/rust/hg-core/src/revlog/manifest.rs b/rust/hg-core/src/revlog/manifest.rs
--- a/rust/hg-core/src/revlog/manifest.rs
+++ b/rust/hg-core/src/revlog/manifest.rs
@@ -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
diff --git a/rust/hg-core/src/operations/list_tracked_files.rs b/rust/hg-core/src/operations/list_tracked_files.rs
--- a/rust/hg-core/src/operations/list_tracked_files.rs
+++ b/rust/hg-core/src/operations/list_tracked_files.rs
@@ -10,7 +10,7 @@
use crate::errors::HgError;
use crate::repo::Repo;
use crate::revlog::changelog::Changelog;
-use crate::revlog::manifest::{Manifest, ManifestEntry};
+use crate::revlog::manifest::{Manifest, Manifestlog};
use crate::revlog::node::Node;
use crate::revlog::revlog::RevlogError;
use crate::utils::hg_path::HgPath;
@@ -73,7 +73,7 @@
) -> Result<FilesForRev, RevlogError> {
let rev = crate::revset::resolve_single(revset, repo)?;
let changelog = Changelog::open(repo)?;
- let manifest = Manifest::open(repo)?;
+ let manifest = Manifestlog::open(repo)?;
let changelog_entry = changelog.get_rev(rev)?;
let manifest_node =
Node::from_hex_for_repo(&changelog_entry.manifest_node()?)?;
@@ -81,7 +81,7 @@
Ok(FilesForRev(manifest_entry))
}
-pub struct FilesForRev(ManifestEntry);
+pub struct FilesForRev(Manifest);
impl FilesForRev {
pub fn iter(&self) -> impl Iterator<Item = &HgPath> {
diff --git a/rust/hg-core/src/operations/cat.rs b/rust/hg-core/src/operations/cat.rs
--- a/rust/hg-core/src/operations/cat.rs
+++ b/rust/hg-core/src/operations/cat.rs
@@ -9,7 +9,7 @@
use crate::repo::Repo;
use crate::revlog::changelog::Changelog;
-use crate::revlog::manifest::Manifest;
+use crate::revlog::manifest::Manifestlog;
use crate::revlog::path_encode::path_encode;
use crate::revlog::revlog::Revlog;
use crate::revlog::revlog::RevlogError;
@@ -43,7 +43,7 @@
) -> Result<CatOutput, RevlogError> {
let rev = crate::revset::resolve_single(revset, repo)?;
let changelog = Changelog::open(repo)?;
- let manifest = Manifest::open(repo)?;
+ let manifest = Manifestlog::open(repo)?;
let changelog_entry = changelog.get_rev(rev)?;
let node = *changelog
.node_from_rev(rev)
To: SimonSapin, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210914/868e817b/attachment-0002.html>
More information about the Mercurial-patches
mailing list