# HG changeset patch # User Yuya Nishihara # Date 1497773762 -32400 # Node ID c7da57bbae96ebdc8435fb33b57a2e0f98f936b1 # Parent b9e2269aeff89ee5ff8665a8537d852d2dadab1a 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. diff -r b9e2269aeff8 -r c7da57bbae96 mercurial/dagop.py --- a/mercurial/dagop.py Sat Jun 17 22:33:23 2017 +0900 +++ b/mercurial/dagop.py Sun Jun 18 17:16:02 2017 +0900 @@ -26,6 +26,9 @@ else: cut = None cl = repo.changelog + + # load input revs lazily to heap so earlier revisions can be yielded + # without fully computing the input revs revs.sort(reverse=True) irevs = iter(revs) h = []