Show More
@@ -379,8 +379,11 b' class dirstate(object):' | |||
|
379 | 379 | # recursion free walker, faster than os.walk. |
|
380 | 380 | def findfiles(s): |
|
381 | 381 | work = [s] |
|
382 | wadd = work.append | |
|
383 | found = [] | |
|
384 | add = found.append | |
|
382 | 385 | if directories: |
|
383 |
|
|
|
386 | add((normpath(s[common_prefix_len:]), 'd', lstat(s))) | |
|
384 | 387 | while work: |
|
385 | 388 | top = work.pop() |
|
386 | 389 | names = listdir(top) |
@@ -407,16 +410,18 b' class dirstate(object):' | |||
|
407 | 410 | st = lstat(p) |
|
408 | 411 | if s_isdir(st.st_mode): |
|
409 | 412 | if not ignore(np): |
|
410 |
w |
|
|
413 | wadd(p) | |
|
411 | 414 | if directories: |
|
412 |
|
|
|
415 | add((np, 'd', st)) | |
|
413 | 416 | if np in dc and match(np): |
|
414 |
|
|
|
417 | add((np, 'm', st)) | |
|
415 | 418 | elif imatch(np): |
|
416 | 419 | if supported(np, st.st_mode): |
|
417 |
|
|
|
420 | add((np, 'f', st)) | |
|
418 | 421 | elif np in dc: |
|
419 |
|
|
|
422 | add((np, 'm', st)) | |
|
423 | found.sort() | |
|
424 | return found | |
|
420 | 425 | |
|
421 | 426 | # step one, find all files that match our criteria |
|
422 | 427 | files.sort() |
@@ -439,11 +444,8 b' class dirstate(object):' | |||
|
439 | 444 | yield 'b', ff, None |
|
440 | 445 | continue |
|
441 | 446 | if s_isdir(st.st_mode): |
|
442 | cmp1 = (lambda x, y: cmp(x[1], y[1])) | |
|
443 | sorted_ = [ x for x in findfiles(f) ] | |
|
444 | sorted_.sort(cmp1) | |
|
445 | for e in sorted_: | |
|
446 | yield e | |
|
447 | for f, src, st in findfiles(f): | |
|
448 | yield src, f, st | |
|
447 | 449 | else: |
|
448 | 450 | if nf in known: |
|
449 | 451 | continue |
General Comments 0
You need to be logged in to leave comments.
Login now