Patchwork [10,of,18] configitems: register the 'server.preferuncompressed' config

login
register
mail settings
Submitter Pierre-Yves David
Date July 2, 2017, 10:25 p.m.
Message ID <cf83311fd9cc6d99facb.1499034327@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/21932/
State Accepted
Headers show

Comments

Pierre-Yves David - July 2, 2017, 10:25 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1498787052 -7200
#      Fri Jun 30 03:44:12 2017 +0200
# Node ID cf83311fd9cc6d99facbd1c53f67800bbfed05ee
# Parent  08d1b1217b40e9c74f06e958a3dbfada01d65c8d
# EXP-Topic config.register.server
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r cf83311fd9cc
configitems: register the 'server.preferuncompressed' config

Patch

diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -125,6 +125,9 @@  coreconfigitem('server', 'disablefullbun
 coreconfigitem('server', 'maxhttpheaderlen',
     default=1024,
 )
+coreconfigitem('server', 'preferuncompressed',
+    default=False,
+)
 coreconfigitem('ui', 'clonebundleprefers',
     default=list,
 )
diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -755,7 +755,7 @@  def _capabilities(repo, proto):
     # copy to prevent modification of the global list
     caps = list(wireprotocaps)
     if streamclone.allowservergeneration(repo):
-        if repo.ui.configbool('server', 'preferuncompressed', False):
+        if repo.ui.configbool('server', 'preferuncompressed'):
             caps.append('stream-preferred')
         requiredformats = repo.requirements & repo.supportedformats
         # if our local revlogs are just revlogv1, add 'stream' cap