##// END OF EJS Templates
match: fold plan cases down to two special cases...
Matt Mackall -
r8684:5bb7780b default
parent child Browse files
Show More
@@ -460,21 +460,12 b' class dirstate(object):'
460 460 work = []
461 461 wadd = work.append
462 462
463 if match.anypats(): # match.match or .exact with patterns
464 dostep3 = True
465 exact = False
466 elif matchfn == match.exact: # match.exact without patterns
467 dostep3 = False
463 exact = skipstep3 = False
464 if matchfn == match.exact: # match.exact
468 465 exact = True
469 elif match.files(): # match.match without patterns
470 dostep3 = False
471 exact = False
472 else: # match.always
473 dostep3 = True
474 exact = False
475
476 if exact: # skip step 2
477 dirignore = util.always
466 dirignore = util.always # skip step 2
467 elif match.files() and not match.anypats(): # match.match, no patterns
468 skipstep3 = True
478 469
479 470 files = set(match.files())
480 471 if not files or '.' in files:
@@ -491,7 +482,7 b' class dirstate(object):'
491 482 st = lstat(join(nf))
492 483 kind = getkind(st.st_mode)
493 484 if kind == dirkind:
494 dostep3 = True
485 skipstep3 = False
495 486 if nf in dmap:
496 487 #file deleted on disk but still in dirstate
497 488 results[nf] = None
@@ -510,7 +501,7 b' class dirstate(object):'
510 501 prefix = nf + "/"
511 502 for fn in dmap:
512 503 if fn.startswith(prefix):
513 dostep3 = True
504 skipstep3 = False
514 505 break
515 506 else:
516 507 badfn(ff, inst.strerror)
@@ -550,7 +541,7 b' class dirstate(object):'
550 541 results[nf] = None
551 542
552 543 # step 3: report unseen items in the dmap hash
553 if dostep3 and not exact:
544 if not skipstep3 and not exact:
554 545 visit = sorted([f for f in dmap if f not in results and matchfn(f)])
555 546 for nf, st in zip(visit, util.statfiles([join(i) for i in visit])):
556 547 if not st is None and not getkind(st.st_mode) in (regkind, lnkkind):
General Comments 0
You need to be logged in to leave comments. Login now