diff --git a/mercurial/changelog.py b/mercurial/changelog.py
index 42342f9afe011a87e6034b8be142d300d961605e_bWVyY3VyaWFsL2NoYW5nZWxvZy5weQ==..fe5f044b753dec0c2a240f5b33ded398089c17f8_bWVyY3VyaWFsL2NoYW5nZWxvZy5weQ== 100644
--- a/mercurial/changelog.py
+++ b/mercurial/changelog.py
@@ -172,10 +172,10 @@
     def headrevs(self):
         if self.filteredrevs:
             try:
-                return self.index.headrevs(self.filteredrevs)
-            # AttributeError covers non-c-extension environments.
-            # TypeError allows us work with old c extensions.
-            except (AttributeError, TypeError):
+                return self.index.headrevsfiltered(self.filteredrevs)
+            # AttributeError covers non-c-extension environments and
+            # old c extensions without filter handling.
+            except AttributeError:
                 return self._headrevs()
 
         return super(changelog, self).headrevs()