mercurial/localrepo.py
changeset 42043 1fac9b931d46
parent 42004 0bd730fbcc2b
child 42044 bb271ec2fbfb
--- a/mercurial/localrepo.py	Wed Mar 27 19:34:10 2019 +0100
+++ b/mercurial/localrepo.py	Wed Mar 27 18:35:27 2019 +0100
@@ -797,6 +797,12 @@
         if r.startswith(b'exp-compression-'):
             options[b'compengine'] = r[len(b'exp-compression-'):]
 
+    options[b'zlib.level'] = ui.configint(b'storage', b'revlog.zlib.level')
+    if options[b'zlib.level'] is not None:
+        if not (0 <= options[b'zlib.level'] <= 9):
+            msg = _('invalid value for `storage.revlog.zlib.level` config: %d')
+            raise error.Abort(msg % options[b'zlib.level'])
+
     if repository.NARROW_REQUIREMENT in requirements:
         options[b'enableellipsis'] = True