##// END OF EJS Templates
exchange: move disabling of rev-branch-cache bundle part out of narrow...
Gregory Szorc -
r38825:9b64b73d default
parent child Browse files
Show More
@@ -487,19 +487,6 b' def setup():'
487 origcgfn(*args, **kwargs)
487 origcgfn(*args, **kwargs)
488 exchange.getbundle2partsmapping['changegroup'] = wrappedcgfn
488 exchange.getbundle2partsmapping['changegroup'] = wrappedcgfn
489
489
490 # disable rev branch cache exchange when serving a narrow bundle
491 # (currently incompatible with that part)
492 origrbcfn = exchange.getbundle2partsmapping['cache:rev-branch-cache']
493 def wrappedcgfn(*args, **kwargs):
494 repo = args[1]
495 if repo.ui.has_section(_NARROWACL_SECTION):
496 return
497 elif kwargs.get(r'narrow', False):
498 return
499 else:
500 origrbcfn(*args, **kwargs)
501 exchange.getbundle2partsmapping['cache:rev-branch-cache'] = wrappedcgfn
502
503 # Extend changegroup receiver so client can fixup after widen requests.
490 # Extend changegroup receiver so client can fixup after widen requests.
504 origcghandler = bundle2.parthandlermapping['changegroup']
491 origcghandler = bundle2.parthandlermapping['changegroup']
505 def wrappedcghandler(op, inpart):
492 def wrappedcghandler(op, inpart):
@@ -44,6 +44,8 b' from .utils import ('
44 urlerr = util.urlerr
44 urlerr = util.urlerr
45 urlreq = util.urlreq
45 urlreq = util.urlreq
46
46
47 _NARROWACL_SECTION = 'narrowhgacl'
48
47 # Maps bundle version human names to changegroup versions.
49 # Maps bundle version human names to changegroup versions.
48 _bundlespeccgversions = {'v1': '01',
50 _bundlespeccgversions = {'v1': '01',
49 'v2': '02',
51 'v2': '02',
@@ -2069,8 +2071,13 b' def _getbundlerevbranchcache(bundler, re'
2069 # Don't send unless:
2071 # Don't send unless:
2070 # - changeset are being exchanged,
2072 # - changeset are being exchanged,
2071 # - the client supports it.
2073 # - the client supports it.
2072 if not (kwargs.get(r'cg', True)) or 'rev-branch-cache' not in b2caps:
2074 # - narrow bundle isn't in play (not currently compatible).
2075 if (not kwargs.get(r'cg', True)
2076 or 'rev-branch-cache' not in b2caps
2077 or kwargs.get(r'narrow', False)
2078 or repo.ui.has_section(_NARROWACL_SECTION)):
2073 return
2079 return
2080
2074 outgoing = _computeoutgoing(repo, heads, common)
2081 outgoing = _computeoutgoing(repo, heads, common)
2075 bundle2.addpartrevbranchcache(repo, bundler, outgoing)
2082 bundle2.addpartrevbranchcache(repo, bundler, outgoing)
2076
2083
General Comments 0
You need to be logged in to leave comments. Login now