rust/hg-core/src/repo.rs
changeset 47989 4d2a5ca060e3
parent 47988 cfb6e6699b25
child 47991 001d747c2baf
--- a/rust/hg-core/src/repo.rs	Mon Sep 13 13:45:10 2021 +0200
+++ b/rust/hg-core/src/repo.rs	Mon Sep 13 15:42:39 2021 +0200
@@ -7,8 +7,10 @@
 use crate::errors::HgResultExt;
 use crate::manifest::{Manifest, Manifestlog};
 use crate::requirements;
+use crate::revlog::filelog::Filelog;
 use crate::revlog::revlog::RevlogError;
 use crate::utils::files::get_path_from_bytes;
+use crate::utils::hg_path::HgPath;
 use crate::utils::SliceExt;
 use crate::vfs::{is_dir, is_file, Vfs};
 use crate::{exit_codes, Node};
@@ -346,6 +348,10 @@
             Node::from_hex_for_repo(&changelog_entry.manifest_node()?)?;
         manifest.get_node(manifest_node.into())
     }
+
+    pub fn filelog(&self, path: &HgPath) -> Result<Filelog, RevlogError> {
+        Filelog::open(self, path)
+    }
 }
 
 /// Lazily-initialized component of `Repo` with interior mutability