Show More
@@ -375,6 +375,20 b' class nevermatcher(basematcher):' | |||
|
375 | 375 | def __repr__(self): |
|
376 | 376 | return r'<nevermatcher>' |
|
377 | 377 | |
|
378 | class predicatematcher(basematcher): | |
|
379 | """A matcher adapter for a simple boolean function""" | |
|
380 | ||
|
381 | def __init__(self, root, cwd, predfn, predrepr=None, badfn=None): | |
|
382 | super(predicatematcher, self).__init__(root, cwd, badfn) | |
|
383 | self.matchfn = predfn | |
|
384 | self._predrepr = predrepr | |
|
385 | ||
|
386 | @encoding.strmethod | |
|
387 | def __repr__(self): | |
|
388 | s = (stringutil.buildrepr(self._predrepr) | |
|
389 | or pycompat.byterepr(self.matchfn)) | |
|
390 | return '<predicatenmatcher pred=%s>' % s | |
|
391 | ||
|
378 | 392 | class patternmatcher(basematcher): |
|
379 | 393 | |
|
380 | 394 | def __init__(self, root, cwd, kindpats, ctx=None, listsubrepos=False, |
General Comments 0
You need to be logged in to leave comments.
Login now