##// END OF EJS Templates
dirstate: localize a bunch of methods in status fastpath
Matt Mackall -
r5003:4b1acb3e default
parent child Browse files
Show More
@@ -471,20 +471,33 b' class dirstate(object):'
471 471 lookup, modified, added, unknown, ignored = [], [], [], [], []
472 472 removed, deleted, clean = [], [], []
473 473
474 _join = self._join
475 lstat = os.lstat
476 cmap = self._copymap
477 dmap = self._map
478 ladd = lookup.append
479 madd = modified.append
480 aadd = added.append
481 uadd = unknown.append
482 iadd = ignored.append
483 radd = removed.append
484 dadd = deleted.append
485 cadd = clean.append
486
474 487 for src, fn, st in self.statwalk(files, match, ignored=list_ignored):
475 try:
476 type_, mode, size, time = self._map[fn]
477 except KeyError:
488 if fn in dmap:
489 type_, mode, size, time = dmap[fn]
490 else:
478 491 if list_ignored and self._ignore(fn):
479 ignored.append(fn)
492 iadd(fn)
480 493 else:
481 unknown.append(fn)
494 uadd(fn)
482 495 continue
483 496 if src == 'm':
484 497 nonexistent = True
485 498 if not st:
486 499 try:
487 st = os.lstat(self._join(fn))
500 st = lstat(_join(fn))
488 501 except OSError, inst:
489 502 if inst.errno != errno.ENOENT:
490 503 raise
@@ -495,26 +508,26 b' class dirstate(object):'
495 508 # XXX: what to do with file no longer present in the fs
496 509 # who are not removed in the dirstate ?
497 510 if nonexistent and type_ in "nm":
498 deleted.append(fn)
511 dadd(fn)
499 512 continue
500 513 # check the common case first
501 514 if type_ == 'n':
502 515 if not st:
503 st = os.lstat(self._join(fn))
516 st = lstat(_join(fn))
504 517 if (size >= 0 and (size != st.st_size
505 518 or (mode ^ st.st_mode) & 0100)
506 519 or fn in self._copymap):
507 modified.append(fn)
520 madd(fn)
508 521 elif time != int(st.st_mtime):
509 lookup.append(fn)
522 ladd(fn)
510 523 elif list_clean:
511 clean.append(fn)
524 cadd(fn)
512 525 elif type_ == 'm':
513 modified.append(fn)
526 madd(fn)
514 527 elif type_ == 'a':
515 added.append(fn)
528 aadd(fn)
516 529 elif type_ == 'r':
517 removed.append(fn)
530 radd(fn)
518 531
519 532 return (lookup, modified, added, removed, deleted, unknown, ignored,
520 533 clean)
General Comments 0
You need to be logged in to leave comments. Login now