[PATCH 2 of 4 V3] revset: disable compat with legacy compat for internal revsets API (API)
Yuya Nishihara
yuya at tcha.org
Wed Apr 11 11:23:06 EDT 2018
On Wed, 11 Apr 2018 11:50:15 +0200, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld at octobus.net>
> # Date 1520412972 18000
> # Wed Mar 07 03:56:12 2018 -0500
> # Node ID 00090d394d4e0a7c2637f161493353530dcf739d
> # Parent 5c1a0d784a26d4e8659dcec80503c8764432a303
> # EXP-Topic noname
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 00090d394d4e
> revset: disable compat with legacy compat for internal revsets API (API)
>
> In theory, there should be no user input going directly to "repo.revs" and
> "repo.set" so we can adjust the behavior in all cases. Avoiding name lookup
> during revsets parsing provide important speedup when some namespaces are slow
> to load.
>
> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -832,7 +832,7 @@ class localrepository(object):
> that contains integer revisions.
> '''
> expr = revsetlang.formatspec(expr, *args)
> - m = revset.match(None, expr)
> + m = revset.match(None, expr, legacycompat=False)
> return m(self)
> -def matchany(ui, specs, repo=None, localalias=None):
> +def matchany(ui, specs, repo=None, localalias=None, legacycompat=True):
> """Create a matcher that will include any revisions matching one of the
> given specs
>
> @@ -2191,7 +2191,7 @@ def matchany(ui, specs, repo=None, local
> if not all(specs):
> raise error.ParseError(_("empty query"))
> lookup = None
> - if repo:
> + if repo and legacycompat:
> lookup = lookupfn(repo)
So legacycompat=False is identical to repo=None?
More information about the Mercurial-devel
mailing list