equal
deleted
inserted
replaced
33 def files(self): |
33 def files(self): |
34 return self._files |
34 return self._files |
35 def anypats(self): |
35 def anypats(self): |
36 return self._anypats |
36 return self._anypats |
37 |
37 |
38 class always(_match): |
|
39 def __init__(self, root, cwd): |
|
40 _match.__init__(self, root, cwd, [], lambda f: True, False) |
|
41 |
|
42 class never(_match): |
|
43 def __init__(self, root, cwd): |
|
44 _match.__init__(self, root, cwd, [], lambda f: False, False) |
|
45 |
|
46 class exact(_match): |
|
47 def __init__(self, root, cwd, files): |
|
48 _match.__init__(self, root, cwd, files, self.exact, False) |
|
49 |
|
50 class match(_match): |
38 class match(_match): |
51 def __init__(self, root, cwd, patterns, include=[], exclude=[], |
39 def __init__(self, root, cwd, patterns, include=[], exclude=[], |
52 default='glob'): |
40 default='glob'): |
53 """build an object to match a set of file patterns |
41 """build an object to match a set of file patterns |
54 |
42 |
105 m = lambda f: not em(f) |
93 m = lambda f: not em(f) |
106 else: |
94 else: |
107 m = lambda f: True |
95 m = lambda f: True |
108 |
96 |
109 _match.__init__(self, root, cwd, roots, m, anypats) |
97 _match.__init__(self, root, cwd, roots, m, anypats) |
|
98 |
|
99 class exact(_match): |
|
100 def __init__(self, root, cwd, files): |
|
101 _match.__init__(self, root, cwd, files, self.exact, False) |
|
102 |
|
103 class always(match): |
|
104 def __init__(self, root, cwd): |
|
105 match.__init__(self, root, cwd, []) |
|
106 |
|
107 class never(exact): |
|
108 def __init__(self, root, cwd): |
|
109 exact.__init__(self, root, cwd, []) |
110 |
110 |
111 def patkind(pat): |
111 def patkind(pat): |
112 return _patsplit(pat, None)[0] |
112 return _patsplit(pat, None)[0] |
113 |
113 |
114 def _patsplit(pat, default): |
114 def _patsplit(pat, default): |