Show More
@@ -1172,12 +1172,34 b' def walkchangerevs(repo, match, opts, pr' | |||
|
1172 | 1172 | 'filenames')) |
|
1173 | 1173 | |
|
1174 | 1174 | # The slow path checks files modified in every changeset. |
|
1175 | for i in sorted(revs): | |
|
1176 | ctx = change(i) | |
|
1177 | matches = filter(match, ctx.files()) | |
|
1178 | if matches: | |
|
1179 |
|
|
|
1180 | wanted.add(i) | |
|
1175 | # This is really slow on large repos, so compute the set lazily. | |
|
1176 | class lazywantedset(object): | |
|
1177 | def __init__(self): | |
|
1178 | self.set = set() | |
|
1179 | self.revs = set(revs) | |
|
1180 | ||
|
1181 | # No need to worry about locality here because it will be accessed | |
|
1182 | # in the same order as the increasing window below. | |
|
1183 | def __contains__(self, value): | |
|
1184 | if value in self.set: | |
|
1185 | return True | |
|
1186 | elif not value in self.revs: | |
|
1187 | return False | |
|
1188 | else: | |
|
1189 | self.revs.discard(value) | |
|
1190 | ctx = change(value) | |
|
1191 | matches = filter(match, ctx.files()) | |
|
1192 | if matches: | |
|
1193 | fncache[value] = matches | |
|
1194 | self.set.add(value) | |
|
1195 | return True | |
|
1196 | return False | |
|
1197 | ||
|
1198 | def discard(self, value): | |
|
1199 | self.revs.discard(value) | |
|
1200 | self.set.discard(value) | |
|
1201 | ||
|
1202 | wanted = lazywantedset() | |
|
1181 | 1203 | |
|
1182 | 1204 | class followfilter(object): |
|
1183 | 1205 | def __init__(self, onlyfirst=False): |
General Comments 0
You need to be logged in to leave comments.
Login now