From 2cce1503a3539978c0c0faddb9fb8bda25ca2ae9 Mon Sep 17 00:00:00 2001 From: Essien Ita Essien <34972+essiene@users.noreply.github.com> Date: Fri, 16 Aug 2024 01:10:44 +0100 Subject: [PATCH] Fetch descendants more correctly. See: https://github.com/martinvonz/jj/pull/3935#discussion_r1649520967 --- cli/src/movement_util.rs | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/cli/src/movement_util.rs b/cli/src/movement_util.rs index 3ac715fee0..61c67fa351 100644 --- a/cli/src/movement_util.rs +++ b/cli/src/movement_util.rs @@ -72,16 +72,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 {