mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-16 00:56:23 +00:00
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.
This commit is contained in:
parent
0160eaefd9
commit
3ec3cac90b
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue