Mercurial > hg
comparison hgext/remotefilelog/remotefilelogserver.py @ 40511:466dd4d70bff
remotefilelog: rename wireproto methods and remaining capabilities
This is a mess, in part because there should be more constants
throughout. I know we typically do exp- instead of the x_ business in
this change, but I also had to use this in some function names, so I
figured until I can break that coupling I'd go with this. If it's too
unpleasant during review, let me know and I can probably clean it up
some more.
# no-check-commit due to new foo_bar naming - too hard to avoid right now :(
Differential Revision: https://phab.mercurial-scm.org/D5129
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 04 Oct 2018 10:03:10 -0400 |
parents | fc2766860796 |
children | 6f0b6905ef6f |
comparison
equal
deleted
inserted
replaced
40510:fc2766860796 | 40511:466dd4d70bff |
---|---|
75 return | 75 return |
76 onetime = True | 76 onetime = True |
77 | 77 |
78 # support file content requests | 78 # support file content requests |
79 wireprotov1server.wireprotocommand( | 79 wireprotov1server.wireprotocommand( |
80 'getflogheads', 'path', permission='pull')(getflogheads) | 80 'x_rfl_getflogheads', 'path', permission='pull')(getflogheads) |
81 wireprotov1server.wireprotocommand( | 81 wireprotov1server.wireprotocommand( |
82 'getfiles', '', permission='pull')(getfiles) | 82 'x_rfl_getfiles', '', permission='pull')(getfiles) |
83 wireprotov1server.wireprotocommand( | 83 wireprotov1server.wireprotocommand( |
84 'getfile', 'file node', permission='pull')(getfile) | 84 'x_rfl_getfile', 'file node', permission='pull')(getfile) |
85 | 85 |
86 class streamstate(object): | 86 class streamstate(object): |
87 match = None | 87 match = None |
88 shallowremote = False | 88 shallowremote = False |
89 noflatmf = False | 89 noflatmf = False |
196 if ((constants.SHALLOWREPO_REQUIREMENT in repo.requirements or | 196 if ((constants.SHALLOWREPO_REQUIREMENT in repo.requirements or |
197 ui.configbool('remotefilelog', 'server'))): | 197 ui.configbool('remotefilelog', 'server'))): |
198 if isinstance(proto, _sshv1server): | 198 if isinstance(proto, _sshv1server): |
199 # legacy getfiles method which only works over ssh | 199 # legacy getfiles method which only works over ssh |
200 caps.append(constants.NETWORK_CAP_LEGACY_SSH_GETFILES) | 200 caps.append(constants.NETWORK_CAP_LEGACY_SSH_GETFILES) |
201 caps.append('getflogheads') | 201 caps.append('x_rfl_getflogheads') |
202 caps.append('getfile') | 202 caps.append('x_rfl_getfile') |
203 return caps | 203 return caps |
204 extensions.wrapfunction(wireprotov1server, '_capabilities', _capabilities) | 204 extensions.wrapfunction(wireprotov1server, '_capabilities', _capabilities) |
205 | 205 |
206 def _adjustlinkrev(orig, self, *args, **kwargs): | 206 def _adjustlinkrev(orig, self, *args, **kwargs): |
207 # When generating file blobs, taking the real path is too slow on large | 207 # When generating file blobs, taking the real path is too slow on large |
213 | 213 |
214 extensions.wrapfunction( | 214 extensions.wrapfunction( |
215 context.basefilectx, '_adjustlinkrev', _adjustlinkrev) | 215 context.basefilectx, '_adjustlinkrev', _adjustlinkrev) |
216 | 216 |
217 def _iscmd(orig, cmd): | 217 def _iscmd(orig, cmd): |
218 if cmd == 'getfiles': | 218 if cmd == 'x_rfl_getfiles': |
219 return False | 219 return False |
220 return orig(cmd) | 220 return orig(cmd) |
221 | 221 |
222 extensions.wrapfunction(wireprotoserver, 'iscmd', _iscmd) | 222 extensions.wrapfunction(wireprotoserver, 'iscmd', _iscmd) |
223 | 223 |