##// END OF EJS Templates
largefiles: modernize how capabilities are added to the wire protocol...
Matt Harbison -
r35523:95a9be56 @17 default
parent child Browse files
Show More
@@ -28,7 +28,6 b" LARGEFILES_REQUIRED_MSG = ('\\nThis repos"
28 'file.\n')
28 'file.\n')
29
29
30 # these will all be replaced by largefiles.uisetup
30 # these will all be replaced by largefiles.uisetup
31 capabilitiesorig = None
32 ssholdcallstream = None
31 ssholdcallstream = None
33 httpoldcallstream = None
32 httpoldcallstream = None
34
33
@@ -161,9 +160,11 b' def wirereposetup(ui, repo):'
161 repo.__class__ = lfileswirerepository
160 repo.__class__ = lfileswirerepository
162
161
163 # advertise the largefiles=serve capability
162 # advertise the largefiles=serve capability
164 def capabilities(repo, proto):
163 def _capabilities(orig, repo, proto):
165 '''Wrap server command to announce largefile server capability'''
164 '''announce largefile server capability'''
166 return capabilitiesorig(repo, proto) + ' largefiles=serve'
165 caps = orig(repo, proto)
166 caps.append('largefiles=serve')
167 return caps
167
168
168 def heads(repo, proto):
169 def heads(repo, proto):
169 '''Wrap server command - largefile capable clients will know to call
170 '''Wrap server command - largefile capable clients will know to call
@@ -166,7 +166,6 b' def uisetup(ui):'
166 wireproto.commands['statlfile'] = (proto.statlfile, 'sha')
166 wireproto.commands['statlfile'] = (proto.statlfile, 'sha')
167
167
168 # ... and wrap some existing ones
168 # ... and wrap some existing ones
169 wireproto.commands['capabilities'] = (proto.capabilities, '')
170 wireproto.commands['heads'] = (proto.heads, '')
169 wireproto.commands['heads'] = (proto.heads, '')
171 wireproto.commands['lheads'] = (wireproto.heads, '')
170 wireproto.commands['lheads'] = (wireproto.heads, '')
172
171
@@ -178,10 +177,7 b' def uisetup(ui):'
178
177
179 extensions.wrapfunction(webcommands, 'decodepath', overrides.decodepath)
178 extensions.wrapfunction(webcommands, 'decodepath', overrides.decodepath)
180
179
181 # the hello wireproto command uses wireproto.capabilities, so it won't see
180 extensions.wrapfunction(wireproto, '_capabilities', proto._capabilities)
182 # our largefiles capability unless we replace the actual function as well.
183 proto.capabilitiesorig = wireproto.capabilities
184 wireproto.capabilities = proto.capabilities
185
181
186 # can't do this in reposetup because it needs to have happened before
182 # can't do this in reposetup because it needs to have happened before
187 # wirerepo.__init__ is called
183 # wirerepo.__init__ is called
General Comments 0
You need to be logged in to leave comments. Login now