Show More
@@ -401,7 +401,29 b' class revlog(object):' | |||||
401 | heads = [self.rev(n) for n in heads] |
|
401 | heads = [self.rev(n) for n in heads] | |
402 |
|
402 | |||
403 | # we want the ancestors, but inclusive |
|
403 | # we want the ancestors, but inclusive | |
404 | has = set(self.ancestors(common)) |
|
404 | class lazyset(object): | |
|
405 | def __init__(self, lazyvalues): | |||
|
406 | self.addedvalues = set() | |||
|
407 | self.lazyvalues = lazyvalues | |||
|
408 | ||||
|
409 | def __contains__(self, value): | |||
|
410 | return value in self.addedvalues or value in self.lazyvalues | |||
|
411 | ||||
|
412 | def __iter__(self): | |||
|
413 | added = self.addedvalues | |||
|
414 | for r in added: | |||
|
415 | yield r | |||
|
416 | for r in self.lazyvalues: | |||
|
417 | if not r in added: | |||
|
418 | yield r | |||
|
419 | ||||
|
420 | def add(self, value): | |||
|
421 | self.addedvalues.add(value) | |||
|
422 | ||||
|
423 | def update(self, values): | |||
|
424 | self.addedvalues.update(values) | |||
|
425 | ||||
|
426 | has = lazyset(self.ancestors(common)) | |||
405 | has.add(nullrev) |
|
427 | has.add(nullrev) | |
406 | has.update(common) |
|
428 | has.update(common) | |
407 |
|
429 |
General Comments 0
You need to be logged in to leave comments.
Login now