Skip to content

Commit

Permalink
revset: use op_store::View type to resolve branches()/remote_branches()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yuja committed Oct 14, 2023
1 parent 0160eae commit 3ec3cac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/src/revset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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)
})
Expand Down

0 comments on commit 3ec3cac

Please sign in to comment.