From 3ec3cac90b5a932c0a27c81ad14efc21bfe280f5 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Sat, 7 Oct 2023 03:04:54 +0900 Subject: [PATCH] revset: use op_store::View type to resolve branches()/remote_branches() These functions depend heavily on the underlying data structure, and I haven't decided abstract View API to access to per-remote data types. Let's use the underlying data type for now. --- lib/src/revset.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/revset.rs b/lib/src/revset.rs index 0b8b1569fe..15ff2ba30d 100644 --- a/lib/src/revset.rs +++ b/lib/src/revset.rs @@ -2190,8 +2190,8 @@ fn resolve_commit_ref( RevsetCommitRef::VisibleHeads => Ok(repo.view().heads().iter().cloned().collect_vec()), RevsetCommitRef::Root => Ok(vec![repo.store().root_commit_id().clone()]), RevsetCommitRef::Branches(pattern) => { - let view = repo.view(); - let commit_ids = filter_map_values_by_key_pattern(view.branches(), pattern) + let view_data = repo.view().store_view(); + let commit_ids = filter_map_values_by_key_pattern(&view_data.branches, pattern) .flat_map(|branch_target| branch_target.local_target.added_ids()) .cloned() .collect(); @@ -2201,8 +2201,8 @@ fn resolve_commit_ref( branch_pattern, remote_pattern, } => { - let view = repo.view(); - let commit_ids = filter_map_values_by_key_pattern(view.branches(), branch_pattern) + let view_data = repo.view().store_view(); + let commit_ids = filter_map_values_by_key_pattern(&view_data.branches, branch_pattern) .flat_map(|branch_target| { filter_map_values_by_key_pattern(&branch_target.remote_targets, remote_pattern) })