Show More
@@ -474,7 +474,7 b' class dirstate(object):' | |||||
474 |
|
474 | |||
475 | seen = {'.hg': 1} |
|
475 | seen = {'.hg': 1} | |
476 |
|
476 | |||
477 |
# step |
|
477 | # step 1: find all explicit files | |
478 | for ff in util.sort(files): |
|
478 | for ff in util.sort(files): | |
479 | nf = normalize(normpath(ff)) |
|
479 | nf = normalize(normpath(ff)) | |
480 | if nf in seen: |
|
480 | if nf in seen: | |
@@ -495,55 +495,53 b' class dirstate(object):' | |||||
495 | yield nf, None |
|
495 | yield nf, None | |
496 | continue |
|
496 | continue | |
497 |
|
497 | |||
498 |
if |
|
498 | if s_isdir(st.st_mode): | |
|
499 | if not dirignore(nf): | |||
|
500 | wadd(nf) | |||
|
501 | else: | |||
499 | seen[nf] = 1 |
|
502 | seen[nf] = 1 | |
500 | if supported(ff, st.st_mode, verbose=True): |
|
503 | if supported(ff, st.st_mode, verbose=True): | |
501 | yield nf, st |
|
504 | yield nf, st | |
502 | elif nf in dmap: |
|
505 | elif nf in dmap: | |
503 | yield nf, None |
|
506 | yield nf, None | |
504 | continue |
|
|||
505 |
|
||||
506 | if dirignore(nf): |
|
|||
507 | continue |
|
|||
508 |
|
507 | |||
509 | wadd(nf) |
|
508 | # step 2: visit subdirectories | |
510 |
|
|
509 | while work: | |
511 |
|
|
510 | nd = work.pop() | |
512 |
|
|
511 | if hasattr(match, 'dir'): | |
513 |
|
|
512 | match.dir(nd) | |
514 |
|
|
513 | entries = listdir(_join(nd), stat=True) | |
515 |
|
|
514 | # nd is the top of the repository dir tree | |
516 |
|
|
515 | if nd == '.': | |
517 |
|
|
516 | nd = '' | |
518 |
|
|
517 | else: | |
519 |
|
|
518 | # do not recurse into a repo contained in this | |
520 |
|
|
519 | # one. use bisect to find .hg directory so speed | |
521 |
|
|
520 | # is good on big directory. | |
522 |
|
|
521 | hg = bisect_left(entries, ('.hg')) | |
523 |
|
|
522 | if hg < len(entries) and entries[hg][0] == '.hg' \ | |
524 |
|
|
523 | and entries[hg][1] == stat.S_IFDIR: | |
525 | continue |
|
|||
526 | for f, kind, st in entries: |
|
|||
527 | nf = normalize(pconvert(join(nd, f))) |
|
|||
528 | if nf in seen: |
|
|||
529 | continue |
|
524 | continue | |
530 | seen[nf] = 1 |
|
525 | for f, kind, st in entries: | |
531 | # don't trip over symlinks |
|
526 | nf = normalize(pconvert(join(nd, f))) | |
532 |
|
|
527 | if nf in seen: | |
533 |
|
|
528 | continue | |
534 | wadd(nf) |
|
529 | seen[nf] = 1 | |
535 | if nf in dmap and match(nf): |
|
530 | # don't trip over symlinks | |
536 | add((nf, None)) |
|
531 | if kind == stat.S_IFDIR: | |
537 |
|
|
532 | if not ignore(nf): | |
538 |
|
|
533 | wadd(nf) | |
539 |
|
|
534 | if nf in dmap and match(nf): | |
540 |
|
|
535 | add((nf, None)) | |
541 | add((nf, None)) |
|
536 | elif imatch(nf): | |
542 | for e in util.sort(found): |
|
537 | if supported(nf, st.st_mode): | |
543 |
|
|
538 | add((nf, st)) | |
|
539 | elif nf in dmap: | |||
|
540 | add((nf, None)) | |||
|
541 | for e in util.sort(found): | |||
|
542 | yield e | |||
544 |
|
543 | |||
545 |
# step |
|
544 | # step 3: report unseen items in the dmap hash | |
546 | # if we haven't already seen it |
|
|||
547 | for f in util.sort(dmap): |
|
545 | for f in util.sort(dmap): | |
548 | if f in seen or not match(f): |
|
546 | if f in seen or not match(f): | |
549 | continue |
|
547 | continue |
General Comments 0
You need to be logged in to leave comments.
Login now