Skip to content
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

Merged
merged 2 commits into from
May 21, 2024
Merged

Conversation

torquestomp
Copy link
Contributor

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:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

CHANGELOG.md Outdated Show resolved Hide resolved
@torquestomp torquestomp force-pushed the dploch/subgraph branch 2 times, most recently from 8e07567 to 2e70c4e Compare May 15, 2024 23:03
@torquestomp torquestomp changed the title revset: implement a Subgraph expression revset: implement a "reachable()" expression May 15, 2024
@torquestomp
Copy link
Contributor Author

Per Discord chat I've renamed the function from 'subgraph' -> 'reachable'

Copy link
Contributor

@yuja yuja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

docs/revsets.md Outdated Show resolved Hide resolved
lib/tests/test_revset.rs Show resolved Hide resolved
lib/src/default_index/revset_engine.rs Outdated Show resolved Hide resolved
lib/src/default_index/revset_engine.rs Outdated Show resolved Hide resolved
lib/src/default_index/revset_engine.rs Outdated Show resolved Hide resolved
lib/src/default_index/revset_engine.rs Outdated Show resolved Hide resolved
lib/src/default_index/revset_engine.rs Outdated Show resolved Hide resolved
lib/src/revset.rs Outdated Show resolved Hide resolved
@torquestomp torquestomp changed the title revset: implement a "reachable()" expression revset: implement a "reachable_within()" expression May 16, 2024
Copy link
Contributor

@yuja yuja left a 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.

lib/src/union_find.rs Outdated Show resolved Hide resolved
lib/src/union_find.rs Outdated Show resolved Hide resolved
lib/src/union_find.rs Outdated Show resolved Hide resolved
lib/src/default_index/revset_engine.rs Outdated Show resolved Hide resolved
lib/src/default_index/revset_engine.rs Outdated Show resolved Hide resolved
lib/src/default_index/revset_engine.rs Outdated Show resolved Hide resolved
lib/src/default_index/revset_engine.rs Outdated Show resolved Hide resolved
@martinvonz
Copy link
Member

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 reachable() from me.

lib/src/union_find.rs Outdated Show resolved Hide resolved
@torquestomp torquestomp changed the title revset: implement a "reachable_within()" expression revset: implement a "reachable()" expression May 21, 2024
@torquestomp torquestomp enabled auto-merge (rebase) May 21, 2024 13:39
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.
@torquestomp torquestomp disabled auto-merge May 21, 2024 14:09
@torquestomp torquestomp enabled auto-merge (rebase) May 21, 2024 14:09
@torquestomp torquestomp merged commit a49da4a into main May 21, 2024
16 checks passed
@torquestomp torquestomp deleted the dploch/subgraph branch May 21, 2024 14:52
CHANGELOG.md Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants