revlog: move flag checking out of the offset fastpath
authorMatt Mackall <mpm@selenic.com>
Thu, 26 Jul 2007 12:02:58 -0500
changeset 5004 825516d16b25
parent 5003 4b1acb3ecb3c
child 5005 72082bfced9a
revlog: move flag checking out of the offset fastpath
mercurial/revlog.py
--- a/mercurial/revlog.py	Thu Jul 26 12:02:58 2007 -0500
+++ b/mercurial/revlog.py	Thu Jul 26 12:02:58 2007 -0500
@@ -29,8 +29,6 @@
     pass
 
 def getoffset(q):
-    if q & 0xFFFF:
-        raise RevlogError(_('incompatible revision flag %x') % q)
     return int(q >> 16)
 
 def gettype(q):
@@ -907,6 +905,10 @@
         rev = self.rev(node)
         base = self.base(rev)
 
+        # check rev flags
+        if self.index[rev][0] & 0xFFFF:
+            raise RevlogError(_('incompatible revision flag %x') % q)
+
         if self._inline:
             # we probably have the whole chunk cached
             df = None