##// END OF EJS Templates
match: remove support for exact matching from main matcher class...
Martin von Zweigbergk -
r32500:369c2d5e default
parent child Browse files
Show More
@@ -146,17 +146,17 b' def match(root, cwd, patterns, include=N'
146 146 m = exactmatcher(root, cwd, patterns, badfn)
147 147 else:
148 148 m = matcher(root, cwd, normalize, patterns, include=None,
149 default=default, exact=exact, auditor=auditor, ctx=ctx,
149 default=default, auditor=auditor, ctx=ctx,
150 150 listsubrepos=listsubrepos, warn=warn, badfn=badfn)
151 151 if include:
152 152 im = matcher(root, cwd, normalize, [], include=include, default=default,
153 exact=False, auditor=auditor, ctx=ctx,
154 listsubrepos=listsubrepos, warn=warn, badfn=None)
153 auditor=auditor, ctx=ctx, listsubrepos=listsubrepos,
154 warn=warn, badfn=None)
155 155 m = intersectmatchers(m, im)
156 156 if exclude:
157 157 em = matcher(root, cwd, normalize, [], include=exclude, default=default,
158 exact=False, auditor=auditor, ctx=ctx,
159 listsubrepos=listsubrepos, warn=warn, badfn=None)
158 auditor=auditor, ctx=ctx, listsubrepos=listsubrepos,
159 warn=warn, badfn=None)
160 160 m = differencematcher(m, em)
161 161 return m
162 162
@@ -314,7 +314,7 b' class basematcher(object):'
314 314 class matcher(basematcher):
315 315
316 316 def __init__(self, root, cwd, normalize, patterns, include=None,
317 default='glob', exact=False, auditor=None, ctx=None,
317 default='glob', auditor=None, ctx=None,
318 318 listsubrepos=False, warn=None, badfn=None):
319 319 super(matcher, self).__init__(root, cwd, badfn,
320 320 relativeuipath=bool(include or patterns))
@@ -342,13 +342,7 b' class matcher(basematcher):'
342 342 self._includeroots.update(roots)
343 343 self._includedirs.update(dirs)
344 344 matchfns.append(im)
345 if exact:
346 if isinstance(patterns, list):
347 self._files = patterns
348 else:
349 self._files = list(patterns)
350 matchfns.append(self.exact)
351 elif patterns:
345 if patterns:
352 346 kindpats = normalize(patterns, default, root, cwd, auditor, warn)
353 347 if not _kindpatsalwaysmatch(kindpats):
354 348 self._files = _explicitfiles(kindpats)
@@ -402,12 +396,9 b' class matcher(basematcher):'
402 396 def always(self):
403 397 return self._always
404 398
405 def isexact(self):
406 return self.matchfn == self.exact
407
408 399 def __repr__(self):
409 return ('<matcher files=%r, patterns=%r, includes=%r>' %
410 (self._files, self.patternspat, self.includepat))
400 return ('<matcher patterns=%r, includes=%r>' %
401 (self.patternspat, self.includepat))
411 402
412 403 class exactmatcher(basematcher):
413 404 '''Matches the input files exactly. They are interpreted as paths, not
@@ -33,7 +33,7 b' test issue352'
33 33 [255]
34 34 $ echo foo > "$A"
35 35 $ hg debugwalk
36 matcher: <matcher files=[], patterns=None, includes=None>
36 matcher: <matcher patterns=None, includes=None>
37 37 f he\r (no-eol) (esc)
38 38 llo he\r (no-eol) (esc)
39 39 llo
@@ -164,7 +164,7 b' Test relative ignore path (issue4473):'
164 164 A b.o
165 165
166 166 $ hg debugignore
167 <matcher files=[], patterns=None, includes='(?:(?:|.*/)[^/]*(?:/|$))'>
167 <matcher patterns=None, includes='(?:(?:|.*/)[^/]*(?:/|$))'>
168 168
169 169 $ hg debugignore b.o
170 170 b.o is ignored
@@ -29,7 +29,7 b''
29 29 $ hg commit -m "commit #0"
30 30
31 31 $ hg debugwalk
32 matcher: <matcher files=[], patterns=None, includes=None>
32 matcher: <matcher patterns=None, includes=None>
33 33 f beans/black beans/black
34 34 f beans/borlotti beans/borlotti
35 35 f beans/kidney beans/kidney
@@ -44,7 +44,7 b''
44 44 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
45 45 f mammals/skunk mammals/skunk
46 46 $ hg debugwalk -I.
47 matcher: <matcher files=[], patterns=None, includes='(?:)'>
47 matcher: <matcher patterns=None, includes='(?:)'>
48 48 f beans/black beans/black
49 49 f beans/borlotti beans/borlotti
50 50 f beans/kidney beans/kidney
@@ -61,7 +61,7 b''
61 61
62 62 $ cd mammals
63 63 $ hg debugwalk
64 matcher: <matcher files=[], patterns=None, includes=None>
64 matcher: <matcher patterns=None, includes=None>
65 65 f beans/black ../beans/black
66 66 f beans/borlotti ../beans/borlotti
67 67 f beans/kidney ../beans/kidney
@@ -76,7 +76,7 b''
76 76 f mammals/Procyonidae/raccoon Procyonidae/raccoon
77 77 f mammals/skunk skunk
78 78 $ hg debugwalk -X ../beans
79 matcher: <differencematcher m1=<matcher files=[], patterns=None, includes=None>, m2=<matcher files=[], patterns=None, includes='(?:beans(?:/|$))'>>
79 matcher: <differencematcher m1=<matcher patterns=None, includes=None>, m2=<matcher patterns=None, includes='(?:beans(?:/|$))'>>
80 80 f fennel ../fennel
81 81 f fenugreek ../fenugreek
82 82 f fiddlehead ../fiddlehead
@@ -85,31 +85,31 b''
85 85 f mammals/Procyonidae/raccoon Procyonidae/raccoon
86 86 f mammals/skunk skunk
87 87 $ hg debugwalk -I '*k'
88 matcher: <matcher files=[], patterns=None, includes='(?:mammals\\/[^/]*k(?:/|$))'>
88 matcher: <matcher patterns=None, includes='(?:mammals\\/[^/]*k(?:/|$))'>
89 89 f mammals/skunk skunk
90 90 $ hg debugwalk -I 'glob:*k'
91 matcher: <matcher files=[], patterns=None, includes='(?:mammals\\/[^/]*k(?:/|$))'>
91 matcher: <matcher patterns=None, includes='(?:mammals\\/[^/]*k(?:/|$))'>
92 92 f mammals/skunk skunk
93 93 $ hg debugwalk -I 'relglob:*k'
94 matcher: <matcher files=[], patterns=None, includes='(?:(?:|.*/)[^/]*k(?:/|$))'>
94 matcher: <matcher patterns=None, includes='(?:(?:|.*/)[^/]*k(?:/|$))'>
95 95 f beans/black ../beans/black
96 96 f fenugreek ../fenugreek
97 97 f mammals/skunk skunk
98 98 $ hg debugwalk -I 'relglob:*k' .
99 matcher: <intersectionmatcher m1=<matcher files=['mammals'], patterns='(?:mammals(?:/|$))', includes=None>, m2=<matcher files=[], patterns=None, includes='(?:(?:|.*/)[^/]*k(?:/|$))'>>
99 matcher: <intersectionmatcher m1=<matcher patterns='(?:mammals(?:/|$))', includes=None>, m2=<matcher patterns=None, includes='(?:(?:|.*/)[^/]*k(?:/|$))'>>
100 100 f mammals/skunk skunk
101 101 $ hg debugwalk -I 're:.*k$'
102 matcher: <matcher files=[], patterns=None, includes='(?:.*k$)'>
102 matcher: <matcher patterns=None, includes='(?:.*k$)'>
103 103 f beans/black ../beans/black
104 104 f fenugreek ../fenugreek
105 105 f mammals/skunk skunk
106 106 $ hg debugwalk -I 'relre:.*k$'
107 matcher: <matcher files=[], patterns=None, includes='(?:.*.*k$)'>
107 matcher: <matcher patterns=None, includes='(?:.*.*k$)'>
108 108 f beans/black ../beans/black
109 109 f fenugreek ../fenugreek
110 110 f mammals/skunk skunk
111 111 $ hg debugwalk -I 'path:beans'
112 matcher: <matcher files=[], patterns=None, includes='(?:^beans(?:/|$))'>
112 matcher: <matcher patterns=None, includes='(?:^beans(?:/|$))'>
113 113 f beans/black ../beans/black
114 114 f beans/borlotti ../beans/borlotti
115 115 f beans/kidney ../beans/kidney
@@ -117,7 +117,7 b''
117 117 f beans/pinto ../beans/pinto
118 118 f beans/turtle ../beans/turtle
119 119 $ hg debugwalk -I 'relpath:detour/../../beans'
120 matcher: <matcher files=[], patterns=None, includes='(?:beans(?:/|$))'>
120 matcher: <matcher patterns=None, includes='(?:beans(?:/|$))'>
121 121 f beans/black ../beans/black
122 122 f beans/borlotti ../beans/borlotti
123 123 f beans/kidney ../beans/kidney
@@ -126,27 +126,27 b''
126 126 f beans/turtle ../beans/turtle
127 127
128 128 $ hg debugwalk 'rootfilesin:'
129 matcher: <matcher files=[], patterns='(?:^[^/]+$)', includes=None>
129 matcher: <matcher patterns='(?:^[^/]+$)', includes=None>
130 130 f fennel ../fennel
131 131 f fenugreek ../fenugreek
132 132 f fiddlehead ../fiddlehead
133 133 $ hg debugwalk -I 'rootfilesin:'
134 matcher: <matcher files=[], patterns=None, includes='(?:^[^/]+$)'>
134 matcher: <matcher patterns=None, includes='(?:^[^/]+$)'>
135 135 f fennel ../fennel
136 136 f fenugreek ../fenugreek
137 137 f fiddlehead ../fiddlehead
138 138 $ hg debugwalk 'rootfilesin:.'
139 matcher: <matcher files=[], patterns='(?:^[^/]+$)', includes=None>
139 matcher: <matcher patterns='(?:^[^/]+$)', includes=None>
140 140 f fennel ../fennel
141 141 f fenugreek ../fenugreek
142 142 f fiddlehead ../fiddlehead
143 143 $ hg debugwalk -I 'rootfilesin:.'
144 matcher: <matcher files=[], patterns=None, includes='(?:^[^/]+$)'>
144 matcher: <matcher patterns=None, includes='(?:^[^/]+$)'>
145 145 f fennel ../fennel
146 146 f fenugreek ../fenugreek
147 147 f fiddlehead ../fiddlehead
148 148 $ hg debugwalk -X 'rootfilesin:'
149 matcher: <differencematcher m1=<matcher files=[], patterns=None, includes=None>, m2=<matcher files=[], patterns=None, includes='(?:^[^/]+$)'>>
149 matcher: <differencematcher m1=<matcher patterns=None, includes=None>, m2=<matcher patterns=None, includes='(?:^[^/]+$)'>>
150 150 f beans/black ../beans/black
151 151 f beans/borlotti ../beans/borlotti
152 152 f beans/kidney ../beans/kidney
@@ -158,15 +158,15 b''
158 158 f mammals/Procyonidae/raccoon Procyonidae/raccoon
159 159 f mammals/skunk skunk
160 160 $ hg debugwalk 'rootfilesin:fennel'
161 matcher: <matcher files=[], patterns='(?:^fennel/[^/]+$)', includes=None>
161 matcher: <matcher patterns='(?:^fennel/[^/]+$)', includes=None>
162 162 $ hg debugwalk -I 'rootfilesin:fennel'
163 matcher: <matcher files=[], patterns=None, includes='(?:^fennel/[^/]+$)'>
163 matcher: <matcher patterns=None, includes='(?:^fennel/[^/]+$)'>
164 164 $ hg debugwalk 'rootfilesin:skunk'
165 matcher: <matcher files=[], patterns='(?:^skunk/[^/]+$)', includes=None>
165 matcher: <matcher patterns='(?:^skunk/[^/]+$)', includes=None>
166 166 $ hg debugwalk -I 'rootfilesin:skunk'
167 matcher: <matcher files=[], patterns=None, includes='(?:^skunk/[^/]+$)'>
167 matcher: <matcher patterns=None, includes='(?:^skunk/[^/]+$)'>
168 168 $ hg debugwalk 'rootfilesin:beans'
169 matcher: <matcher files=[], patterns='(?:^beans/[^/]+$)', includes=None>
169 matcher: <matcher patterns='(?:^beans/[^/]+$)', includes=None>
170 170 f beans/black ../beans/black
171 171 f beans/borlotti ../beans/borlotti
172 172 f beans/kidney ../beans/kidney
@@ -174,7 +174,7 b''
174 174 f beans/pinto ../beans/pinto
175 175 f beans/turtle ../beans/turtle
176 176 $ hg debugwalk -I 'rootfilesin:beans'
177 matcher: <matcher files=[], patterns=None, includes='(?:^beans/[^/]+$)'>
177 matcher: <matcher patterns=None, includes='(?:^beans/[^/]+$)'>
178 178 f beans/black ../beans/black
179 179 f beans/borlotti ../beans/borlotti
180 180 f beans/kidney ../beans/kidney
@@ -182,19 +182,19 b''
182 182 f beans/pinto ../beans/pinto
183 183 f beans/turtle ../beans/turtle
184 184 $ hg debugwalk 'rootfilesin:mammals'
185 matcher: <matcher files=[], patterns='(?:^mammals/[^/]+$)', includes=None>
185 matcher: <matcher patterns='(?:^mammals/[^/]+$)', includes=None>
186 186 f mammals/skunk skunk
187 187 $ hg debugwalk -I 'rootfilesin:mammals'
188 matcher: <matcher files=[], patterns=None, includes='(?:^mammals/[^/]+$)'>
188 matcher: <matcher patterns=None, includes='(?:^mammals/[^/]+$)'>
189 189 f mammals/skunk skunk
190 190 $ hg debugwalk 'rootfilesin:mammals/'
191 matcher: <matcher files=[], patterns='(?:^mammals/[^/]+$)', includes=None>
191 matcher: <matcher patterns='(?:^mammals/[^/]+$)', includes=None>
192 192 f mammals/skunk skunk
193 193 $ hg debugwalk -I 'rootfilesin:mammals/'
194 matcher: <matcher files=[], patterns=None, includes='(?:^mammals/[^/]+$)'>
194 matcher: <matcher patterns=None, includes='(?:^mammals/[^/]+$)'>
195 195 f mammals/skunk skunk
196 196 $ hg debugwalk -X 'rootfilesin:mammals'
197 matcher: <differencematcher m1=<matcher files=[], patterns=None, includes=None>, m2=<matcher files=[], patterns=None, includes='(?:^mammals/[^/]+$)'>>
197 matcher: <differencematcher m1=<matcher patterns=None, includes=None>, m2=<matcher patterns=None, includes='(?:^mammals/[^/]+$)'>>
198 198 f beans/black ../beans/black
199 199 f beans/borlotti ../beans/borlotti
200 200 f beans/kidney ../beans/kidney
@@ -209,31 +209,31 b''
209 209 f mammals/Procyonidae/raccoon Procyonidae/raccoon
210 210
211 211 $ hg debugwalk .
212 matcher: <matcher files=['mammals'], patterns='(?:mammals(?:/|$))', includes=None>
212 matcher: <matcher patterns='(?:mammals(?:/|$))', includes=None>
213 213 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
214 214 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
215 215 f mammals/Procyonidae/raccoon Procyonidae/raccoon
216 216 f mammals/skunk skunk
217 217 $ hg debugwalk -I.
218 matcher: <matcher files=[], patterns=None, includes='(?:mammals(?:/|$))'>
218 matcher: <matcher patterns=None, includes='(?:mammals(?:/|$))'>
219 219 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
220 220 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
221 221 f mammals/Procyonidae/raccoon Procyonidae/raccoon
222 222 f mammals/skunk skunk
223 223 $ hg debugwalk Procyonidae
224 matcher: <matcher files=['mammals/Procyonidae'], patterns='(?:mammals\\/Procyonidae(?:/|$))', includes=None>
224 matcher: <matcher patterns='(?:mammals\\/Procyonidae(?:/|$))', includes=None>
225 225 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
226 226 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
227 227 f mammals/Procyonidae/raccoon Procyonidae/raccoon
228 228
229 229 $ cd Procyonidae
230 230 $ hg debugwalk .
231 matcher: <matcher files=['mammals/Procyonidae'], patterns='(?:mammals\\/Procyonidae(?:/|$))', includes=None>
231 matcher: <matcher patterns='(?:mammals\\/Procyonidae(?:/|$))', includes=None>
232 232 f mammals/Procyonidae/cacomistle cacomistle
233 233 f mammals/Procyonidae/coatimundi coatimundi
234 234 f mammals/Procyonidae/raccoon raccoon
235 235 $ hg debugwalk ..
236 matcher: <matcher files=['mammals'], patterns='(?:mammals(?:/|$))', includes=None>
236 matcher: <matcher patterns='(?:mammals(?:/|$))', includes=None>
237 237 f mammals/Procyonidae/cacomistle cacomistle
238 238 f mammals/Procyonidae/coatimundi coatimundi
239 239 f mammals/Procyonidae/raccoon raccoon
@@ -241,7 +241,7 b''
241 241 $ cd ..
242 242
243 243 $ hg debugwalk ../beans
244 matcher: <matcher files=['beans'], patterns='(?:beans(?:/|$))', includes=None>
244 matcher: <matcher patterns='(?:beans(?:/|$))', includes=None>
245 245 f beans/black ../beans/black
246 246 f beans/borlotti ../beans/borlotti
247 247 f beans/kidney ../beans/kidney
@@ -249,7 +249,7 b''
249 249 f beans/pinto ../beans/pinto
250 250 f beans/turtle ../beans/turtle
251 251 $ hg debugwalk .
252 matcher: <matcher files=['mammals'], patterns='(?:mammals(?:/|$))', includes=None>
252 matcher: <matcher patterns='(?:mammals(?:/|$))', includes=None>
253 253 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
254 254 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
255 255 f mammals/Procyonidae/raccoon Procyonidae/raccoon
@@ -263,7 +263,7 b''
263 263 $ cd ..
264 264
265 265 $ hg debugwalk -Ibeans
266 matcher: <matcher files=[], patterns=None, includes='(?:beans(?:/|$))'>
266 matcher: <matcher patterns=None, includes='(?:beans(?:/|$))'>
267 267 f beans/black beans/black
268 268 f beans/borlotti beans/borlotti
269 269 f beans/kidney beans/kidney
@@ -271,56 +271,56 b''
271 271 f beans/pinto beans/pinto
272 272 f beans/turtle beans/turtle
273 273 $ hg debugwalk -I '{*,{b,m}*/*}k'
274 matcher: <matcher files=[], patterns=None, includes='(?:(?:[^/]*|(?:b|m)[^/]*\\/[^/]*)k(?:/|$))'>
274 matcher: <matcher patterns=None, includes='(?:(?:[^/]*|(?:b|m)[^/]*\\/[^/]*)k(?:/|$))'>
275 275 f beans/black beans/black
276 276 f fenugreek fenugreek
277 277 f mammals/skunk mammals/skunk
278 278 $ hg debugwalk -Ibeans mammals
279 matcher: <intersectionmatcher m1=<matcher files=['mammals'], patterns='(?:mammals(?:/|$))', includes=None>, m2=<matcher files=[], patterns=None, includes='(?:beans(?:/|$))'>>
279 matcher: <intersectionmatcher m1=<matcher patterns='(?:mammals(?:/|$))', includes=None>, m2=<matcher patterns=None, includes='(?:beans(?:/|$))'>>
280 280 $ hg debugwalk -Inon-existent
281 matcher: <matcher files=[], patterns=None, includes='(?:non\\-existent(?:/|$))'>
281 matcher: <matcher patterns=None, includes='(?:non\\-existent(?:/|$))'>
282 282 $ hg debugwalk -Inon-existent -Ibeans/black
283 matcher: <matcher files=[], patterns=None, includes='(?:non\\-existent(?:/|$)|beans\\/black(?:/|$))'>
283 matcher: <matcher patterns=None, includes='(?:non\\-existent(?:/|$)|beans\\/black(?:/|$))'>
284 284 f beans/black beans/black
285 285 $ hg debugwalk -Ibeans beans/black
286 matcher: <intersectionmatcher m1=<matcher files=['beans/black'], patterns='(?:beans\\/black(?:/|$))', includes=None>, m2=<matcher files=[], patterns=None, includes='(?:beans(?:/|$))'>>
286 matcher: <intersectionmatcher m1=<matcher patterns='(?:beans\\/black(?:/|$))', includes=None>, m2=<matcher patterns=None, includes='(?:beans(?:/|$))'>>
287 287 f beans/black beans/black exact
288 288 $ hg debugwalk -Ibeans/black beans
289 matcher: <intersectionmatcher m1=<matcher files=['beans'], patterns='(?:beans(?:/|$))', includes=None>, m2=<matcher files=[], patterns=None, includes='(?:beans\\/black(?:/|$))'>>
289 matcher: <intersectionmatcher m1=<matcher patterns='(?:beans(?:/|$))', includes=None>, m2=<matcher patterns=None, includes='(?:beans\\/black(?:/|$))'>>
290 290 f beans/black beans/black
291 291 $ hg debugwalk -Xbeans/black beans
292 matcher: <differencematcher m1=<matcher files=['beans'], patterns='(?:beans(?:/|$))', includes=None>, m2=<matcher files=[], patterns=None, includes='(?:beans\\/black(?:/|$))'>>
292 matcher: <differencematcher m1=<matcher patterns='(?:beans(?:/|$))', includes=None>, m2=<matcher patterns=None, includes='(?:beans\\/black(?:/|$))'>>
293 293 f beans/borlotti beans/borlotti
294 294 f beans/kidney beans/kidney
295 295 f beans/navy beans/navy
296 296 f beans/pinto beans/pinto
297 297 f beans/turtle beans/turtle
298 298 $ hg debugwalk -Xbeans/black -Ibeans
299 matcher: <differencematcher m1=<matcher files=[], patterns=None, includes='(?:beans(?:/|$))'>, m2=<matcher files=[], patterns=None, includes='(?:beans\\/black(?:/|$))'>>
299 matcher: <differencematcher m1=<matcher patterns=None, includes='(?:beans(?:/|$))'>, m2=<matcher patterns=None, includes='(?:beans\\/black(?:/|$))'>>
300 300 f beans/borlotti beans/borlotti
301 301 f beans/kidney beans/kidney
302 302 f beans/navy beans/navy
303 303 f beans/pinto beans/pinto
304 304 f beans/turtle beans/turtle
305 305 $ hg debugwalk -Xbeans/black beans/black
306 matcher: <differencematcher m1=<matcher files=['beans/black'], patterns='(?:beans\\/black(?:/|$))', includes=None>, m2=<matcher files=[], patterns=None, includes='(?:beans\\/black(?:/|$))'>>
306 matcher: <differencematcher m1=<matcher patterns='(?:beans\\/black(?:/|$))', includes=None>, m2=<matcher patterns=None, includes='(?:beans\\/black(?:/|$))'>>
307 307 f beans/black beans/black exact
308 308 $ hg debugwalk -Xbeans/black -Ibeans/black
309 matcher: <differencematcher m1=<matcher files=[], patterns=None, includes='(?:beans\\/black(?:/|$))'>, m2=<matcher files=[], patterns=None, includes='(?:beans\\/black(?:/|$))'>>
309 matcher: <differencematcher m1=<matcher patterns=None, includes='(?:beans\\/black(?:/|$))'>, m2=<matcher patterns=None, includes='(?:beans\\/black(?:/|$))'>>
310 310 $ hg debugwalk -Xbeans beans/black
311 matcher: <differencematcher m1=<matcher files=['beans/black'], patterns='(?:beans\\/black(?:/|$))', includes=None>, m2=<matcher files=[], patterns=None, includes='(?:beans(?:/|$))'>>
311 matcher: <differencematcher m1=<matcher patterns='(?:beans\\/black(?:/|$))', includes=None>, m2=<matcher patterns=None, includes='(?:beans(?:/|$))'>>
312 312 f beans/black beans/black exact
313 313 $ hg debugwalk -Xbeans -Ibeans/black
314 matcher: <differencematcher m1=<matcher files=[], patterns=None, includes='(?:beans\\/black(?:/|$))'>, m2=<matcher files=[], patterns=None, includes='(?:beans(?:/|$))'>>
314 matcher: <differencematcher m1=<matcher patterns=None, includes='(?:beans\\/black(?:/|$))'>, m2=<matcher patterns=None, includes='(?:beans(?:/|$))'>>
315 315 $ hg debugwalk 'glob:mammals/../beans/b*'
316 matcher: <matcher files=['beans'], patterns='(?:beans\\/b[^/]*$)', includes=None>
316 matcher: <matcher patterns='(?:beans\\/b[^/]*$)', includes=None>
317 317 f beans/black beans/black
318 318 f beans/borlotti beans/borlotti
319 319 $ hg debugwalk '-X*/Procyonidae' mammals
320 matcher: <differencematcher m1=<matcher files=['mammals'], patterns='(?:mammals(?:/|$))', includes=None>, m2=<matcher files=[], patterns=None, includes='(?:[^/]*\\/Procyonidae(?:/|$))'>>
320 matcher: <differencematcher m1=<matcher patterns='(?:mammals(?:/|$))', includes=None>, m2=<matcher patterns=None, includes='(?:[^/]*\\/Procyonidae(?:/|$))'>>
321 321 f mammals/skunk mammals/skunk
322 322 $ hg debugwalk path:mammals
323 matcher: <matcher files=['mammals'], patterns='(?:^mammals(?:/|$))', includes=None>
323 matcher: <matcher patterns='(?:^mammals(?:/|$))', includes=None>
324 324 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
325 325 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
326 326 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
@@ -347,7 +347,7 b''
347 347 Test absolute paths:
348 348
349 349 $ hg debugwalk `pwd`/beans
350 matcher: <matcher files=['beans'], patterns='(?:beans(?:/|$))', includes=None>
350 matcher: <matcher patterns='(?:beans(?:/|$))', includes=None>
351 351 f beans/black beans/black
352 352 f beans/borlotti beans/borlotti
353 353 f beans/kidney beans/kidney
@@ -361,7 +361,7 b' Test absolute paths:'
361 361 Test patterns:
362 362
363 363 $ hg debugwalk glob:\*
364 matcher: <matcher files=['.'], patterns='(?:[^/]*$)', includes=None>
364 matcher: <matcher patterns='(?:[^/]*$)', includes=None>
365 365 f fennel fennel
366 366 f fenugreek fenugreek
367 367 f fiddlehead fiddlehead
@@ -371,19 +371,19 b' Test patterns:'
371 371 adding glob:glob
372 372 warning: filename contains ':', which is reserved on Windows: 'glob:glob'
373 373 $ hg debugwalk glob:\*
374 matcher: <matcher files=['.'], patterns='(?:[^/]*$)', includes=None>
374 matcher: <matcher patterns='(?:[^/]*$)', includes=None>
375 375 f fennel fennel
376 376 f fenugreek fenugreek
377 377 f fiddlehead fiddlehead
378 378 f glob:glob glob:glob
379 379 $ hg debugwalk glob:glob
380 matcher: <matcher files=['glob'], patterns='(?:glob$)', includes=None>
380 matcher: <matcher patterns='(?:glob$)', includes=None>
381 381 glob: No such file or directory
382 382 $ hg debugwalk glob:glob:glob
383 matcher: <matcher files=['glob:glob'], patterns='(?:glob\\:glob$)', includes=None>
383 matcher: <matcher patterns='(?:glob\\:glob$)', includes=None>
384 384 f glob:glob glob:glob exact
385 385 $ hg debugwalk path:glob:glob
386 matcher: <matcher files=['glob:glob'], patterns='(?:^glob\\:glob(?:/|$))', includes=None>
386 matcher: <matcher patterns='(?:^glob\\:glob(?:/|$))', includes=None>
387 387 f glob:glob glob:glob exact
388 388 $ rm glob:glob
389 389 $ hg addremove
@@ -391,38 +391,38 b' Test patterns:'
391 391 #endif
392 392
393 393 $ hg debugwalk 'glob:**e'
394 matcher: <matcher files=['.'], patterns='(?:.*e$)', includes=None>
394 matcher: <matcher patterns='(?:.*e$)', includes=None>
395 395 f beans/turtle beans/turtle
396 396 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
397 397
398 398 $ hg debugwalk 're:.*[kb]$'
399 matcher: <matcher files=['.'], patterns='(?:.*[kb]$)', includes=None>
399 matcher: <matcher patterns='(?:.*[kb]$)', includes=None>
400 400 f beans/black beans/black
401 401 f fenugreek fenugreek
402 402 f mammals/skunk mammals/skunk
403 403
404 404 $ hg debugwalk path:beans/black
405 matcher: <matcher files=['beans/black'], patterns='(?:^beans\\/black(?:/|$))', includes=None>
405 matcher: <matcher patterns='(?:^beans\\/black(?:/|$))', includes=None>
406 406 f beans/black beans/black exact
407 407 $ hg debugwalk path:beans//black
408 matcher: <matcher files=['beans/black'], patterns='(?:^beans\\/black(?:/|$))', includes=None>
408 matcher: <matcher patterns='(?:^beans\\/black(?:/|$))', includes=None>
409 409 f beans/black beans/black exact
410 410
411 411 $ hg debugwalk relglob:Procyonidae
412 matcher: <matcher files=['.'], patterns='(?:(?:|.*/)Procyonidae$)', includes=None>
412 matcher: <matcher patterns='(?:(?:|.*/)Procyonidae$)', includes=None>
413 413 $ hg debugwalk 'relglob:Procyonidae/**'
414 matcher: <matcher files=['.'], patterns='(?:(?:|.*/)Procyonidae\\/.*$)', includes=None>
414 matcher: <matcher patterns='(?:(?:|.*/)Procyonidae\\/.*$)', includes=None>
415 415 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
416 416 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
417 417 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
418 418 $ hg debugwalk 'relglob:Procyonidae/**' fennel
419 matcher: <matcher files=['.', 'fennel'], patterns='(?:(?:|.*/)Procyonidae\\/.*$|fennel(?:/|$))', includes=None>
419 matcher: <matcher patterns='(?:(?:|.*/)Procyonidae\\/.*$|fennel(?:/|$))', includes=None>
420 420 f fennel fennel exact
421 421 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
422 422 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
423 423 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
424 424 $ hg debugwalk beans 'glob:beans/*'
425 matcher: <matcher files=['beans', 'beans'], patterns='(?:beans(?:/|$)|beans\\/[^/]*$)', includes=None>
425 matcher: <matcher patterns='(?:beans(?:/|$)|beans\\/[^/]*$)', includes=None>
426 426 f beans/black beans/black
427 427 f beans/borlotti beans/borlotti
428 428 f beans/kidney beans/kidney
@@ -430,78 +430,78 b' Test patterns:'
430 430 f beans/pinto beans/pinto
431 431 f beans/turtle beans/turtle
432 432 $ hg debugwalk 'glob:mamm**'
433 matcher: <matcher files=['.'], patterns='(?:mamm.*$)', includes=None>
433 matcher: <matcher patterns='(?:mamm.*$)', includes=None>
434 434 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
435 435 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
436 436 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
437 437 f mammals/skunk mammals/skunk
438 438 $ hg debugwalk 'glob:mamm**' fennel
439 matcher: <matcher files=['.', 'fennel'], patterns='(?:mamm.*$|fennel(?:/|$))', includes=None>
439 matcher: <matcher patterns='(?:mamm.*$|fennel(?:/|$))', includes=None>
440 440 f fennel fennel exact
441 441 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
442 442 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
443 443 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
444 444 f mammals/skunk mammals/skunk
445 445 $ hg debugwalk 'glob:j*'
446 matcher: <matcher files=['.'], patterns='(?:j[^/]*$)', includes=None>
446 matcher: <matcher patterns='(?:j[^/]*$)', includes=None>
447 447 $ hg debugwalk NOEXIST
448 matcher: <matcher files=['NOEXIST'], patterns='(?:NOEXIST(?:/|$))', includes=None>
448 matcher: <matcher patterns='(?:NOEXIST(?:/|$))', includes=None>
449 449 NOEXIST: * (glob)
450 450
451 451 #if fifo
452 452 $ mkfifo fifo
453 453 $ hg debugwalk fifo
454 matcher: <matcher files=['fifo'], patterns='(?:fifo(?:/|$))', includes=None>
454 matcher: <matcher patterns='(?:fifo(?:/|$))', includes=None>
455 455 fifo: unsupported file type (type is fifo)
456 456 #endif
457 457
458 458 $ rm fenugreek
459 459 $ hg debugwalk fenugreek
460 matcher: <matcher files=['fenugreek'], patterns='(?:fenugreek(?:/|$))', includes=None>
460 matcher: <matcher patterns='(?:fenugreek(?:/|$))', includes=None>
461 461 f fenugreek fenugreek exact
462 462 $ hg rm fenugreek
463 463 $ hg debugwalk fenugreek
464 matcher: <matcher files=['fenugreek'], patterns='(?:fenugreek(?:/|$))', includes=None>
464 matcher: <matcher patterns='(?:fenugreek(?:/|$))', includes=None>
465 465 f fenugreek fenugreek exact
466 466 $ touch new
467 467 $ hg debugwalk new
468 matcher: <matcher files=['new'], patterns='(?:new(?:/|$))', includes=None>
468 matcher: <matcher patterns='(?:new(?:/|$))', includes=None>
469 469 f new new exact
470 470
471 471 $ mkdir ignored
472 472 $ touch ignored/file
473 473 $ echo '^ignored$' > .hgignore
474 474 $ hg debugwalk ignored
475 matcher: <matcher files=['ignored'], patterns='(?:ignored(?:/|$))', includes=None>
475 matcher: <matcher patterns='(?:ignored(?:/|$))', includes=None>
476 476 $ hg debugwalk ignored/file
477 matcher: <matcher files=['ignored/file'], patterns='(?:ignored\\/file(?:/|$))', includes=None>
477 matcher: <matcher patterns='(?:ignored\\/file(?:/|$))', includes=None>
478 478 f ignored/file ignored/file exact
479 479
480 480 Test listfile and listfile0
481 481
482 482 $ $PYTHON -c "file('listfile0', 'wb').write('fenugreek\0new\0')"
483 483 $ hg debugwalk -I 'listfile0:listfile0'
484 matcher: <matcher files=[], patterns=None, includes='(?:fenugreek(?:/|$)|new(?:/|$))'>
484 matcher: <matcher patterns=None, includes='(?:fenugreek(?:/|$)|new(?:/|$))'>
485 485 f fenugreek fenugreek
486 486 f new new
487 487 $ $PYTHON -c "file('listfile', 'wb').write('fenugreek\nnew\r\nmammals/skunk\n')"
488 488 $ hg debugwalk -I 'listfile:listfile'
489 matcher: <matcher files=[], patterns=None, includes='(?:fenugreek(?:/|$)|new(?:/|$)|mammals\\/skunk(?:/|$))'>
489 matcher: <matcher patterns=None, includes='(?:fenugreek(?:/|$)|new(?:/|$)|mammals\\/skunk(?:/|$))'>
490 490 f fenugreek fenugreek
491 491 f mammals/skunk mammals/skunk
492 492 f new new
493 493
494 494 $ cd ..
495 495 $ hg debugwalk -R t t/mammals/skunk
496 matcher: <matcher files=['mammals/skunk'], patterns='(?:mammals\\/skunk(?:/|$))', includes=None>
496 matcher: <matcher patterns='(?:mammals\\/skunk(?:/|$))', includes=None>
497 497 f mammals/skunk t/mammals/skunk exact
498 498 $ mkdir t2
499 499 $ cd t2
500 500 $ hg debugwalk -R ../t ../t/mammals/skunk
501 matcher: <matcher files=['mammals/skunk'], patterns='(?:mammals\\/skunk(?:/|$))', includes=None>
501 matcher: <matcher patterns='(?:mammals\\/skunk(?:/|$))', includes=None>
502 502 f mammals/skunk ../t/mammals/skunk exact
503 503 $ hg debugwalk --cwd ../t mammals/skunk
504 matcher: <matcher files=['mammals/skunk'], patterns='(?:mammals\\/skunk(?:/|$))', includes=None>
504 matcher: <matcher patterns='(?:mammals\\/skunk(?:/|$))', includes=None>
505 505 f mammals/skunk mammals/skunk exact
506 506
507 507 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now