This is an archive of the discontinued Mercurial Phabricator instance.

revset: pass repo when passing ui
ClosedPublic

Authored by indygreg on Jul 15 2017, 7:41 PM.

Details

Summary

The repo instance is currently only used to provide a changeset
lookup function as part of parsing revsets. I /think/ this allows
node fragments to resolve. I'm not sure why we wouldn't want this
to always "just work" if parsing a revset string.

Plus, an upcoming commit will introduce a new consumer that needs a
handle on the repo. So passing it more often will make that code
work more.

Passing a repo instance in all callers of revset.match* results in
a bunch of test changes. Notably, branch and tags caches get
populated as part of evaluating revsets. I'm not sure if this is
desirable. So this patch takes the conservative approach and only
passes the repo if we're passing a ui instance.

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

indygreg created this revision.Jul 15 2017, 7:41 PM
durin42 accepted this revision.Jul 17 2017, 4:22 PM
durin42 added a subscriber: durin42.

Taking this one, but going to punt on D98 per the "consider this an RFC" comment I saw.

This revision is now accepted and ready to land.Jul 17 2017, 4:22 PM
yuja added a subscriber: yuja.Jul 18 2017, 8:51 AM
yuja added inline comments.
mercurial/cmdutil.py
2479

Perhaps these two shouldn't pass ui nor repo. They evaluate
internal query.

Passing repo means to take any valid old-style revisions
ignoring the revset syntax.

This revision was automatically updated to reflect the committed changes.
martinvonz added inline comments.
mercurial/cmdutil.py
2479

Thanks, Yuja. This was fixed in flight by someone.