mercurial/pure/parsers.py
changeset 51975 609700e5d8df
parent 51965 22da1dc97281
child 52163 7346f93be7a4
--- a/mercurial/pure/parsers.py	Thu Sep 26 01:52:09 2024 +0200
+++ b/mercurial/pure/parsers.py	Fri Sep 27 03:55:40 2024 +0200
@@ -696,8 +696,10 @@
             p = p[revlog_constants.INDEX_HEADER.size :]
         return p
 
-    def headrevs(self, excluded_revs=None):
+    def headrevs(self, excluded_revs=None, stop_rev=None):
         count = len(self)
+        if stop_rev is not None:
+            count = min(count, stop_rev)
         if not count:
             return [nullrev]
         # we won't iter over filtered rev so nobody is a head at start