revlog: add a flags method that returns revision flags
authorPradeepkumar Gayam <in3xes@gmail.com>
Tue, 27 Jul 2010 01:16:38 +0530
changeset 11693 ff33f937a7da
parent 11681 c5e555e064d0
child 11694 bf49d48e4602
revlog: add a flags method that returns revision flags
mercurial/revlog.py
--- a/mercurial/revlog.py	Sun Jul 25 21:20:05 2010 -0500
+++ b/mercurial/revlog.py	Tue Jul 27 01:16:38 2010 +0530
@@ -533,6 +533,8 @@
         return self.index[rev][1]
     def base(self, rev):
         return self.index[rev][3]
+    def flags(self, rev):
+        return self.index[rev][0] & 0xFFFF
 
     def size(self, rev):
         """return the length of the uncompressed text for a given revision"""
@@ -1020,9 +1022,9 @@
         base = self.base(rev)
 
         # check rev flags
-        if self.index[rev][0] & 0xFFFF:
+        if self.flags(rev):
             raise RevlogError(_('incompatible revision flag %x') %
-                              (self.index[rev][0] & 0xFFFF))
+                              (self.flags(rev)))
 
         # do we have useful data cached?
         if self._cache and self._cache[1] >= base and self._cache[1] < rev: