Mercurial > public > mercurial-scm > hg
comparison mercurial/fileset.py @ 38927:aebfc4c5c855
fileset: load core predicates directly to symbols dict
We no longer have any side effect in loadpredicate().
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 22 Jul 2018 11:21:43 +0900 |
parents | 41e04212261a |
children | 1db5ae4b0dda |
comparison
equal
deleted
inserted
replaced
38926:41e04212261a | 38927:aebfc4c5c855 |
---|---|
97 # with: | 97 # with: |
98 # mctx - current matchctx instance | 98 # mctx - current matchctx instance |
99 # x - argument in tree form | 99 # x - argument in tree form |
100 symbols = filesetlang.symbols | 100 symbols = filesetlang.symbols |
101 | 101 |
102 predicate = registrar.filesetpredicate() | 102 predicate = registrar.filesetpredicate(symbols) |
103 | 103 |
104 @predicate('modified()', callstatus=True, weight=_WEIGHT_STATUS) | 104 @predicate('modified()', callstatus=True, weight=_WEIGHT_STATUS) |
105 def modified(mctx, x): | 105 def modified(mctx, x): |
106 """File that is modified according to :hg:`status`. | 106 """File that is modified according to :hg:`status`. |
107 """ | 107 """ |
556 """Load fileset predicates from specified registrarobj | 556 """Load fileset predicates from specified registrarobj |
557 """ | 557 """ |
558 for name, func in registrarobj._table.iteritems(): | 558 for name, func in registrarobj._table.iteritems(): |
559 symbols[name] = func | 559 symbols[name] = func |
560 | 560 |
561 # load built-in predicates explicitly | |
562 loadpredicate(None, None, predicate) | |
563 | |
564 # tell hggettext to extract docstrings from these functions: | 561 # tell hggettext to extract docstrings from these functions: |
565 i18nfunctions = symbols.values() | 562 i18nfunctions = symbols.values() |