[PATCH 05 of 17 RFC] clfilter: split `revlog.headrevs` C call from python code

pierre-yves.david at logilab.fr pierre-yves.david at logilab.fr
Mon Sep 3 07:58:29 CDT 2012

# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1346674785 -7200
# Node ID 27c1b57964bf1b37e9a8c5bb6de91dd344d4d00b
# Parent  36e21910851f62730e61e2686e44de2cc74dcac4
clfilter: split `revlog.headrevs` C call from python code

Make the pure python implementation of headrevs available to derived classes. It
is important because filtering logic applied by `revlog` derived class won't
have effect on `index`. We want to be able to bypass this C call to implement
our own.

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -605,11 +605,13 @@ class revlog(object):
     def headrevs(self):
             return self.index.headrevs()
         except AttributeError:
-            pass
+            return self._headrevs()
+    def _headrevs(self):
         count = len(self)
         if not count:
             return [nullrev]
         # we won't iter over filtered rev so nobody is a head at start
         ishead = [0] * (count + 1)

More information about the Mercurial-devel mailing list