This is an archive of the discontinued Mercurial Phabricator instance.

rust-revset: add separate match logic for shortcuts
ClosedPublic

Authored by Alphare on Sep 10 2021, 6:10 PM.

Details

Summary

The next change will add a shortcut for the . revision.
One day we might start matching tip and others, so this is an easy refactor.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Alphare created this revision.Sep 10 2021, 6:10 PM

Those last two patches are pending CI refresh

Alphare retitled this revision from rust-revset: simplify match logic to rust-revset: add separate match logic for shortcuts.
Alphare updated this revision to Diff 30218.
SimonSapin accepted this revision.Sep 14 2021, 11:14 AM
martinvonz added inline comments.
rust/hg-core/src/revset.rs
32

This return looks unnecessary. Speaking of that, what do you think about running Clippy as part of the test suite?

Alphare added inline comments.Oct 1 2021, 3:32 AM
rust/hg-core/src/revset.rs
32

Ah yes, it became unnecessary indeed. I think clippy is nice most of the time, though sometimes it's overzealous, so we might need to decide which of its recommendations to ignore, but that shouldn't be too much of an issue.
@SimonSapin what do you think?

This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.