##// END OF EJS Templates
dirstate.walk: push sorting up
Matt Mackall -
r6827:c978d675 default
parent child Browse files
Show More
@@ -598,7 +598,7 b' class workingctx(changectx):'
598 598 return self._parents[0].ancestor(c2) # punt on two parents for now
599 599
600 600 def walk(self, match):
601 for fn, st in self._repo.dirstate.walk(match, True, False):
601 for fn, st in util.sort(self._repo.dirstate.walk(match, True, False)):
602 602 yield fn
603 603
604 604 class workingfilectx(filectx):
@@ -469,8 +469,6 b' class dirstate(object):'
469 469 _join = self._join
470 470 work = []
471 471 wadd = work.append
472 found = []
473 add = found.append
474 472
475 473 seen = {'.hg': 1}
476 474
@@ -532,14 +530,12 b' class dirstate(object):'
532 530 if not ignore(nf):
533 531 wadd(nf)
534 532 if nf in dmap and match(nf):
535 add((nf, None))
533 yield nf, None
536 534 elif imatch(nf):
537 535 if supported(nf, st.st_mode):
538 add((nf, st))
536 yield nf, st
539 537 elif nf in dmap:
540 add((nf, None))
541 for e in util.sort(found):
542 yield e
538 yield nf, None
543 539
544 540 # step 3: report unseen items in the dmap hash
545 541 for f in util.sort(dmap):
@@ -968,8 +968,6 b' class localrepository(repo.repository):'
968 968 if working: # we need to scan the working dir
969 969 s = self.dirstate.status(match, listignored, listclean, listunknown)
970 970 cmp, modified, added, removed, deleted, unknown, ignored, clean = s
971 removed.sort()
972 deleted.sort()
973 971
974 972 # check for any possibly clean files
975 973 if parentworking and cmp:
@@ -982,9 +980,8 b' class localrepository(repo.repository):'
982 980 else:
983 981 fixup.append(f)
984 982
985 modified.sort()
986 983 if listclean:
987 clean = util.sort(clean + fixup)
984 clean += fixup
988 985
989 986 # update dirstate for files that are actually clean
990 987 if fixup:
@@ -1017,7 +1014,7 b' class localrepository(repo.repository):'
1017 1014 mf2 = mfmatches(ctx2)
1018 1015
1019 1016 modified, added, clean = [], [], []
1020 for fn in util.sort(mf2):
1017 for fn in mf2:
1021 1018 if fn in mf1:
1022 1019 if (mf1.flags(fn) != mf2.flags(fn) or
1023 1020 (mf1[fn] != mf2[fn] and
@@ -1028,9 +1025,11 b' class localrepository(repo.repository):'
1028 1025 del mf1[fn]
1029 1026 else:
1030 1027 added.append(fn)
1031 removed = util.sort(mf1.keys())
1028 removed = mf1.keys()
1032 1029
1033 return modified, added, removed, deleted, unknown, ignored, clean
1030 r = modified, added, removed, deleted, unknown, ignored, clean
1031 [l.sort() for l in r]
1032 return r
1034 1033
1035 1034 def add(self, list):
1036 1035 wlock = self.wlock()
@@ -10,8 +10,8 b' adding another-empty-file'
10 10 removing empty-file
11 11 adding large-file
12 12 adding tiny-file
13 removing large-file
13 14 adding small-file
14 removing large-file
15 15 removing tiny-file
16 16 recording removal of tiny-file as rename to small-file (82% similar)
17 17 % should all fail
@@ -8,8 +8,8 b' dir/bar_2'
8 8 foo_2
9 9 adding a
10 10 adding c
11 removing a
11 12 adding b
13 removing c
12 14 adding d
13 removing a
14 removing c
15 15 recording removal of a as rename to b (100% similar)
General Comments 0
You need to be logged in to leave comments. Login now