From c3a41e2e9eef0416943c70b61bcc36a1748d3aa7 Mon Sep 17 00:00:00 2001 From: Philip Metzger Date: Sun, 18 Feb 2024 18:57:55 +0100 Subject: [PATCH] lib: Add `RevsetExpression::conflicts()`. This expression finds the first conflict in the passed range. See the next commit modifying `next` and `prev` for its usage. --- lib/src/revset.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/src/revset.rs b/lib/src/revset.rs index 1b34b010ab..9f0b158e49 100644 --- a/lib/src/revset.rs +++ b/lib/src/revset.rs @@ -533,6 +533,13 @@ impl RevsetExpression { }) } + /// Find any conflicts in `self`. + pub fn conflicts(self: &Rc) -> Rc { + self.intersection(&RevsetExpression::filter( + RevsetFilterPredicate::HasConflict, + )) + .clone() + } /// Commits that are descendants of `self` and ancestors of `heads`, both /// inclusive. pub fn dag_range_to(