comparison mercurial/dagop.py @ 32998:c7da57bbae96

dagop: comment why revancestors() doesn't heapify input revs at once I wondered why we're doing this complicated stuff without noticing the input revs may be iterated lazily in descending order. c1f666e27345 showed why.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 18 Jun 2017 17:16:02 +0900
parents b9e2269aeff8
children 08e2793d9f65
comparison
equal deleted inserted replaced
32997:b9e2269aeff8 32998:c7da57bbae96
24 if followfirst: 24 if followfirst:
25 cut = 1 25 cut = 1
26 else: 26 else:
27 cut = None 27 cut = None
28 cl = repo.changelog 28 cl = repo.changelog
29
30 # load input revs lazily to heap so earlier revisions can be yielded
31 # without fully computing the input revs
29 revs.sort(reverse=True) 32 revs.sort(reverse=True)
30 irevs = iter(revs) 33 irevs = iter(revs)
31 h = [] 34 h = []
32 35
33 inputrev = next(irevs, None) 36 inputrev = next(irevs, None)