diff mercurial/exchange.py @ 35791:9adae6a20e1f

exchange: don't send stream data when server.uncompressed is set Previously, bundle2 stream support would send out data even though the streaming clone feature was disabled. This commit changes the part handler to respect the server config. Differential Revision: https://phab.mercurial-scm.org/D1930
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 22 Jan 2018 12:22:01 -0800
parents b116a66bcc44
children 84965e5f3241
line wrap: on
line diff
--- a/mercurial/exchange.py	Mon Jan 22 12:21:15 2018 -0800
+++ b/mercurial/exchange.py	Mon Jan 22 12:22:01 2018 -0800
@@ -1773,6 +1773,13 @@
     if not kwargs.get('stream', False):
         return
 
+    if not streamclone.allowservergeneration(repo):
+        raise error.Abort(_('stream data requested but server does not allow '
+                            'this feature'),
+                          hint=_('well-behaved clients should not be '
+                                 'requesting stream data from servers not '
+                                 'advertising it; the client may be buggy'))
+
     # Stream clones don't compress well. And compression undermines a
     # goal of stream clones, which is to be fast. Communicate the desire
     # to avoid compression to consumers of the bundle.