diff --git a/mercurial/ancestor.py b/mercurial/ancestor.py
--- a/mercurial/ancestor.py
+++ b/mercurial/ancestor.py
@@ -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]