comparison mercurial/wireprotov1server.py @ 40076:ad8d8dc9be3f

narrow: move adding of narrow server capabilities to core We use the experimental.narrow config option introduced in one of the previous patch and move the functionality of adding narrow server capabilities to core. Differential Revision: https://phab.mercurial-scm.org/D4891
author Pulkit Goyal <pulkit@yandex-team.ru>
date Fri, 05 Oct 2018 22:52:24 +0300
parents 7e4a856a4f05
children 876494fd967d
comparison
equal deleted inserted replaced
40075:f7011b44d205 40076:ad8d8dc9be3f
283 caps.append('streamreqs=%s' % ','.join(sorted(requiredformats))) 283 caps.append('streamreqs=%s' % ','.join(sorted(requiredformats)))
284 if repo.ui.configbool('experimental', 'bundle2-advertise'): 284 if repo.ui.configbool('experimental', 'bundle2-advertise'):
285 capsblob = bundle2.encodecaps(bundle2.getrepocaps(repo, role='server')) 285 capsblob = bundle2.encodecaps(bundle2.getrepocaps(repo, role='server'))
286 caps.append('bundle2=' + urlreq.quote(capsblob)) 286 caps.append('bundle2=' + urlreq.quote(capsblob))
287 caps.append('unbundle=%s' % ','.join(bundle2.bundlepriority)) 287 caps.append('unbundle=%s' % ','.join(bundle2.bundlepriority))
288
289 if repo.ui.configbool('experimental', 'narrow'):
290 caps.append(wireprototypes.NARROWCAP)
291 if repo.ui.configbool('experimental', 'narrowservebrokenellipses'):
292 caps.append(wireprototypes.ELLIPSESCAP)
288 293
289 return proto.addcapabilities(repo, caps) 294 return proto.addcapabilities(repo, caps)
290 295
291 # If you are writing an extension and consider wrapping this function. Wrap 296 # If you are writing an extension and consider wrapping this function. Wrap
292 # `_capabilities` instead. 297 # `_capabilities` instead.