comparison mercurial/wireproto.py @ 37539:4a0d58d6faba

wireproto: only expose "getbundle" and "unbundle" to v1 transports These are the most complicated wire protocol commands. I don't want to deal with porting them just yet. Let's disable both of them on version 2 transports so we drive the final wedge between command handlers and start to evolve version 2 command handlers more. Differential Revision: https://phab.mercurial-scm.org/D3206
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 09 Apr 2018 11:54:31 -0700
parents 89fed81bbb6c
children 693cb3768943
comparison
equal deleted inserted replaced
37538:89fed81bbb6c 37539:4a0d58d6faba
1017 except IOError: 1017 except IOError:
1018 repo.ui.debug('pullbundle "%s" not accessible\n' % path) 1018 repo.ui.debug('pullbundle "%s" not accessible\n' % path)
1019 continue 1019 continue
1020 return None 1020 return None
1021 1021
1022 @wireprotocommand('getbundle', '*', permission='pull') 1022 @wireprotocommand('getbundle', '*', permission='pull',
1023 transportpolicy=POLICY_V1_ONLY)
1023 def getbundle(repo, proto, others): 1024 def getbundle(repo, proto, others):
1024 opts = options('getbundle', gboptsmap.keys(), others) 1025 opts = options('getbundle', gboptsmap.keys(), others)
1025 for k, v in opts.iteritems(): 1026 for k, v in opts.iteritems():
1026 keytype = gboptsmap[k] 1027 keytype = gboptsmap[k]
1027 if keytype == 'nodes': 1028 if keytype == 'nodes':
1176 it is serving. Client checks to see if it understands the format. 1177 it is serving. Client checks to see if it understands the format.
1177 ''' 1178 '''
1178 return wireprototypes.streamreslegacy( 1179 return wireprototypes.streamreslegacy(
1179 streamclone.generatev1wireproto(repo)) 1180 streamclone.generatev1wireproto(repo))
1180 1181
1181 @wireprotocommand('unbundle', 'heads', permission='push') 1182 @wireprotocommand('unbundle', 'heads', permission='push',
1183 transportpolicy=POLICY_V1_ONLY)
1182 def unbundle(repo, proto, heads): 1184 def unbundle(repo, proto, heads):
1183 their_heads = decodelist(heads) 1185 their_heads = decodelist(heads)
1184 1186
1185 with proto.mayberedirectstdio() as output: 1187 with proto.mayberedirectstdio() as output:
1186 try: 1188 try: