mercurial/ancestor.py
changeset 39477 8eb2145ff0fb
parent 39476 7eadc9407867
child 39481 b6a0e06b0f7d
equal deleted inserted replaced
39476:7eadc9407867 39477:8eb2145ff0fb
   309         revision number order. That order is also topological: a child is
   309         revision number order. That order is also topological: a child is
   310         always emitted before its parent.
   310         always emitted before its parent.
   311 
   311 
   312         If inclusive is True, the source revisions are also yielded. The
   312         If inclusive is True, the source revisions are also yielded. The
   313         reverse revision number order is still enforced."""
   313         reverse revision number order is still enforced."""
   314         seen = set()
   314         seen = {nullrev}
   315         revs = self._initrevs
   315         revs = self._initrevs
   316 
   316 
   317         parentrevs = self._parentrevs
   317         parentrevs = self._parentrevs
   318         stoprev = self._stoprev
   318         stoprev = self._stoprev
   319         schedule = heapq.heappush
   319         schedule = heapq.heappush
   320         nextitem = heapq.heappop
   320         nextitem = heapq.heappop
   321         see = seen.add
   321         see = seen.add
   322         see(nullrev)
       
   323 
   322 
   324         if self._inclusive:
   323         if self._inclusive:
   325             visit = [-r for r in revs]
   324             visit = [-r for r in revs]
   326             seen.update(revs)
   325             seen.update(revs)
   327             heapq.heapify(visit)
   326             heapq.heapify(visit)