ancestors: add nullrev to set from the beginning
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 07 Sep 2018 14:48:38 -0700
changeset 39477 8eb2145ff0fb
parent 39476 7eadc9407867
child 39478 c4a7ba10cdd7
ancestors: add nullrev to set from the beginning Differential Revision: https://phab.mercurial-scm.org/D4507
mercurial/ancestor.py
--- a/mercurial/ancestor.py	Sat Sep 08 10:59:24 2018 +0900
+++ b/mercurial/ancestor.py	Fri Sep 07 14:48:38 2018 -0700
@@ -311,7 +311,7 @@
 
         If inclusive is True, the source revisions are also yielded. The
         reverse revision number order is still enforced."""
-        seen = set()
+        seen = {nullrev}
         revs = self._initrevs
 
         parentrevs = self._parentrevs
@@ -319,7 +319,6 @@
         schedule = heapq.heappush
         nextitem = heapq.heappop
         see = seen.add
-        see(nullrev)
 
         if self._inclusive:
             visit = [-r for r in revs]