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

Yuya Nishihara yuya at tcha.org
Mon Aug 6 09:51:06 EDT 2018


# HG changeset patch
# User Yuya Nishihara <yuya at 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().

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()


More information about the Mercurial-devel mailing list