Mercurial > hg
comparison mercurial/dirstate.py @ 1396:8c3e2a254257
check if a file is ignored before complaining if it is an unsupported type
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Tue, 18 Oct 2005 00:45:27 -0700 |
parents | b20b683e8d95 |
children | cf9a1233738a |
comparison
equal
deleted
inserted
replaced
1395:c2eb204917f8 | 1396:8c3e2a254257 |
---|---|
306 st = os.lstat(p) | 306 st = os.lstat(p) |
307 if stat.S_ISDIR(st.st_mode): | 307 if stat.S_ISDIR(st.st_mode): |
308 ds = os.path.join(nd, f +'/') | 308 ds = os.path.join(nd, f +'/') |
309 if statmatch(ds, st): | 309 if statmatch(ds, st): |
310 work.append(p) | 310 work.append(p) |
311 elif supported_type(np, st): | 311 elif statmatch(np, st) and supported_type(np, st): |
312 if statmatch(np, st): | 312 yield util.pconvert(np) |
313 yield util.pconvert(np) | |
314 | 313 |
315 | 314 |
316 known = {'.hg': 1} | 315 known = {'.hg': 1} |
317 def seen(fn): | 316 def seen(fn): |
318 if fn in known: return True | 317 if fn in known: return True |
338 ff = util.normpath(ff) | 337 ff = util.normpath(ff) |
339 if seen(ff): | 338 if seen(ff): |
340 continue | 339 continue |
341 found = False | 340 found = False |
342 self.blockignore = True | 341 self.blockignore = True |
343 if supported_type(ff, st) and statmatch(ff, st): | 342 if statmatch(ff, st) and supported_type(ff, st): |
344 found = True | 343 found = True |
345 self.blockignore = False | 344 self.blockignore = False |
346 if found: | 345 if found: |
347 yield 'f', ff | 346 yield 'f', ff |
348 | 347 |