-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
revset: implement a "reachable()" expression #3691
Conversation
04ec060
to
0d3e0bc
Compare
8e07567
to
2e70c4e
Compare
Per Discord chat I've renamed the function from 'subgraph' -> 'reachable' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
2e70c4e
to
77840bb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if reachable_within()
is preferred over reachable()
, but I agree it's more descriptive.
Here's one (weak) vote for just |
77840bb
to
ac0d7b2
Compare
This revset correctly implements "reachability" from a set of source commits following both parent and child edges as far as they can go within a domain set. This type of 'bfs' query is currently impossible to express with existing revset functions.
ac0d7b2
to
704d038
Compare
I couldn't see a way to make this work without eager evaluation so I implemented a basic UnionFind algorithm for it.
Checklist
If applicable:
CHANGELOG.md