comparison hgext/simple4server.py @ 875:10867a8e27c6

exchange: properly wrap wireprotocol capabilities Just wrapping the module function only works for ssh. Ssh gets capability through the `hello` command. We also need to wrap the function stored in the command dict. This fix discovery for http peer.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 10 Mar 2014 21:34:36 -0700
parents 19a7ed6384a9
children 8c9601a6c4e0
comparison
equal deleted inserted replaced
874:19a7ed6384a9 875:10867a8e27c6
221 hgweb_mod.perms['evoext_pushobsmarkers_0'] = 'push' 221 hgweb_mod.perms['evoext_pushobsmarkers_0'] = 'push'
222 hgweb_mod.perms['evoext_pullobsmarkers_0'] = 'pull' 222 hgweb_mod.perms['evoext_pullobsmarkers_0'] = 'pull'
223 hgweb_mod.perms['evoext_obshash'] = 'pull' 223 hgweb_mod.perms['evoext_obshash'] = 'pull'
224 wireproto.commands['evoext_pushobsmarkers_0'] = (srv_pushobsmarkers, '') 224 wireproto.commands['evoext_pushobsmarkers_0'] = (srv_pushobsmarkers, '')
225 wireproto.commands['evoext_pullobsmarkers_0'] = (srv_pullobsmarkers, '*') 225 wireproto.commands['evoext_pullobsmarkers_0'] = (srv_pullobsmarkers, '*')
226 # wrap module content
226 extensions.wrapfunction(wireproto, 'capabilities', capabilities) 227 extensions.wrapfunction(wireproto, 'capabilities', capabilities)
228 # wrap command content
229 oldcap, args = wireproto.commands['capabilities']
230 def newcap(repo, proto):
231 return capabilities(oldcap, repo, proto)
232 wireproto.commands['capabilities'] = (newcap, args)
227 wireproto.commands['evoext_obshash'] = (srv_obshash, 'nodes') 233 wireproto.commands['evoext_obshash'] = (srv_obshash, 'nodes')