Patchwork D3614: py3: check for None before comparing with integers

login
register
mail settings
Submitter phabricator
Date May 19, 2018, 7:40 p.m.
Message ID <ee8e0fc82e817ad1057268687e1cebd1@localhost.localdomain>
Download mbox | patch
Permalink /patch/31737/
State Not Applicable
Headers show

Comments

phabricator - May 19, 2018, 7:40 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa4942675de6b: py3: check for None before comparing with integers (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3614?vs=8785&id=8819

REVISION DETAIL
  https://phab.mercurial-scm.org/D3614

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS




To: pulkit, indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -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)