changeset 5004:825516d16b25

revlog: move flag checking out of the offset fastpath
author Matt Mackall <mpm@selenic.com>
date Thu, 26 Jul 2007 12:02:58 -0500
parents 4b1acb3ecb3c
children 72082bfced9a
files mercurial/revlog.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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