comparison rust/rhg/src/commands/files.rs @ 52062:b7d99348ea36

rust-files: also return filenode and flags when listing a revision's files This is going to be useful when implementing parts of `update` and makes it so we don't have to fetch the manifest and each entry twice.
author Rapha?l Gom?s <rgomes@octobus.net>
date Mon, 30 Sep 2024 12:10:35 +0200
parents 788113f056d4
children 7c105b953ca4
comparison
equal deleted inserted replaced
52061:0ea323b7e3b1 52062:b7d99348ea36
88 }; 88 };
89 89
90 if let Some(rev) = rev { 90 if let Some(rev) = rev {
91 let files = list_rev_tracked_files(repo, rev, matcher) 91 let files = list_rev_tracked_files(repo, rev, matcher)
92 .map_err(|e| (e, rev.as_ref()))?; 92 .map_err(|e| (e, rev.as_ref()))?;
93 display_files(invocation.ui, repo, relative_paths, files.iter()) 93 display_files(
94 invocation.ui,
95 repo,
96 relative_paths,
97 files.iter().map::<Result<_, CommandError>, _>(|f| {
98 let (f, _, _) = f?;
99 Ok(f)
100 }),
101 )
94 } else { 102 } else {
95 // The dirstate always reflects the sparse narrowspec. 103 // The dirstate always reflects the sparse narrowspec.
96 let dirstate = repo.dirstate_map()?; 104 let dirstate = repo.dirstate_map()?;
97 let files_res: Result<Vec<_>, _> = 105 let files_res: Result<Vec<_>, _> =
98 filter_map_results(dirstate.iter(), |(path, entry)| { 106 filter_map_results(dirstate.iter(), |(path, entry)| {