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: parse file() argument as fileset expression #4073

Merged
merged 2 commits into from
Jul 16, 2024

Conversation

yuja
Copy link
Contributor

@yuja yuja commented Jul 12, 2024

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

yuja added 2 commits July 14, 2024 10:20
FWIW, this might be changed to non-error so that "file()" revset can be used
at server side.
Since fileset and revset languages are syntactically close, we can reparse
revset expression as a fileset. This might sound a bit scary, but helps
eliminate nested quoting like file("~glob:'*.rs'"). One oddity exists in alias
substitution, though. Another possible problem is that we'll need to add fake
operator parsing rules if we introduce incompatibility in fileset, or want to
embed revset expressions in a fileset.

Since "file(x, y)" is equivalent to "file(x|y)", the former will be deprecated.
I'll probably add a mechanism to collect warnings during parsing.
@yuja yuja force-pushed the push-sxskxmzrmwux branch from ad0064e to 579cfd3 Compare July 14, 2024 01:31
lib/src/revset.rs Show resolved Hide resolved
@yuja yuja merged commit a757fdd into jj-vcs:main Jul 16, 2024
17 checks passed
@yuja yuja deleted the push-sxskxmzrmwux branch July 16, 2024 01:18
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.

2 participants