--- a/mercurial/bundle2.py Wed Oct 10 17:36:59 2018 +0300
+++ b/mercurial/bundle2.py Wed Sep 26 17:20:04 2018 +0300
@@ -1687,7 +1687,18 @@
# to avoid compression to consumers of the bundle.
bundler.prefercompressed = False
- filecount, bytecount, it = streamclone.generatev2(repo)
+ # get the includes and excludes
+ includepats = kwargs.get(r'includepats')
+ excludepats = kwargs.get(r'excludepats')
+
+ narrowstream = repo.ui.configbool('experimental.server',
+ 'stream-narrow-clones')
+
+ if (includepats or excludepats) and not narrowstream:
+ raise error.Abort(_('server does not support narrow stream clones'))
+
+ filecount, bytecount, it = streamclone.generatev2(repo, includepats,
+ excludepats)
requirements = _formatrequirementsspec(repo.requirements)
part = bundler.newpart('stream2', data=it)
part.addparam('bytecount', '%d' % bytecount, mandatory=True)