forked from mirrors/jj
repo: rewrite "all()" query to clarify data dependency
This commit is contained in:
parent
b079897a56
commit
c0c5e8f041
1 changed files with 3 additions and 6 deletions
|
@ -244,13 +244,10 @@ impl ReadonlyRepo {
|
||||||
|
|
||||||
fn change_id_index(&self) -> &IdIndex {
|
fn change_id_index(&self) -> &IdIndex {
|
||||||
self.change_id_index.get_or_init(|| {
|
self.change_id_index.get_or_init(|| {
|
||||||
let all_visible_revisions = crate::revset::RevsetExpression::all()
|
let heads = self.view().heads().iter().cloned().collect_vec();
|
||||||
.evaluate(self.as_repo_ref(), None)
|
let walk = self.index().walk_revs(&heads, &[]);
|
||||||
.unwrap();
|
|
||||||
IdIndex::from_vec(
|
IdIndex::from_vec(
|
||||||
all_visible_revisions
|
walk.map(|entry| (entry.change_id().to_bytes(), ()))
|
||||||
.iter()
|
|
||||||
.map(|entry| (entry.change_id().to_bytes(), ()))
|
|
||||||
.collect(),
|
.collect(),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue