mercurial/revlogutils/revlogv0.py
changeset 51975 609700e5d8df
parent 51965 22da1dc97281
child 52643 5cc8deb96b48
--- a/mercurial/revlogutils/revlogv0.py	Thu Sep 26 01:52:09 2024 +0200
+++ b/mercurial/revlogutils/revlogv0.py	Fri Sep 27 03:55:40 2024 +0200
@@ -111,8 +111,10 @@
         )
         return INDEX_ENTRY_V0.pack(*e2)
 
-    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 [node.nullrev]
         # we won't iter over filtered rev so nobody is a head at start