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,19 +549,17 b' class dirstate(object):' | |||
|
582 | 549 | if nn in known: |
|
583 | 550 | continue |
|
584 | 551 | known[nn] = 1 |
|
585 | if match(nf): | |
|
586 | 552 |
|
|
587 |
|
|
|
553 | yield self.normalize(nf), st | |
|
588 | 554 |
|
|
589 | 555 |
|
|
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 | if imatch(f): | |
|
598 | 563 |
|
|
599 | 564 |
|
|
600 | 565 |
|
General Comments 0
You need to be logged in to leave comments.
Login now