Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
dag_walk: convert topo_order_* functions to async
  • Loading branch information
bnjmnt4n committed Mar 7, 2026
commit 4ee5cd4963a75c3f5fbf9df72ecdca3715988a70
7 changes: 5 additions & 2 deletions cli/src/commands/arrange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use jj_lib::repo::MutableRepo;
use jj_lib::repo::Repo as _;
use jj_lib::revset::RevsetIteratorExt as _;
use jj_lib::rewrite::CommitRewriter;
use pollster::FutureExt as _;
use ratatui::Terminal;
use ratatui::layout::Constraint;
use ratatui::layout::Direction;
Expand Down Expand Up @@ -233,7 +234,7 @@ impl State {
let commit_ids: Vec<&CommitId> = dag_walk::topo_order_reverse(
self.head_order.iter(),
|id| *id,
|id| {
async |id| {
self.parents
.get(id)
.unwrap()
Expand All @@ -242,6 +243,7 @@ impl State {
},
|_| panic!("cycle detected"),
)
.block_on()
.unwrap();
self.current_order = commit_ids.into_iter().cloned().collect();
}
Expand Down Expand Up @@ -348,7 +350,7 @@ impl RewritePlan {
let ordered_commit_ids = dag_walk::topo_order_forward(
self.rewrites.keys().cloned(),
|id| id.clone(),
|id| {
async |id| {
self.rewrites
.get(id)
.unwrap()
Expand All @@ -359,6 +361,7 @@ impl RewritePlan {
},
|_| panic!("cycle detected"),
)
.await
.unwrap();
// Rewrite the commits in the order determined above
let mut rewritten_commits: HashMap<CommitId, Commit> = HashMap::new();
Expand Down
Loading