# HG changeset patch # User Boris Feld <boris.f...@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 set(self, expr, *args): diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -2173,11 +2173,11 @@ def posttreebuilthook(tree, repo): def lookupfn(repo): return lambda symbol: scmutil.isrevsymbol(repo, symbol) -def match(ui, spec, repo=None): +def match(ui, spec, repo=None, legacycompat=True): """Create a matcher for a single revision spec""" - return matchany(ui, [spec], repo=repo) + return matchany(ui, [spec], repo=repo, legacycompat=legacycompat) -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) if len(specs) == 1: tree = revsetlang.parse(specs[0], lookup) _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel