hgext/narrow/narrowbundle2.py
changeset 36967 f62873dba3fd
parent 36632 9e2866065982
child 37084 f0b6fbea00cf
equal deleted inserted replaced
36966:c0e90df1ab1e 36967:f62873dba3fd
   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'):