##// END OF EJS Templates
match: add optional warn argument...
Durham Goode -
r25214:08703b10 default
parent child Browse files
Show More
@@ -54,7 +54,7 b' def _kindpatsalwaysmatch(kindpats):'
54 54 class match(object):
55 55 def __init__(self, root, cwd, patterns, include=[], exclude=[],
56 56 default='glob', exact=False, auditor=None, ctx=None,
57 listsubrepos=False):
57 listsubrepos=False, warn=None):
58 58 """build an object to match a set of file patterns
59 59
60 60 arguments:
@@ -65,6 +65,7 b' class match(object):'
65 65 exclude - patterns to exclude (even if they are included)
66 66 default - if a pattern in patterns has no explicit type, assume this one
67 67 exact - patterns are actually filenames (include/exclude still apply)
68 warn - optional function used for printing warnings
68 69
69 70 a pattern is one of:
70 71 'glob:<glob>' - a glob relative to cwd
@@ -83,6 +84,7 b' class match(object):'
83 84 self._anypats = bool(include or exclude)
84 85 self._always = False
85 86 self._pathrestricted = bool(include or exclude or patterns)
87 self._warn = warn
86 88
87 89 matchfns = []
88 90 if include:
@@ -536,7 +538,9 b' def readpatternfile(filepath, warn):'
536 538 try:
537 539 syntax = syntaxes[s]
538 540 except KeyError:
539 warn(_("%s: ignoring invalid syntax '%s'\n") % (filepath, s))
541 if warn:
542 warn(_("%s: ignoring invalid syntax '%s'\n") %
543 (filepath, s))
540 544 continue
541 545
542 546 linesyntax = syntax
General Comments 0
You need to be logged in to leave comments. Login now