##// END OF EJS Templates
commit: trade O(n^2) file checks for O(n^2) dir checks
Matt Mackall -
r8710:bcb6e5be default
parent child Browse files
Show More
@@ -808,17 +808,19 b' class localrepository(repo.repository):'
808 808
809 809 # make sure all explicit patterns are matched
810 810 if not force and match.files():
811 files = sorted(changes[0] + changes[1] + changes[2])
811 matched = set(changes[0] + changes[1] + changes[2])
812 812
813 813 for f in match.files():
814 if f == '.' or f in files: # matched
814 if f == '.' or f in matched: # matched
815 815 continue
816 816 if f in changes[3]: # missing
817 817 fail(f, _('file not found!'))
818 818 if f in vdirs: # visited directory
819 819 d = f + '/'
820 i = bisect.bisect(files, d)
821 if i >= len(files) or not files[i].startswith(d):
820 for mf in matched:
821 if mf.startswith(d):
822 break
823 else:
822 824 fail(f, _("no match under directory!"))
823 825 elif f not in self.dirstate:
824 826 fail(f, _("file not tracked!"))
General Comments 0
You need to be logged in to leave comments. Login now