py3: check for None before comparing with integers
authorPulkit Goyal <7895pulkit@gmail.com>
Sat, 19 May 2018 18:59:21 +0530
changeset 38090 a4942675de6b
parent 38089 f0fadc5bea21
child 38091 42476b8b738b
py3: check for None before comparing with integers Comparing None and integers on Python 3 is not allowed and raise error. Differential Revision: https://phab.mercurial-scm.org/D3614
mercurial/revlog.py
--- a/mercurial/revlog.py	Sat May 19 18:58:35 2018 +0530
+++ b/mercurial/revlog.py	Sat May 19 18:59:21 2018 +0530
@@ -846,7 +846,7 @@
     def rawsize(self, rev):
         """return the length of the uncompressed text for a given revision"""
         l = self.index[rev][2]
-        if l >= 0:
+        if l is not None and l >= 0:
             return l
 
         t = self.revision(rev, raw=True)