revlog: use a symbolic constant for the deltas/text ration
We are about to use it somewhere else, we should as well make it easier to
access and change.
--- a/mercurial/revlog.py Fri Jul 27 14:37:31 2018 +0200
+++ b/mercurial/revlog.py Tue Aug 14 13:47:07 2018 -0700
@@ -809,6 +809,9 @@
return (0, 0, 0, -1, -1, -1, -1, nullid)
return list.__getitem__(self, i)
+# maximum <delta-chain-data>/<revision-text-length> ratio
+LIMIT_DELTA2TEXT = 2
+
class revlogoldio(object):
def __init__(self):
self.size = indexformatv0.size
@@ -2493,7 +2496,7 @@
# Bad delta from cumulated payload size:
#
# If the sum of delta get larger than K * target text length.
- if textlen * 2 < deltainfo.compresseddeltalen:
+ if textlen * LIMIT_DELTA2TEXT < deltainfo.compresseddeltalen:
return False
# Bad delta from chain length: