This is an archive of the discontinued Mercurial Phabricator instance.

localrepo: recognize trivial "null" queries in `anyrev`
ClosedPublic

Authored by marmoute on Nov 22 2019, 4:20 AM.

Details

Summary

Bypassing the revset logic for trivial "null" queries means we can avoid to
trigger the filtering logic in some cases.

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

marmoute created this revision.Nov 22 2019, 4:20 AM
indygreg accepted this revision.Nov 22 2019, 10:55 PM
This revision is now accepted and ready to land.Nov 22 2019, 10:55 PM
This revision was automatically updated to reflect the committed changes.
yuja added a subscriber: yuja.Nov 23 2019, 11:57 PM

+ if specs == [b'null']:
+ return revset.baseset([nullrev])

This breaks --config revsetalias.null=<whatever>. Nobody would care, but
I don't know why we're so hard to optimize -r null query.

In D7481#110524, @yuja wrote:

+ if specs == [b'null']:
+ return revset.baseset([nullrev])

This breaks --config revsetalias.null=<whatever>. Nobody would care, but
I don't know why we're so hard to optimize -r null query.

I woudl says that changing null (like changing .) is calling for troubles and I would not worries.

optimising null is a good intermediate steps on the path to optimizing .; it also seems a possibly common request for automation.