Show More
@@ -9,7 +9,7 b' use std::path::PathBuf;' | |||
|
9 | 9 | |
|
10 | 10 | use crate::repo::Repo; |
|
11 | 11 | use crate::revlog::changelog::Changelog; |
|
12 | use crate::revlog::manifest::Manifest; | |
|
12 | use crate::revlog::manifest::Manifestlog; | |
|
13 | 13 | use crate::revlog::path_encode::path_encode; |
|
14 | 14 | use crate::revlog::revlog::Revlog; |
|
15 | 15 | use crate::revlog::revlog::RevlogError; |
@@ -43,7 +43,7 b" pub fn cat<'a>(" | |||
|
43 | 43 | ) -> Result<CatOutput, RevlogError> { |
|
44 | 44 | let rev = crate::revset::resolve_single(revset, repo)?; |
|
45 | 45 | let changelog = Changelog::open(repo)?; |
|
46 | let manifest = Manifest::open(repo)?; | |
|
46 | let manifest = Manifestlog::open(repo)?; | |
|
47 | 47 | let changelog_entry = changelog.get_rev(rev)?; |
|
48 | 48 | let node = *changelog |
|
49 | 49 | .node_from_rev(rev) |
@@ -10,7 +10,7 b' use crate::dirstate_tree::on_disk::{for_' | |||
|
10 | 10 | use crate::errors::HgError; |
|
11 | 11 | use crate::repo::Repo; |
|
12 | 12 | use crate::revlog::changelog::Changelog; |
|
13 |
use crate::revlog::manifest::{Manifest, Manifest |
|
|
13 | use crate::revlog::manifest::{Manifest, Manifestlog}; | |
|
14 | 14 | use crate::revlog::node::Node; |
|
15 | 15 | use crate::revlog::revlog::RevlogError; |
|
16 | 16 | use crate::utils::hg_path::HgPath; |
@@ -73,7 +73,7 b' pub fn list_rev_tracked_files(' | |||
|
73 | 73 | ) -> Result<FilesForRev, RevlogError> { |
|
74 | 74 | let rev = crate::revset::resolve_single(revset, repo)?; |
|
75 | 75 | let changelog = Changelog::open(repo)?; |
|
76 | let manifest = Manifest::open(repo)?; | |
|
76 | let manifest = Manifestlog::open(repo)?; | |
|
77 | 77 | let changelog_entry = changelog.get_rev(rev)?; |
|
78 | 78 | let manifest_node = |
|
79 | 79 | Node::from_hex_for_repo(&changelog_entry.manifest_node()?)?; |
@@ -81,7 +81,7 b' pub fn list_rev_tracked_files(' | |||
|
81 | 81 | Ok(FilesForRev(manifest_entry)) |
|
82 | 82 | } |
|
83 | 83 | |
|
84 |
pub struct FilesForRev(Manifest |
|
|
84 | pub struct FilesForRev(Manifest); | |
|
85 | 85 | |
|
86 | 86 | impl FilesForRev { |
|
87 | 87 | pub fn iter(&self) -> impl Iterator<Item = &HgPath> { |
@@ -5,12 +5,12 b' use crate::revlog::Revision;' | |||
|
5 | 5 | use crate::utils::hg_path::HgPath; |
|
6 | 6 | |
|
7 | 7 | /// A specialized `Revlog` to work with `manifest` data format. |
|
8 | pub struct Manifest { | |
|
8 | pub struct Manifestlog { | |
|
9 | 9 | /// The generic `revlog` format. |
|
10 | 10 | revlog: Revlog, |
|
11 | 11 | } |
|
12 | 12 | |
|
13 | impl Manifest { | |
|
13 | impl Manifestlog { | |
|
14 | 14 | /// Open the `manifest` of a repository given by its root. |
|
15 | 15 | pub fn open(repo: &Repo) -> Result<Self, RevlogError> { |
|
16 | 16 | let revlog = Revlog::open(repo, "00manifest.i", None)?; |
@@ -18,31 +18,25 b' impl Manifest {' | |||
|
18 | 18 | } |
|
19 | 19 | |
|
20 | 20 | /// Return the `ManifestEntry` of a given node id. |
|
21 | pub fn get_node( | |
|
22 | &self, | |
|
23 | node: NodePrefix, | |
|
24 | ) -> Result<ManifestEntry, RevlogError> { | |
|
21 | pub fn get_node(&self, node: NodePrefix) -> Result<Manifest, RevlogError> { | |
|
25 | 22 | let rev = self.revlog.get_node_rev(node)?; |
|
26 | 23 | self.get_rev(rev) |
|
27 | 24 | } |
|
28 | 25 | |
|
29 | 26 | /// Return the `ManifestEntry` of a given node revision. |
|
30 | pub fn get_rev( | |
|
31 | &self, | |
|
32 | rev: Revision, | |
|
33 | ) -> Result<ManifestEntry, RevlogError> { | |
|
27 | pub fn get_rev(&self, rev: Revision) -> Result<Manifest, RevlogError> { | |
|
34 | 28 | let bytes = self.revlog.get_rev_data(rev)?; |
|
35 |
Ok(Manifest |
|
|
29 | Ok(Manifest { bytes }) | |
|
36 | 30 | } |
|
37 | 31 | } |
|
38 | 32 | |
|
39 | /// `Manifest` entry which knows how to interpret the `manifest` data bytes. | |
|
33 | /// `Manifestlog` entry which knows how to interpret the `manifest` data bytes. | |
|
40 | 34 | #[derive(Debug)] |
|
41 |
pub struct Manifest |
|
|
35 | pub struct Manifest { | |
|
42 | 36 | bytes: Vec<u8>, |
|
43 | 37 | } |
|
44 | 38 | |
|
45 |
impl Manifest |
|
|
39 | impl Manifest { | |
|
46 | 40 | /// Return an iterator over the lines of the entry. |
|
47 | 41 | pub fn lines(&self) -> impl Iterator<Item = &[u8]> { |
|
48 | 42 | self.bytes |
General Comments 0
You need to be logged in to leave comments.
Login now