filelog: use censored revlog flag bit to quickly check if a node is censored
authorMike Edgar <adgar@google.com>
Mon, 12 Jan 2015 15:29:36 -0500
changeset 23858 22a979d1ae56
parent 23857 8a3c132f93d2
child 23859 661b246bf1c4
filelog: use censored revlog flag bit to quickly check if a node is censored
mercurial/filelog.py
--- a/mercurial/filelog.py	Mon Jan 12 14:41:25 2015 -0500
+++ b/mercurial/filelog.py	Mon Jan 12 15:29:36 2015 -0500
@@ -85,7 +85,7 @@
             return False
 
         # censored files compare against the empty file
-        if self._iscensored(node):
+        if self._iscensored(self.rev(node)):
             return text != ''
 
         # renaming a file produces a different hash, even if the data
@@ -107,10 +107,6 @@
     def _file(self, f):
         return filelog(self.opener, f)
 
-    def _iscensored(self, revornode):
+    def _iscensored(self, rev):
         """Check if a file revision is censored."""
-        try:
-            self.revision(revornode)
-            return False
-        except error.CensoredNodeError:
-            return True
+        return self.flags(rev) & revlog.REVIDX_ISCENSORED