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

cli: refactor single/default_single revset evaluation helpers #3413

Merged
merged 7 commits into from
Apr 2, 2024

Conversation

yuja
Copy link
Contributor

@yuja yuja commented Apr 1, 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 7 commits April 2, 2024 10:57
This function isn't small, so let's split up into two parts. The extracted
function is the part which depends on the commit summary template.
…l_prefix()

I'm going to reorganize "single"/"default_single" revset functions in a way
that resolve_single_rev_with_hint_about_all_prefix() is inlined.
evaluate_revset_to_single_commit() could be a private method of
WorkspaceCommandHelper, but I want to minimize the code that has to be hosted
there.
…nd helper

resolve_revset_default_single() will be inlined instead. Since "default_single"
evaluation can return multiple revisions, the CLI interface usually accepts
multiple arguments. This suggests that there would be no external callers of
the singular resolve_revset_default_single().
…refix()

Yet another step towards inlining resolve_revset_default_single(). I'll
reimplement parse_revset_with_all_prefix() later to be pest-based.
Since "all:" implies that the user doesn't care about the order of the
revisions within that argument, it should be okay if two "all:" sets overlapped.
There's only one caller, and the implementation is straightforward.
@yuja yuja force-pushed the push-twutyzotulor branch from 24a0636 to b2e7cef Compare April 2, 2024 02:01
@yuja yuja merged commit a5abd98 into jj-vcs:main Apr 2, 2024
16 checks passed
@yuja yuja deleted the push-twutyzotulor branch April 2, 2024 06:17
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