From acc6802b6cee61ec8134907a69d1e8321a089fed 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 context in [this discussion](https://github.com/martinvonz/jj/pull/3935#discussion_r1649520967) Fixes #3947 --- 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 d14466c5c8..1c0cdddd2c 100644 --- a/cli/src/movement_util.rs +++ b/cli/src/movement_util.rs @@ -109,16 +109,21 @@ impl Direction { args: &MovementArgsInternal, ) -> Result, CommandError> { let target_revset = match self { - Direction::Next => if args.conflict { - start_revset - .children() - .descendants() - .filtered(RevsetFilterPredicate::HasConflict) - .roots() - } else { - start_revset.descendants_at(args.offset) + Direction::Next => { + if args.conflict { + start_revset + .children() + .minus(working_revset) + .descendants() + .filtered(RevsetFilterPredicate::HasConflict) + .roots() + } else { + start_revset + .children() + .minus(working_revset) + .descendants_at(args.offset) + } } - .minus(working_revset), Direction::Prev => { if args.conflict {