Show More
@@ -487,19 +487,6 b' def setup():' | |||
|
487 | 487 | origcgfn(*args, **kwargs) |
|
488 | 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 | 490 | # Extend changegroup receiver so client can fixup after widen requests. |
|
504 | 491 | origcghandler = bundle2.parthandlermapping['changegroup'] |
|
505 | 492 | def wrappedcghandler(op, inpart): |
@@ -44,6 +44,8 b' from .utils import (' | |||
|
44 | 44 | urlerr = util.urlerr |
|
45 | 45 | urlreq = util.urlreq |
|
46 | 46 | |
|
47 | _NARROWACL_SECTION = 'narrowhgacl' | |
|
48 | ||
|
47 | 49 | # Maps bundle version human names to changegroup versions. |
|
48 | 50 | _bundlespeccgversions = {'v1': '01', |
|
49 | 51 | 'v2': '02', |
@@ -2069,8 +2071,13 b' def _getbundlerevbranchcache(bundler, re' | |||
|
2069 | 2071 | # Don't send unless: |
|
2070 | 2072 | # - changeset are being exchanged, |
|
2071 | 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 | 2079 | return |
|
2080 | ||
|
2074 | 2081 | outgoing = _computeoutgoing(repo, heads, common) |
|
2075 | 2082 | bundle2.addpartrevbranchcache(repo, bundler, outgoing) |
|
2076 | 2083 |
General Comments 0
You need to be logged in to leave comments.
Login now