comparison mercurial/dirstate.py @ 4195:b5d1eaade333

Merge a bunch of matcher and locate fixes.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sat, 10 Mar 2007 23:21:33 -0300
parents ba51a8225a60 dd0d9bd91e0a
children dbc3846c09a1
comparison
equal deleted inserted replaced
4177:ba51a8225a60 4195:b5d1eaade333
384 def imatch(file_): 384 def imatch(file_):
385 if file_ not in dc and self.ignore(file_): 385 if file_ not in dc and self.ignore(file_):
386 return False 386 return False
387 return match(file_) 387 return match(file_)
388 388
389 if ignored: imatch = match 389 ignore = self.ignore
390 if ignored:
391 imatch = match
392 ignore = util.never
390 393
391 # self.root may end with a path separator when self.root == '/' 394 # self.root may end with a path separator when self.root == '/'
392 common_prefix_len = len(self.root) 395 common_prefix_len = len(self.root)
393 if not self.root.endswith(os.sep): 396 if not self.root.endswith(os.sep):
394 common_prefix_len += 1 397 common_prefix_len += 1
419 continue 422 continue
420 p = os.path.join(top, f) 423 p = os.path.join(top, f)
421 # don't trip over symlinks 424 # don't trip over symlinks
422 st = os.lstat(p) 425 st = os.lstat(p)
423 if stat.S_ISDIR(st.st_mode): 426 if stat.S_ISDIR(st.st_mode):
424 ds = util.pconvert(os.path.join(nd, f +'/')) 427 if not ignore(p):
425 if imatch(ds):
426 work.append(p) 428 work.append(p)
427 if directories: 429 if directories:
428 yield 'd', np, st 430 yield 'd', np, st
429 if imatch(np) and np in dc: 431 if imatch(np) and np in dc:
430 yield 'm', np, st 432 yield 'm', np, st