[PATCH 1 of 3] revlog: explicitly check _maxchainlen for None

Gregory Szorc gregory.szorc at gmail.com
Tue Mar 14 19:33:06 UTC 2017


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1489518182 25200
#      Tue Mar 14 12:03:02 2017 -0700
# Node ID 5e02fae5419fcd9462b5be11f7f6d6dc4a04fc92
# Parent  ed23f929af38e3249a4c0b258939e89782b20795
revlog: explicitly check _maxchainlen for None

I'm writing a test that needs to force a new fulltext. It is easier
if I can set maxchainlen=0.

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1560,7 +1560,7 @@ class revlog(object):
         dist, l, data, base, chainbase, chainlen, compresseddeltalen = d
         if (dist > textlen * 4 or l > textlen or
             compresseddeltalen > textlen * 2 or
-            (self._maxchainlen and chainlen > self._maxchainlen)):
+            (self._maxchainlen is not None and chainlen > self._maxchainlen)):
             return False
 
         return True


More information about the Mercurial-devel mailing list