comparison mercurial/wireprotov2server.py @ 37657:23c4ddda7bbe

wireproto: expose repository formats via capabilities Servers need to expose their set of repository storage requirements in order to facilitate streaming clones (clients need to know if they are capable of reading the raw storage files that the server exposes). Differential Revision: https://phab.mercurial-scm.org/D3335
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 13 Apr 2018 12:50:47 -0700
parents b2fa1591fb44
children 89a16704114c
comparison
equal deleted inserted replaced
37656:e6870bca1f47 37657:23c4ddda7bbe
17 ) 17 )
18 from . import ( 18 from . import (
19 encoding, 19 encoding,
20 error, 20 error,
21 pycompat, 21 pycompat,
22 streamclone,
22 util, 23 util,
23 wireproto, 24 wireproto,
24 wireprotoframing, 25 wireprotoframing,
25 wireprototypes, 26 wireprototypes,
26 ) 27 )
392 caps['commands'][command] = { 393 caps['commands'][command] = {
393 'args': entry.args, 394 'args': entry.args,
394 'permissions': [entry.permission], 395 'permissions': [entry.permission],
395 } 396 }
396 397
398 if streamclone.allowservergeneration(repo):
399 caps['rawrepoformats'] = sorted(repo.requirements &
400 repo.supportedformats)
401
397 return proto.addcapabilities(repo, caps) 402 return proto.addcapabilities(repo, caps)
398 403
399 def wireprotocommand(*args, **kwargs): 404 def wireprotocommand(*args, **kwargs):
400 def register(func): 405 def register(func):
401 return wireproto.wireprotocommand( 406 return wireproto.wireprotocommand(