ok/jj
1
0
Fork 0
forked from mirrors/jj

repo: rewrite "all()" query to clarify data dependency

This commit is contained in:
Yuya Nishihara 2023-01-24 18:51:24 +09:00
parent b079897a56
commit c0c5e8f041

View file

@ -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(),
) )
}) })