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