D4507: ancestors: add nullrev to set from the beginning

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Sat Sep 8 07:38:35 UTC 2018


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4507

AFFECTED FILES
  mercurial/ancestor.py

CHANGE DETAILS

diff --git a/mercurial/ancestor.py b/mercurial/ancestor.py
--- a/mercurial/ancestor.py
+++ b/mercurial/ancestor.py
@@ -311,15 +311,14 @@
 
         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
         stoprev = self._stoprev
         schedule = heapq.heappush
         nextitem = heapq.heappop
         see = seen.add
-        see(nullrev)
 
         if self._inclusive:
             visit = [-r for r in revs]



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list