Show More
@@ -401,35 +401,6 b' class dirstate(object):' | |||
|
401 | 401 | st.rename() |
|
402 | 402 | self._dirty = self._dirtypl = False |
|
403 | 403 | |
|
404 | def _filter(self, files): | |
|
405 | ret = {} | |
|
406 | unknown = [] | |
|
407 | ||
|
408 | for x in files: | |
|
409 | if x == '.': | |
|
410 | return self._map.copy() | |
|
411 | if x not in self._map: | |
|
412 | unknown.append(x) | |
|
413 | else: | |
|
414 | ret[x] = self._map[x] | |
|
415 | ||
|
416 | if not unknown: | |
|
417 | return ret | |
|
418 | ||
|
419 | b = util.sort(self._map) | |
|
420 | blen = len(b) | |
|
421 | ||
|
422 | for x in unknown: | |
|
423 | bs = bisect.bisect(b, "%s%s" % (x, '/')) | |
|
424 | while bs < blen: | |
|
425 | s = b[bs] | |
|
426 | if len(s) > len(x) and s.startswith(x): | |
|
427 | ret[s] = self._map[s] | |
|
428 | else: | |
|
429 | break | |
|
430 | bs += 1 | |
|
431 | return ret | |
|
432 | ||
|
433 | 404 | def _supported(self, f, mode, verbose=False): |
|
434 | 405 | if stat.S_ISREG(mode) or stat.S_ISLNK(mode): |
|
435 | 406 | return True |
@@ -470,14 +441,10 b' class dirstate(object):' | |||
|
470 | 441 | if hasattr(match, 'bad'): |
|
471 | 442 | badfn = match.bad |
|
472 | 443 | |
|
473 | # walk all files by default | |
|
474 |
files |
|
|
475 |
|
|
|
476 | files = ['.'] | |
|
477 | dc = self._map.copy() | |
|
478 | else: | |
|
479 | files = util.unique(files) | |
|
480 | dc = self._filter(files) | |
|
444 | files = util.unique(match.files()) | |
|
445 | if not files or '.' in files: | |
|
446 | files = [''] | |
|
447 | dc = self._map | |
|
481 | 448 | |
|
482 | 449 | def imatch(file_): |
|
483 | 450 | if file_ not in dc and self._ignore(file_): |
@@ -582,28 +549,26 b' class dirstate(object):' | |||
|
582 | 549 | if nn in known: |
|
583 | 550 | continue |
|
584 | 551 | known[nn] = 1 |
|
585 | if match(nf): | |
|
586 | if supported(ff, st.st_mode, verbose=True): | |
|
587 | yield nn, st | |
|
588 |
|
|
|
589 | yield nf, None | |
|
552 | if supported(ff, st.st_mode, verbose=True): | |
|
553 | yield self.normalize(nf), st | |
|
554 | elif ff in dc: | |
|
555 | yield nf, None | |
|
590 | 556 | |
|
591 | 557 | # step two run through anything left in the dc hash and yield |
|
592 | 558 | # if we haven't already seen it |
|
593 | 559 | for f in util.sort(dc): |
|
594 | if f in known: | |
|
560 | if f in known or not match(f): | |
|
595 | 561 | continue |
|
596 | 562 | known[f] = 1 |
|
597 |
|
|
|
598 |
|
|
|
599 | st = lstat(_join(f)) | |
|
600 |
|
|
|
601 |
|
|
|
602 | continue | |
|
603 | except OSError, inst: | |
|
604 | if inst.errno not in (errno.ENOENT, errno.ENOTDIR): | |
|
605 | raise | |
|
606 | yield f, None | |
|
563 | try: | |
|
564 | st = lstat(_join(f)) | |
|
565 | if supported(f, st.st_mode): | |
|
566 | yield f, st | |
|
567 | continue | |
|
568 | except OSError, inst: | |
|
569 | if inst.errno not in (errno.ENOENT, errno.ENOTDIR): | |
|
570 | raise | |
|
571 | yield f, None | |
|
607 | 572 | |
|
608 | 573 | def status(self, match, ignored, clean, unknown): |
|
609 | 574 | listignored, listclean, listunknown = ignored, clean, unknown |
General Comments 0
You need to be logged in to leave comments.
Login now