changeset 39477:8eb2145ff0fb

ancestors: add nullrev to set from the beginning Differential Revision: https://phab.mercurial-scm.org/D4507
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 07 Sep 2018 14:48:38 -0700
parents 7eadc9407867
children c4a7ba10cdd7
files mercurial/ancestor.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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]