Mercurial > evolve
comparison hgext/simple4server.py @ 1253:d03583da89c4 stable
pull: fix bundle2 part generation
The new part generator (allowing partial pull) was unproperly installed.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 20 Apr 2015 13:36:12 +0200 |
parents | d001376b0c09 |
children | c52c15100fb2 |
comparison
equal
deleted
inserted
replaced
1252:d001376b0c09 | 1253:d03583da89c4 |
---|---|
253 caps += ' _evoext_obshash_0' | 253 caps += ' _evoext_obshash_0' |
254 caps += ' _evoext_obshash_1' | 254 caps += ' _evoext_obshash_1' |
255 caps += ' _evoext_getbundle_obscommon' | 255 caps += ' _evoext_getbundle_obscommon' |
256 return caps | 256 return caps |
257 | 257 |
258 def _getbundleobsmarkerpart(orig, bundler, repo, source, heads=None, common=None, | 258 def _getbundleobsmarkerpart(orig, bundler, repo, source, **kwargs): |
259 bundlecaps=None, **kwargs): | |
260 if 'evo_obscommon' not in kwargs: | 259 if 'evo_obscommon' not in kwargs: |
261 return orig(bundler, repo, source, heads, common, bundlecaps, **kwargs) | 260 return orig(bundler, repo, source, **kwargs) |
261 | |
262 heads = kwargs.get('heads') | |
263 if 'evo_obscommon' not in kwargs: | |
264 return orig(bundler, repo, source, **kwargs) | |
262 | 265 |
263 if kwargs.get('obsmarkers', False): | 266 if kwargs.get('obsmarkers', False): |
264 if heads is None: | 267 if heads is None: |
265 heads = repo.heads() | 268 heads = repo.heads() |
266 obscommon = kwargs.get('evo_obscommon', ()) | 269 obscommon = kwargs.get('evo_obscommon', ()) |
282 hgweb_mod.perms['evoext_obshash'] = 'pull' | 285 hgweb_mod.perms['evoext_obshash'] = 'pull' |
283 wireproto.commands['evoext_pushobsmarkers_0'] = (srv_pushobsmarkers, '') | 286 wireproto.commands['evoext_pushobsmarkers_0'] = (srv_pushobsmarkers, '') |
284 wireproto.commands['evoext_pullobsmarkers_0'] = (srv_pullobsmarkers, '*') | 287 wireproto.commands['evoext_pullobsmarkers_0'] = (srv_pullobsmarkers, '*') |
285 # wrap module content | 288 # wrap module content |
286 extensions.wrapfunction(exchange, '_pullbundle2extraprepare', _getbundleobsmarkerpart) | 289 extensions.wrapfunction(exchange, '_pullbundle2extraprepare', _getbundleobsmarkerpart) |
290 origfunc = exchange.getbundle2partsmapping['obsmarkers'] | |
291 def newfunc(*args, **kwargs): | |
292 return _getbundleobsmarkerpart(origfunc, *args, **kwargs) | |
293 exchange.getbundle2partsmapping['obsmarkers'] = newfunc | |
287 extensions.wrapfunction(wireproto, 'capabilities', capabilities) | 294 extensions.wrapfunction(wireproto, 'capabilities', capabilities) |
288 # wrap command content | 295 # wrap command content |
289 oldcap, args = wireproto.commands['capabilities'] | 296 oldcap, args = wireproto.commands['capabilities'] |
290 def newcap(repo, proto): | 297 def newcap(repo, proto): |
291 return capabilities(oldcap, repo, proto) | 298 return capabilities(oldcap, repo, proto) |