477 getbundlechangegrouppart_narrow(*args, **kwargs) |
477 getbundlechangegrouppart_narrow(*args, **kwargs) |
478 else: |
478 else: |
479 origcgfn(*args, **kwargs) |
479 origcgfn(*args, **kwargs) |
480 exchange.getbundle2partsmapping['changegroup'] = wrappedcgfn |
480 exchange.getbundle2partsmapping['changegroup'] = wrappedcgfn |
481 |
481 |
|
482 # disable rev branch cache exchange when serving a narrow bundle |
|
483 # (currently incompatible with that part) |
|
484 origrbcfn = exchange.getbundle2partsmapping['cache:rev-branch-cache'] |
|
485 def wrappedcgfn(*args, **kwargs): |
|
486 repo = args[1] |
|
487 if repo.ui.has_section(_NARROWACL_SECTION): |
|
488 return |
|
489 elif kwargs.get(r'narrow', False): |
|
490 return |
|
491 else: |
|
492 origrbcfn(*args, **kwargs) |
|
493 exchange.getbundle2partsmapping['cache:rev-branch-cache'] = wrappedcgfn |
|
494 |
482 # Extend changegroup receiver so client can fixup after widen requests. |
495 # Extend changegroup receiver so client can fixup after widen requests. |
483 origcghandler = bundle2.parthandlermapping['changegroup'] |
496 origcghandler = bundle2.parthandlermapping['changegroup'] |
484 def wrappedcghandler(op, inpart): |
497 def wrappedcghandler(op, inpart): |
485 origcghandler(op, inpart) |
498 origcghandler(op, inpart) |
486 if util.safehasattr(op, '_widen_bundle'): |
499 if util.safehasattr(op, '_widen_bundle'): |