Patchwork [2,of,2] fileset: load core predicates directly to symbols dict

login
register
mail settings
Submitter Yuya Nishihara
Date Aug. 6, 2018, 1:51 p.m.
Message ID <3027a1bfe1424ded9114.1533563466@mimosa>
Download mbox | patch
Permalink /patch/33331/
State New
Headers show

Comments

Yuya Nishihara - Aug. 6, 2018, 1:51 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1532226103 -32400
#      Sun Jul 22 11:21:43 2018 +0900
# Node ID 3027a1bfe1424ded9114da1061c455c40d2c4740
# Parent  cd4c0681c2a56a79aaa19d5ba48647e47b6e1161
fileset: load core predicates directly to symbols dict

We no longer have any side effect in loadpredicate().
Augie Fackler - Aug. 6, 2018, 8:55 p.m.
On Mon, Aug 06, 2018 at 10:51:06PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1532226103 -32400
> #      Sun Jul 22 11:21:43 2018 +0900
> # Node ID 3027a1bfe1424ded9114da1061c455c40d2c4740
> # Parent  cd4c0681c2a56a79aaa19d5ba48647e47b6e1161
> fileset: load core predicates directly to symbols dict

queued, thanks

Patch

diff --git a/mercurial/fileset.py b/mercurial/fileset.py
--- a/mercurial/fileset.py
+++ b/mercurial/fileset.py
@@ -99,7 +99,7 @@  def func(mctx, a, b):
 #  x - argument in tree form
 symbols = filesetlang.symbols
 
-predicate = registrar.filesetpredicate()
+predicate = registrar.filesetpredicate(symbols)
 
 @predicate('modified()', callstatus=True, weight=_WEIGHT_STATUS)
 def modified(mctx, x):
@@ -558,8 +558,5 @@  def loadpredicate(ui, extname, registrar
     for name, func in registrarobj._table.iteritems():
         symbols[name] = func
 
-# load built-in predicates explicitly
-loadpredicate(None, None, predicate)
-
 # tell hggettext to extract docstrings from these functions:
 i18nfunctions = symbols.values()