Mercurial > hg
comparison mercurial/fileset.py @ 28447:4eb5496c2bd4
registrar: add filesetpredicate to mark a function as fileset predicate
filesetpredicate is used to replace fileset.predicate in subsequent
patch.
This patch also adds loadpredicate() to fileset, because this
combination helps to figure out how the name of "status caller" (or
"existing caller") predicate is put into _statuscallers (or
_existingcallers).
Listing up loadpredicate() in dispatch.extraloaders causes implicit
loading fileset predicate functions at loading (3rd party) extension.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Fri, 11 Mar 2016 04:14:54 +0900 |
parents | 4f8ced23345e |
children | 7108834c76a2 |
comparison
equal
deleted
inserted
replaced
28446:08bd09921102 | 28447:4eb5496c2bd4 |
---|---|
558 return getset(matchctx(ctx, subset, status), tree) | 558 return getset(matchctx(ctx, subset, status), tree) |
559 | 559 |
560 def prettyformat(tree): | 560 def prettyformat(tree): |
561 return parser.prettyformat(tree, ('string', 'symbol')) | 561 return parser.prettyformat(tree, ('string', 'symbol')) |
562 | 562 |
563 def loadpredicate(ui, extname, registrarobj): | |
564 """Load fileset predicates from specified registrarobj | |
565 """ | |
566 for name, func in registrarobj._table.iteritems(): | |
567 symbols[name] = func | |
568 if func._callstatus: | |
569 _statuscallers.add(name) | |
570 if func._callexisting: | |
571 _existingcallers.add(name) | |
572 | |
563 # tell hggettext to extract docstrings from these functions: | 573 # tell hggettext to extract docstrings from these functions: |
564 i18nfunctions = symbols.values() | 574 i18nfunctions = symbols.values() |