##// END OF EJS Templates
debugwalk: show matcher output only if -v/--verbose...
Yuya Nishihara -
r38281:7c3a59e2 default
parent child Browse files
Show More
@@ -2542,7 +2542,8 b' def debugwalk(ui, repo, *pats, **opts):'
2542 2542 """show how files match on given patterns"""
2543 2543 opts = pycompat.byteskwargs(opts)
2544 2544 m = scmutil.match(repo[None], pats, opts)
2545 ui.write(('matcher: %r\n' % m))
2545 if ui.verbose:
2546 ui.write(('matcher: %r\n' % m))
2546 2547 items = list(repo[None].walk(m))
2547 2548 if not items:
2548 2549 return
@@ -32,7 +32,7 b' test issue352'
32 32 abort: '\n' and '\r' disallowed in filenames: 'hell\no'
33 33 [255]
34 34 $ echo foo > "$A"
35 $ hg debugwalk
35 $ hg debugwalk -v
36 36 matcher: <alwaysmatcher>
37 37 f he\r (no-eol) (esc)
38 38 llo he\r (no-eol) (esc)
@@ -49,7 +49,7 b' Can not modify dirstate outside'
49 49
50 50 $ mkdir outside
51 51 $ touch outside/f1
52 $ hg debugwalk -I 'relglob:f1'
52 $ hg debugwalk -v -I 'relglob:f1'
53 53 matcher: <includematcher includes='(?:(?:|.*/)f1(?:/|$))'>
54 54 f inside/f1 inside/f1
55 55 $ hg add outside/f1
@@ -28,7 +28,7 b''
28 28 adding mammals/skunk
29 29 $ hg commit -m "commit #0"
30 30
31 $ hg debugwalk
31 $ hg debugwalk -v
32 32 matcher: <alwaysmatcher>
33 33 f beans/black beans/black
34 34 f beans/borlotti beans/borlotti
@@ -43,7 +43,7 b''
43 43 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
44 44 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
45 45 f mammals/skunk mammals/skunk
46 $ hg debugwalk -I.
46 $ hg debugwalk -v -I.
47 47 matcher: <includematcher includes='(?:)'>
48 48 f beans/black beans/black
49 49 f beans/borlotti beans/borlotti
@@ -60,7 +60,7 b''
60 60 f mammals/skunk mammals/skunk
61 61
62 62 $ cd mammals
63 $ hg debugwalk
63 $ hg debugwalk -v
64 64 matcher: <alwaysmatcher>
65 65 f beans/black ../beans/black
66 66 f beans/borlotti ../beans/borlotti
@@ -75,7 +75,7 b''
75 75 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
76 76 f mammals/Procyonidae/raccoon Procyonidae/raccoon
77 77 f mammals/skunk skunk
78 $ hg debugwalk -X ../beans
78 $ hg debugwalk -v -X ../beans
79 79 matcher: <differencematcher m1=<alwaysmatcher>, m2=<includematcher includes='(?:beans(?:/|$))'>>
80 80 f fennel ../fennel
81 81 f fenugreek ../fenugreek
@@ -84,31 +84,31 b''
84 84 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
85 85 f mammals/Procyonidae/raccoon Procyonidae/raccoon
86 86 f mammals/skunk skunk
87 $ hg debugwalk -I '*k'
87 $ hg debugwalk -v -I '*k'
88 88 matcher: <includematcher includes='(?:mammals\\/[^/]*k(?:/|$))'>
89 89 f mammals/skunk skunk
90 $ hg debugwalk -I 'glob:*k'
90 $ hg debugwalk -v -I 'glob:*k'
91 91 matcher: <includematcher includes='(?:mammals\\/[^/]*k(?:/|$))'>
92 92 f mammals/skunk skunk
93 $ hg debugwalk -I 'relglob:*k'
93 $ hg debugwalk -v -I 'relglob:*k'
94 94 matcher: <includematcher includes='(?:(?:|.*/)[^/]*k(?:/|$))'>
95 95 f beans/black ../beans/black
96 96 f fenugreek ../fenugreek
97 97 f mammals/skunk skunk
98 $ hg debugwalk -I 'relglob:*k' .
98 $ hg debugwalk -v -I 'relglob:*k' .
99 99 matcher: <intersectionmatcher m1=<patternmatcher patterns='(?:mammals(?:/|$))'>, m2=<includematcher includes='(?:(?:|.*/)[^/]*k(?:/|$))'>>
100 100 f mammals/skunk skunk
101 $ hg debugwalk -I 're:.*k$'
101 $ hg debugwalk -v -I 're:.*k$'
102 102 matcher: <includematcher includes='(?:.*k$)'>
103 103 f beans/black ../beans/black
104 104 f fenugreek ../fenugreek
105 105 f mammals/skunk skunk
106 $ hg debugwalk -I 'relre:.*k$'
106 $ hg debugwalk -v -I 'relre:.*k$'
107 107 matcher: <includematcher includes='(?:.*.*k$)'>
108 108 f beans/black ../beans/black
109 109 f fenugreek ../fenugreek
110 110 f mammals/skunk skunk
111 $ hg debugwalk -I 'path:beans'
111 $ hg debugwalk -v -I 'path:beans'
112 112 matcher: <includematcher includes='(?:beans(?:/|$))'>
113 113 f beans/black ../beans/black
114 114 f beans/borlotti ../beans/borlotti
@@ -116,7 +116,7 b''
116 116 f beans/navy ../beans/navy
117 117 f beans/pinto ../beans/pinto
118 118 f beans/turtle ../beans/turtle
119 $ hg debugwalk -I 'relpath:detour/../../beans'
119 $ hg debugwalk -v -I 'relpath:detour/../../beans'
120 120 matcher: <includematcher includes='(?:beans(?:/|$))'>
121 121 f beans/black ../beans/black
122 122 f beans/borlotti ../beans/borlotti
@@ -125,27 +125,27 b''
125 125 f beans/pinto ../beans/pinto
126 126 f beans/turtle ../beans/turtle
127 127
128 $ hg debugwalk 'rootfilesin:'
128 $ hg debugwalk -v 'rootfilesin:'
129 129 matcher: <patternmatcher patterns='(?:[^/]+$)'>
130 130 f fennel ../fennel
131 131 f fenugreek ../fenugreek
132 132 f fiddlehead ../fiddlehead
133 $ hg debugwalk -I 'rootfilesin:'
133 $ hg debugwalk -v -I 'rootfilesin:'
134 134 matcher: <includematcher includes='(?:[^/]+$)'>
135 135 f fennel ../fennel
136 136 f fenugreek ../fenugreek
137 137 f fiddlehead ../fiddlehead
138 $ hg debugwalk 'rootfilesin:.'
138 $ hg debugwalk -v 'rootfilesin:.'
139 139 matcher: <patternmatcher patterns='(?:[^/]+$)'>
140 140 f fennel ../fennel
141 141 f fenugreek ../fenugreek
142 142 f fiddlehead ../fiddlehead
143 $ hg debugwalk -I 'rootfilesin:.'
143 $ hg debugwalk -v -I 'rootfilesin:.'
144 144 matcher: <includematcher includes='(?:[^/]+$)'>
145 145 f fennel ../fennel
146 146 f fenugreek ../fenugreek
147 147 f fiddlehead ../fiddlehead
148 $ hg debugwalk -X 'rootfilesin:'
148 $ hg debugwalk -v -X 'rootfilesin:'
149 149 matcher: <differencematcher m1=<alwaysmatcher>, m2=<includematcher includes='(?:[^/]+$)'>>
150 150 f beans/black ../beans/black
151 151 f beans/borlotti ../beans/borlotti
@@ -157,15 +157,15 b''
157 157 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
158 158 f mammals/Procyonidae/raccoon Procyonidae/raccoon
159 159 f mammals/skunk skunk
160 $ hg debugwalk 'rootfilesin:fennel'
160 $ hg debugwalk -v 'rootfilesin:fennel'
161 161 matcher: <patternmatcher patterns='(?:fennel/[^/]+$)'>
162 $ hg debugwalk -I 'rootfilesin:fennel'
162 $ hg debugwalk -v -I 'rootfilesin:fennel'
163 163 matcher: <includematcher includes='(?:fennel/[^/]+$)'>
164 $ hg debugwalk 'rootfilesin:skunk'
164 $ hg debugwalk -v 'rootfilesin:skunk'
165 165 matcher: <patternmatcher patterns='(?:skunk/[^/]+$)'>
166 $ hg debugwalk -I 'rootfilesin:skunk'
166 $ hg debugwalk -v -I 'rootfilesin:skunk'
167 167 matcher: <includematcher includes='(?:skunk/[^/]+$)'>
168 $ hg debugwalk 'rootfilesin:beans'
168 $ hg debugwalk -v 'rootfilesin:beans'
169 169 matcher: <patternmatcher patterns='(?:beans/[^/]+$)'>
170 170 f beans/black ../beans/black
171 171 f beans/borlotti ../beans/borlotti
@@ -173,7 +173,7 b''
173 173 f beans/navy ../beans/navy
174 174 f beans/pinto ../beans/pinto
175 175 f beans/turtle ../beans/turtle
176 $ hg debugwalk -I 'rootfilesin:beans'
176 $ hg debugwalk -v -I 'rootfilesin:beans'
177 177 matcher: <includematcher includes='(?:beans/[^/]+$)'>
178 178 f beans/black ../beans/black
179 179 f beans/borlotti ../beans/borlotti
@@ -181,19 +181,19 b''
181 181 f beans/navy ../beans/navy
182 182 f beans/pinto ../beans/pinto
183 183 f beans/turtle ../beans/turtle
184 $ hg debugwalk 'rootfilesin:mammals'
184 $ hg debugwalk -v 'rootfilesin:mammals'
185 185 matcher: <patternmatcher patterns='(?:mammals/[^/]+$)'>
186 186 f mammals/skunk skunk
187 $ hg debugwalk -I 'rootfilesin:mammals'
187 $ hg debugwalk -v -I 'rootfilesin:mammals'
188 188 matcher: <includematcher includes='(?:mammals/[^/]+$)'>
189 189 f mammals/skunk skunk
190 $ hg debugwalk 'rootfilesin:mammals/'
190 $ hg debugwalk -v 'rootfilesin:mammals/'
191 191 matcher: <patternmatcher patterns='(?:mammals/[^/]+$)'>
192 192 f mammals/skunk skunk
193 $ hg debugwalk -I 'rootfilesin:mammals/'
193 $ hg debugwalk -v -I 'rootfilesin:mammals/'
194 194 matcher: <includematcher includes='(?:mammals/[^/]+$)'>
195 195 f mammals/skunk skunk
196 $ hg debugwalk -X 'rootfilesin:mammals'
196 $ hg debugwalk -v -X 'rootfilesin:mammals'
197 197 matcher: <differencematcher m1=<alwaysmatcher>, m2=<includematcher includes='(?:mammals/[^/]+$)'>>
198 198 f beans/black ../beans/black
199 199 f beans/borlotti ../beans/borlotti
@@ -208,31 +208,31 b''
208 208 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
209 209 f mammals/Procyonidae/raccoon Procyonidae/raccoon
210 210
211 $ hg debugwalk .
211 $ hg debugwalk -v .
212 212 matcher: <patternmatcher patterns='(?:mammals(?:/|$))'>
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 $ hg debugwalk -I.
217 $ hg debugwalk -v -I.
218 218 matcher: <includematcher 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 $ hg debugwalk Procyonidae
223 $ hg debugwalk -v Procyonidae
224 224 matcher: <patternmatcher patterns='(?:mammals\\/Procyonidae(?:/|$))'>
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 $ hg debugwalk .
230 $ hg debugwalk -v .
231 231 matcher: <patternmatcher patterns='(?:mammals\\/Procyonidae(?:/|$))'>
232 232 f mammals/Procyonidae/cacomistle cacomistle
233 233 f mammals/Procyonidae/coatimundi coatimundi
234 234 f mammals/Procyonidae/raccoon raccoon
235 $ hg debugwalk ..
235 $ hg debugwalk -v ..
236 236 matcher: <patternmatcher patterns='(?:mammals(?:/|$))'>
237 237 f mammals/Procyonidae/cacomistle cacomistle
238 238 f mammals/Procyonidae/coatimundi coatimundi
@@ -240,7 +240,7 b''
240 240 f mammals/skunk ../skunk
241 241 $ cd ..
242 242
243 $ hg debugwalk ../beans
243 $ hg debugwalk -v ../beans
244 244 matcher: <patternmatcher patterns='(?:beans(?:/|$))'>
245 245 f beans/black ../beans/black
246 246 f beans/borlotti ../beans/borlotti
@@ -248,21 +248,21 b''
248 248 f beans/navy ../beans/navy
249 249 f beans/pinto ../beans/pinto
250 250 f beans/turtle ../beans/turtle
251 $ hg debugwalk .
251 $ hg debugwalk -v .
252 252 matcher: <patternmatcher patterns='(?:mammals(?:/|$))'>
253 253 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
254 254 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
255 255 f mammals/Procyonidae/raccoon Procyonidae/raccoon
256 256 f mammals/skunk skunk
257 $ hg debugwalk .hg
257 $ hg debugwalk -v .hg
258 258 abort: path 'mammals/.hg' is inside nested repo 'mammals'
259 259 [255]
260 $ hg debugwalk ../.hg
260 $ hg debugwalk -v ../.hg
261 261 abort: path contains illegal component: .hg
262 262 [255]
263 263 $ cd ..
264 264
265 $ hg debugwalk -Ibeans
265 $ hg debugwalk -v -Ibeans
266 266 matcher: <includematcher includes='(?:beans(?:/|$))'>
267 267 f beans/black beans/black
268 268 f beans/borlotti beans/borlotti
@@ -270,92 +270,92 b''
270 270 f beans/navy beans/navy
271 271 f beans/pinto beans/pinto
272 272 f beans/turtle beans/turtle
273 $ hg debugwalk -I '{*,{b,m}*/*}k'
273 $ hg debugwalk -v -I '{*,{b,m}*/*}k'
274 274 matcher: <includematcher includes='(?:(?:[^/]*|(?:b|m)[^/]*\\/[^/]*)k(?:/|$))'>
275 275 f beans/black beans/black
276 276 f fenugreek fenugreek
277 277 f mammals/skunk mammals/skunk
278 $ hg debugwalk -Ibeans mammals
278 $ hg debugwalk -v -Ibeans mammals
279 279 matcher: <intersectionmatcher m1=<patternmatcher patterns='(?:mammals(?:/|$))'>, m2=<includematcher includes='(?:beans(?:/|$))'>>
280 $ hg debugwalk -Inon-existent
280 $ hg debugwalk -v -Inon-existent
281 281 matcher: <includematcher includes='(?:non\\-existent(?:/|$))'>
282 $ hg debugwalk -Inon-existent -Ibeans/black
282 $ hg debugwalk -v -Inon-existent -Ibeans/black
283 283 matcher: <includematcher includes='(?:non\\-existent(?:/|$)|beans\\/black(?:/|$))'>
284 284 f beans/black beans/black
285 $ hg debugwalk -Ibeans beans/black
285 $ hg debugwalk -v -Ibeans beans/black
286 286 matcher: <intersectionmatcher m1=<patternmatcher patterns='(?:beans\\/black(?:/|$))'>, m2=<includematcher includes='(?:beans(?:/|$))'>>
287 287 f beans/black beans/black exact
288 $ hg debugwalk -Ibeans/black beans
288 $ hg debugwalk -v -Ibeans/black beans
289 289 matcher: <intersectionmatcher m1=<patternmatcher patterns='(?:beans(?:/|$))'>, m2=<includematcher includes='(?:beans\\/black(?:/|$))'>>
290 290 f beans/black beans/black
291 $ hg debugwalk -Xbeans/black beans
291 $ hg debugwalk -v -Xbeans/black beans
292 292 matcher: <differencematcher m1=<patternmatcher patterns='(?:beans(?:/|$))'>, m2=<includematcher 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 $ hg debugwalk -Xbeans/black -Ibeans
298 $ hg debugwalk -v -Xbeans/black -Ibeans
299 299 matcher: <differencematcher m1=<includematcher includes='(?:beans(?:/|$))'>, m2=<includematcher 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 $ hg debugwalk -Xbeans/black beans/black
305 $ hg debugwalk -v -Xbeans/black beans/black
306 306 matcher: <differencematcher m1=<patternmatcher patterns='(?:beans\\/black(?:/|$))'>, m2=<includematcher includes='(?:beans\\/black(?:/|$))'>>
307 $ hg debugwalk -Xbeans/black -Ibeans/black
307 $ hg debugwalk -v -Xbeans/black -Ibeans/black
308 308 matcher: <differencematcher m1=<includematcher includes='(?:beans\\/black(?:/|$))'>, m2=<includematcher includes='(?:beans\\/black(?:/|$))'>>
309 $ hg debugwalk -Xbeans beans/black
309 $ hg debugwalk -v -Xbeans beans/black
310 310 matcher: <differencematcher m1=<patternmatcher patterns='(?:beans\\/black(?:/|$))'>, m2=<includematcher includes='(?:beans(?:/|$))'>>
311 $ hg debugwalk -Xbeans -Ibeans/black
311 $ hg debugwalk -v -Xbeans -Ibeans/black
312 312 matcher: <differencematcher m1=<includematcher includes='(?:beans\\/black(?:/|$))'>, m2=<includematcher includes='(?:beans(?:/|$))'>>
313 $ hg debugwalk 'glob:mammals/../beans/b*'
313 $ hg debugwalk -v 'glob:mammals/../beans/b*'
314 314 matcher: <patternmatcher patterns='(?:beans\\/b[^/]*$)'>
315 315 f beans/black beans/black
316 316 f beans/borlotti beans/borlotti
317 $ hg debugwalk '-X*/Procyonidae' mammals
317 $ hg debugwalk -v '-X*/Procyonidae' mammals
318 318 matcher: <differencematcher m1=<patternmatcher patterns='(?:mammals(?:/|$))'>, m2=<includematcher includes='(?:[^/]*\\/Procyonidae(?:/|$))'>>
319 319 f mammals/skunk mammals/skunk
320 $ hg debugwalk path:mammals
320 $ hg debugwalk -v path:mammals
321 321 matcher: <patternmatcher patterns='(?:mammals(?:/|$))'>
322 322 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
323 323 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
324 324 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
325 325 f mammals/skunk mammals/skunk
326 $ hg debugwalk ..
326 $ hg debugwalk -v ..
327 327 abort: .. not under root '$TESTTMP/t'
328 328 [255]
329 $ hg debugwalk beans/../..
329 $ hg debugwalk -v beans/../..
330 330 abort: beans/../.. not under root '$TESTTMP/t'
331 331 [255]
332 $ hg debugwalk .hg
332 $ hg debugwalk -v .hg
333 333 abort: path contains illegal component: .hg
334 334 [255]
335 $ hg debugwalk beans/../.hg
335 $ hg debugwalk -v beans/../.hg
336 336 abort: path contains illegal component: .hg
337 337 [255]
338 $ hg debugwalk beans/../.hg/data
338 $ hg debugwalk -v beans/../.hg/data
339 339 abort: path contains illegal component: .hg/data
340 340 [255]
341 $ hg debugwalk beans/.hg
341 $ hg debugwalk -v beans/.hg
342 342 abort: path 'beans/.hg' is inside nested repo 'beans'
343 343 [255]
344 344
345 345 Test explicit paths and excludes:
346 346
347 $ hg debugwalk fennel -X fennel
347 $ hg debugwalk -v fennel -X fennel
348 348 matcher: <differencematcher m1=<patternmatcher patterns='(?:fennel(?:/|$))'>, m2=<includematcher includes='(?:fennel(?:/|$))'>>
349 $ hg debugwalk fennel -X 'f*'
349 $ hg debugwalk -v fennel -X 'f*'
350 350 matcher: <differencematcher m1=<patternmatcher patterns='(?:fennel(?:/|$))'>, m2=<includematcher includes='(?:f[^/]*(?:/|$))'>>
351 $ hg debugwalk beans/black -X 'path:beans'
351 $ hg debugwalk -v beans/black -X 'path:beans'
352 352 matcher: <differencematcher m1=<patternmatcher patterns='(?:beans\\/black(?:/|$))'>, m2=<includematcher includes='(?:beans(?:/|$))'>>
353 $ hg debugwalk -I 'path:beans/black' -X 'path:beans'
353 $ hg debugwalk -v -I 'path:beans/black' -X 'path:beans'
354 354 matcher: <differencematcher m1=<includematcher includes='(?:beans\\/black(?:/|$))'>, m2=<includematcher includes='(?:beans(?:/|$))'>>
355 355
356 356 Test absolute paths:
357 357
358 $ hg debugwalk `pwd`/beans
358 $ hg debugwalk -v `pwd`/beans
359 359 matcher: <patternmatcher patterns='(?:beans(?:/|$))'>
360 360 f beans/black beans/black
361 361 f beans/borlotti beans/borlotti
@@ -363,13 +363,13 b' Test absolute paths:'
363 363 f beans/navy beans/navy
364 364 f beans/pinto beans/pinto
365 365 f beans/turtle beans/turtle
366 $ hg debugwalk `pwd`/..
366 $ hg debugwalk -v `pwd`/..
367 367 abort: $TESTTMP/t/.. not under root '$TESTTMP/t'
368 368 [255]
369 369
370 370 Test patterns:
371 371
372 $ hg debugwalk glob:\*
372 $ hg debugwalk -v glob:\*
373 373 matcher: <patternmatcher patterns='(?:[^/]*$)'>
374 374 f fennel fennel
375 375 f fenugreek fenugreek
@@ -379,19 +379,19 b' Test patterns:'
379 379 $ hg addremove
380 380 adding glob:glob
381 381 warning: filename contains ':', which is reserved on Windows: 'glob:glob'
382 $ hg debugwalk glob:\*
382 $ hg debugwalk -v glob:\*
383 383 matcher: <patternmatcher patterns='(?:[^/]*$)'>
384 384 f fennel fennel
385 385 f fenugreek fenugreek
386 386 f fiddlehead fiddlehead
387 387 f glob:glob glob:glob
388 $ hg debugwalk glob:glob
388 $ hg debugwalk -v glob:glob
389 389 matcher: <patternmatcher patterns='(?:glob$)'>
390 390 glob: $ENOENT$
391 $ hg debugwalk glob:glob:glob
391 $ hg debugwalk -v glob:glob:glob
392 392 matcher: <patternmatcher patterns='(?:glob\\:glob$)'>
393 393 f glob:glob glob:glob exact
394 $ hg debugwalk path:glob:glob
394 $ hg debugwalk -v path:glob:glob
395 395 matcher: <patternmatcher patterns='(?:glob\\:glob(?:/|$))'>
396 396 f glob:glob glob:glob exact
397 397 $ rm glob:glob
@@ -399,38 +399,38 b' Test patterns:'
399 399 removing glob:glob
400 400 #endif
401 401
402 $ hg debugwalk 'glob:**e'
402 $ hg debugwalk -v 'glob:**e'
403 403 matcher: <patternmatcher patterns='(?:.*e$)'>
404 404 f beans/turtle beans/turtle
405 405 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
406 406
407 $ hg debugwalk 're:.*[kb]$'
407 $ hg debugwalk -v 're:.*[kb]$'
408 408 matcher: <patternmatcher patterns='(?:.*[kb]$)'>
409 409 f beans/black beans/black
410 410 f fenugreek fenugreek
411 411 f mammals/skunk mammals/skunk
412 412
413 $ hg debugwalk path:beans/black
413 $ hg debugwalk -v path:beans/black
414 414 matcher: <patternmatcher patterns='(?:beans\\/black(?:/|$))'>
415 415 f beans/black beans/black exact
416 $ hg debugwalk path:beans//black
416 $ hg debugwalk -v path:beans//black
417 417 matcher: <patternmatcher patterns='(?:beans\\/black(?:/|$))'>
418 418 f beans/black beans/black exact
419 419
420 $ hg debugwalk relglob:Procyonidae
420 $ hg debugwalk -v relglob:Procyonidae
421 421 matcher: <patternmatcher patterns='(?:(?:|.*/)Procyonidae$)'>
422 $ hg debugwalk 'relglob:Procyonidae/**'
422 $ hg debugwalk -v 'relglob:Procyonidae/**'
423 423 matcher: <patternmatcher patterns='(?:(?:|.*/)Procyonidae\\/.*$)'>
424 424 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
425 425 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
426 426 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
427 $ hg debugwalk 'relglob:Procyonidae/**' fennel
427 $ hg debugwalk -v 'relglob:Procyonidae/**' fennel
428 428 matcher: <patternmatcher patterns='(?:(?:|.*/)Procyonidae\\/.*$|fennel(?:/|$))'>
429 429 f fennel fennel exact
430 430 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
431 431 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
432 432 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
433 $ hg debugwalk beans 'glob:beans/*'
433 $ hg debugwalk -v beans 'glob:beans/*'
434 434 matcher: <patternmatcher patterns='(?:beans(?:/|$)|beans\\/[^/]*$)'>
435 435 f beans/black beans/black
436 436 f beans/borlotti beans/borlotti
@@ -438,78 +438,78 b' Test patterns:'
438 438 f beans/navy beans/navy
439 439 f beans/pinto beans/pinto
440 440 f beans/turtle beans/turtle
441 $ hg debugwalk 'glob:mamm**'
441 $ hg debugwalk -v 'glob:mamm**'
442 442 matcher: <patternmatcher patterns='(?:mamm.*$)'>
443 443 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
444 444 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
445 445 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
446 446 f mammals/skunk mammals/skunk
447 $ hg debugwalk 'glob:mamm**' fennel
447 $ hg debugwalk -v 'glob:mamm**' fennel
448 448 matcher: <patternmatcher patterns='(?:mamm.*$|fennel(?:/|$))'>
449 449 f fennel fennel exact
450 450 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
451 451 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
452 452 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
453 453 f mammals/skunk mammals/skunk
454 $ hg debugwalk 'glob:j*'
454 $ hg debugwalk -v 'glob:j*'
455 455 matcher: <patternmatcher patterns='(?:j[^/]*$)'>
456 $ hg debugwalk NOEXIST
456 $ hg debugwalk -v NOEXIST
457 457 matcher: <patternmatcher patterns='(?:NOEXIST(?:/|$))'>
458 458 NOEXIST: * (glob)
459 459
460 460 #if fifo
461 461 $ mkfifo fifo
462 $ hg debugwalk fifo
462 $ hg debugwalk -v fifo
463 463 matcher: <patternmatcher patterns='(?:fifo(?:/|$))'>
464 464 fifo: unsupported file type (type is fifo)
465 465 #endif
466 466
467 467 $ rm fenugreek
468 $ hg debugwalk fenugreek
468 $ hg debugwalk -v fenugreek
469 469 matcher: <patternmatcher patterns='(?:fenugreek(?:/|$))'>
470 470 f fenugreek fenugreek exact
471 471 $ hg rm fenugreek
472 $ hg debugwalk fenugreek
472 $ hg debugwalk -v fenugreek
473 473 matcher: <patternmatcher patterns='(?:fenugreek(?:/|$))'>
474 474 f fenugreek fenugreek exact
475 475 $ touch new
476 $ hg debugwalk new
476 $ hg debugwalk -v new
477 477 matcher: <patternmatcher patterns='(?:new(?:/|$))'>
478 478 f new new exact
479 479
480 480 $ mkdir ignored
481 481 $ touch ignored/file
482 482 $ echo '^ignored$' > .hgignore
483 $ hg debugwalk ignored
483 $ hg debugwalk -v ignored
484 484 matcher: <patternmatcher patterns='(?:ignored(?:/|$))'>
485 $ hg debugwalk ignored/file
485 $ hg debugwalk -v ignored/file
486 486 matcher: <patternmatcher patterns='(?:ignored\\/file(?:/|$))'>
487 487 f ignored/file ignored/file exact
488 488
489 489 Test listfile and listfile0
490 490
491 491 $ $PYTHON -c "open('listfile0', 'wb').write(b'fenugreek\0new\0')"
492 $ hg debugwalk -I 'listfile0:listfile0'
492 $ hg debugwalk -v -I 'listfile0:listfile0'
493 493 matcher: <includematcher includes='(?:fenugreek(?:/|$)|new(?:/|$))'>
494 494 f fenugreek fenugreek
495 495 f new new
496 496 $ $PYTHON -c "open('listfile', 'wb').write(b'fenugreek\nnew\r\nmammals/skunk\n')"
497 $ hg debugwalk -I 'listfile:listfile'
497 $ hg debugwalk -v -I 'listfile:listfile'
498 498 matcher: <includematcher includes='(?:fenugreek(?:/|$)|new(?:/|$)|mammals\\/skunk(?:/|$))'>
499 499 f fenugreek fenugreek
500 500 f mammals/skunk mammals/skunk
501 501 f new new
502 502
503 503 $ cd ..
504 $ hg debugwalk -R t t/mammals/skunk
504 $ hg debugwalk -v -R t t/mammals/skunk
505 505 matcher: <patternmatcher patterns='(?:mammals\\/skunk(?:/|$))'>
506 506 f mammals/skunk t/mammals/skunk exact
507 507 $ mkdir t2
508 508 $ cd t2
509 $ hg debugwalk -R ../t ../t/mammals/skunk
509 $ hg debugwalk -v -R ../t ../t/mammals/skunk
510 510 matcher: <patternmatcher patterns='(?:mammals\\/skunk(?:/|$))'>
511 511 f mammals/skunk ../t/mammals/skunk exact
512 $ hg debugwalk --cwd ../t mammals/skunk
512 $ hg debugwalk -v --cwd ../t mammals/skunk
513 513 matcher: <patternmatcher patterns='(?:mammals\\/skunk(?:/|$))'>
514 514 f mammals/skunk mammals/skunk exact
515 515
@@ -526,7 +526,7 b' Test split patterns on overflow'
526 526 > EOF
527 527 $ $PYTHON printnum.py >> overflow.list
528 528 $ echo fenugreek >> overflow.list
529 $ hg debugwalk 'listfile:overflow.list' 2>&1 | egrep -v '(^matcher: |^xxx)'
529 $ hg debugwalk 'listfile:overflow.list' 2>&1 | egrep -v '^xxx'
530 530 f fennel fennel exact
531 531 f fenugreek fenugreek exact
532 532 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now