##// 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 work = []
460 work = []
461 wadd = work.append
461 wadd = work.append
462
462
463 if match.anypats(): # match.match or .exact with patterns
463 exact = skipstep3 = False
464 dostep3 = True
464 if matchfn == match.exact: # match.exact
465 exact = False
466 elif matchfn == match.exact: # match.exact without patterns
467 dostep3 = False
468 exact = True
465 exact = True
469 elif match.files(): # match.match without patterns
466 dirignore = util.always # skip step 2
470 dostep3 = False
467 elif match.files() and not match.anypats(): # match.match, no patterns
471 exact = False
468 skipstep3 = True
472 else: # match.always
473 dostep3 = True
474 exact = False
475
476 if exact: # skip step 2
477 dirignore = util.always
478
469
479 files = set(match.files())
470 files = set(match.files())
480 if not files or '.' in files:
471 if not files or '.' in files:
@@ -491,7 +482,7 b' class dirstate(object):'
491 st = lstat(join(nf))
482 st = lstat(join(nf))
492 kind = getkind(st.st_mode)
483 kind = getkind(st.st_mode)
493 if kind == dirkind:
484 if kind == dirkind:
494 dostep3 = True
485 skipstep3 = False
495 if nf in dmap:
486 if nf in dmap:
496 #file deleted on disk but still in dirstate
487 #file deleted on disk but still in dirstate
497 results[nf] = None
488 results[nf] = None
@@ -510,7 +501,7 b' class dirstate(object):'
510 prefix = nf + "/"
501 prefix = nf + "/"
511 for fn in dmap:
502 for fn in dmap:
512 if fn.startswith(prefix):
503 if fn.startswith(prefix):
513 dostep3 = True
504 skipstep3 = False
514 break
505 break
515 else:
506 else:
516 badfn(ff, inst.strerror)
507 badfn(ff, inst.strerror)
@@ -550,7 +541,7 b' class dirstate(object):'
550 results[nf] = None
541 results[nf] = None
551
542
552 # step 3: report unseen items in the dmap hash
543 # step 3: report unseen items in the dmap hash
553 if dostep3 and not exact:
544 if not skipstep3 and not exact:
554 visit = sorted([f for f in dmap if f not in results and matchfn(f)])
545 visit = sorted([f for f in dmap if f not in results and matchfn(f)])
555 for nf, st in zip(visit, util.statfiles([join(i) for i in visit])):
546 for nf, st in zip(visit, util.statfiles([join(i) for i in visit])):
556 if not st is None and not getkind(st.st_mode) in (regkind, lnkkind):
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