Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
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
7 changes: 4 additions & 3 deletions cli/src/commands/operation/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ pub async fn show_op_diff(
with_content_format: &LogContentFormat,
diff_renderer: Option<&DiffRenderer<'_>>,
) -> Result<(), CommandError> {
let changes = compute_operation_commits_diff(current_repo, from_repo, to_repo)?;
let changes = compute_operation_commits_diff(current_repo, from_repo, to_repo).await?;
if !changes.is_empty() {
let revset =
RevsetExpression::commits(changes.keys().cloned().collect()).evaluate(current_repo)?;
Expand Down Expand Up @@ -528,7 +528,7 @@ impl ModifiedChange {
/// Returns a map of [`ModifiedChange`]s containing the new and old commits. For
/// created/rewritten commits, the map entries are indexed by new ids. For
/// abandoned commits, the entries are indexed by old ids.
fn compute_operation_commits_diff(
async fn compute_operation_commits_diff(
repo: &dyn Repo,
from_repo: &ReadonlyRepo,
to_repo: &ReadonlyRepo,
Expand All @@ -542,7 +542,8 @@ fn compute_operation_commits_diff(
let predecessor_commits = accumulate_predecessors(
slice::from_ref(to_repo.operation()),
slice::from_ref(from_repo.operation()),
)?;
)
.await?;

// Collect hidden commits to find abandoned/rewritten changes.
let mut hidden_commits_by_change: HashMap<ChangeId, CommitId> = HashMap::new();
Expand Down
Loading