5 use crate::dirstate_tree::owning::OwningDirstateMap; |
5 use crate::dirstate_tree::owning::OwningDirstateMap; |
6 use crate::errors::HgError; |
6 use crate::errors::HgError; |
7 use crate::errors::HgResultExt; |
7 use crate::errors::HgResultExt; |
8 use crate::manifest::{Manifest, Manifestlog}; |
8 use crate::manifest::{Manifest, Manifestlog}; |
9 use crate::requirements; |
9 use crate::requirements; |
|
10 use crate::revlog::filelog::Filelog; |
10 use crate::revlog::revlog::RevlogError; |
11 use crate::revlog::revlog::RevlogError; |
11 use crate::utils::files::get_path_from_bytes; |
12 use crate::utils::files::get_path_from_bytes; |
|
13 use crate::utils::hg_path::HgPath; |
12 use crate::utils::SliceExt; |
14 use crate::utils::SliceExt; |
13 use crate::vfs::{is_dir, is_file, Vfs}; |
15 use crate::vfs::{is_dir, is_file, Vfs}; |
14 use crate::{exit_codes, Node}; |
16 use crate::{exit_codes, Node}; |
15 use crate::{DirstateError, Revision}; |
17 use crate::{DirstateError, Revision}; |
16 use std::cell::{Cell, Ref, RefCell, RefMut}; |
18 use std::cell::{Cell, Ref, RefCell, RefMut}; |
344 let changelog_entry = changelog.get_rev(revision)?; |
346 let changelog_entry = changelog.get_rev(revision)?; |
345 let manifest_node = |
347 let manifest_node = |
346 Node::from_hex_for_repo(&changelog_entry.manifest_node()?)?; |
348 Node::from_hex_for_repo(&changelog_entry.manifest_node()?)?; |
347 manifest.get_node(manifest_node.into()) |
349 manifest.get_node(manifest_node.into()) |
348 } |
350 } |
|
351 |
|
352 pub fn filelog(&self, path: &HgPath) -> Result<Filelog, RevlogError> { |
|
353 Filelog::open(self, path) |
|
354 } |
349 } |
355 } |
350 |
356 |
351 /// Lazily-initialized component of `Repo` with interior mutability |
357 /// Lazily-initialized component of `Repo` with interior mutability |
352 /// |
358 /// |
353 /// This differs from `OnceCell` in that the value can still be "deinitialized" |
359 /// This differs from `OnceCell` in that the value can still be "deinitialized" |