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

login
register
mail settings
Submitter Gregory Szorc
Date March 14, 2017, 7:33 p.m.
Message ID <5e02fae5419fcd9462b5.1489519986@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/19335/
State Accepted
Headers show

Comments

Gregory Szorc - March 14, 2017, 7:33 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@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.

Patch

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