hgext/narrow/narrowbundle2.py
changeset 38789 9b64b73d702b
parent 38529 1ad873c3e4a4
child 38790 3e7387337a3c
equal deleted inserted replaced
38788:a9ff2b0c11dd 38789:9b64b73d702b
   485             getbundlechangegrouppart_narrow(*args, **kwargs)
   485             getbundlechangegrouppart_narrow(*args, **kwargs)
   486         else:
   486         else:
   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):
   506         origcghandler(op, inpart)
   493         origcghandler(op, inpart)
   507         if util.safehasattr(op, '_widen_bundle'):
   494         if util.safehasattr(op, '_widen_bundle'):