-
Notifications
You must be signed in to change notification settings - Fork 902
Description
Is your feature request related to a problem? Please describe.
Currently, we have a set of revset functions that work on ancestors, and a separate set of revset functions that work on descendants. We can think of these pairs of functions as being equivalent, just with the "descendants"-based functions acting on a graph with all edges reversed compared to the "ancestors"-based functions:
| Ancestors-based | Descendants-based |
|---|---|
ancestors(x, [depth]) |
descendants(x, [depth]) |
parents(x, [depth]) |
children(x, [depth]) |
heads(x) |
roots(x) |
fork_point(x) |
- |
merges() |
- |
It looks like we're missing "descendants"-based equivalents to fork_point() and merges().
Describe the solution you'd like
Add two new revset functions:
merge_point(x)- Equivalent toroots(x_1:: & x_2:: & ... & x_N::). Whereasfork_point(a | b)can be used to find where two branches forked from each other,merge_point(a | b)can be used to find where two branches merged together (if any such commit exists).forks()- Whereasmerges()returns commits with multiple parents,forks()returns commits with multiple children.
This naming also leads to the nice property that fork_point(x) always returns commits from forks(), while merge_point(x) always returns commits from merges().
Describe alternatives you've considered
These functions are likely less useful than their "ancestors"-based counterparts and also a bit more difficult to implement, so we could choose not to implement them.
We could also use different naming; forks() might be confused for the concept of a forked repository, but I'm not sure what a better name would be.