diff --git a/cli/src/movement_util.rs b/cli/src/movement_util.rs index 63b7eb904c..e1faaf35cd 100644 --- a/cli/src/movement_util.rs +++ b/cli/src/movement_util.rs @@ -88,16 +88,21 @@ impl Direction { change_offset: u64, ) -> Result, CommandError> { let target_revset = match self { - Direction::Next => if has_conflict { - start_revset - .children() - .descendants() - .filtered(RevsetFilterPredicate::HasConflict) - .roots() - } else { - start_revset.descendants_at(change_offset) + Direction::Next => { + if has_conflict { + start_revset + .children() + .minus(working_revset) + .descendants() + .filtered(RevsetFilterPredicate::HasConflict) + .roots() + } else { + start_revset + .children() + .minus(working_revset) + .descendants_at(change_offset) + } } - .minus(working_revset), Direction::Prev => { if has_conflict {