From 661c1e35f699704b8155fa9600d0d8c066c470a9 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 | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/cli/src/movement_util.rs b/cli/src/movement_util.rs index 59e35fa35c..8ba4e8d9d8 100644 --- a/cli/src/movement_util.rs +++ b/cli/src/movement_util.rs @@ -143,16 +143,20 @@ 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 + .descendants_at(args.offset) + .minus(working_revset) + } } - .minus(working_revset), Direction::Prev => { if args.conflict {