Skip to content

Commit

Permalink
lib: Add RevsetExpression::conflicts().
Browse files Browse the repository at this point in the history
This expression finds the first conflict in the passed range. See the next commit
modifying `next` and `prev` for its usage.
  • Loading branch information
PhilipMetzger committed Mar 7, 2024
1 parent 663e352 commit c3a41e2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/src/revset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,13 @@ impl RevsetExpression {
})
}

/// Find any conflicts in `self`.
pub fn conflicts(self: &Rc<RevsetExpression>) -> Rc<RevsetExpression> {
self.intersection(&RevsetExpression::filter(
RevsetFilterPredicate::HasConflict,
))
.clone()
}
/// Commits that are descendants of `self` and ancestors of `heads`, both
/// inclusive.
pub fn dag_range_to(
Expand Down

0 comments on commit c3a41e2

Please sign in to comment.