Show More
@@ -108,6 +108,9 b' class revsetpredicate(_funcregistrarbase' | |||
|
108 | 108 | Optional argument 'safe' indicates whether a predicate is safe for |
|
109 | 109 | DoS attack (False by default). |
|
110 | 110 | |
|
111 | Optional argument 'takeorder' indicates whether a predicate function | |
|
112 | takes ordering policy as the last argument. | |
|
113 | ||
|
111 | 114 | 'revsetpredicate' instance in example above can be used to |
|
112 | 115 | decorate multiple functions. |
|
113 | 116 | |
@@ -120,8 +123,9 b' class revsetpredicate(_funcregistrarbase' | |||
|
120 | 123 | _getname = _funcregistrarbase._parsefuncdecl |
|
121 | 124 | _docformat = "``%s``\n %s" |
|
122 | 125 | |
|
123 | def _extrasetup(self, name, func, safe=False): | |
|
126 | def _extrasetup(self, name, func, safe=False, takeorder=False): | |
|
124 | 127 | func._safe = safe |
|
128 | func._takeorder = takeorder | |
|
125 | 129 | |
|
126 | 130 | class filesetpredicate(_funcregistrarbase): |
|
127 | 131 | """Decorator to register fileset predicate |
@@ -422,7 +422,10 b' def keyvaluepair(repo, subset, k, v):' | |||
|
422 | 422 | def func(repo, subset, a, b, order): |
|
423 | 423 | f = getsymbol(a) |
|
424 | 424 | if f in symbols: |
|
425 |
|
|
|
425 | fn = symbols[f] | |
|
426 | if getattr(fn, '_takeorder', False): | |
|
427 | return fn(repo, subset, b, order) | |
|
428 | return fn(repo, subset, b) | |
|
426 | 429 | |
|
427 | 430 | keep = lambda fn: getattr(fn, '__doc__', None) is not None |
|
428 | 431 |
General Comments 0
You need to be logged in to leave comments.
Login now