D3614: py3: check for None before comparing with integers

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Sat May 19 10:41:57 EDT 2018


pulkit created this revision.
Herald added a reviewer: indygreg.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Comparing None and integers on Python 3 is not allowed and raise error.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS

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)



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


More information about the Mercurial-devel mailing list