mercurial/exchange.py
changeset 35791 9adae6a20e1f
parent 35788 b116a66bcc44
child 35812 84965e5f3241
--- 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.