comparison rust/hg-core/src/operations/cat.rs @ 47964:796206e74b10

rhg: Reuse manifest when checking status of multiple ambiguous files When `rhg status` cannot determine whether a file is clean based on mtime and size alone, it needs to compare its contents with those found in the parent commit. Previously, rhg would find the (same) manifest of that commit again for every such file. This is lifted out of the loop and reused. Differential Revision: https://phab.mercurial-scm.org/D11411
author Simon Sapin <simon.sapin@octobus.net>
date Mon, 13 Sep 2021 18:09:10 +0200
parents 4d2a5ca060e3
children 87e3f878e65f
comparison
equal deleted inserted replaced
47963:001d747c2baf 47964:796206e74b10
32 repo: &Repo, 32 repo: &Repo,
33 revset: &str, 33 revset: &str,
34 files: &'a [HgPathBuf], 34 files: &'a [HgPathBuf],
35 ) -> Result<CatOutput, RevlogError> { 35 ) -> Result<CatOutput, RevlogError> {
36 let rev = crate::revset::resolve_single(revset, repo)?; 36 let rev = crate::revset::resolve_single(revset, repo)?;
37 let manifest = repo.manifest(rev)?; 37 let manifest = repo.manifest_for_rev(rev)?;
38 let node = *repo 38 let node = *repo
39 .changelog()? 39 .changelog()?
40 .node_from_rev(rev) 40 .node_from_rev(rev)
41 .expect("should succeed when repo.manifest did"); 41 .expect("should succeed when repo.manifest did");
42 let mut bytes = vec![]; 42 let mut bytes = vec![];