mercurial/exchange.py
changeset 38789 9b64b73d702b
parent 38614 4d5fb4062f0b
child 38790 3e7387337a3c
equal deleted inserted replaced
38788:a9ff2b0c11dd 38789:9b64b73d702b
    41     stringutil,
    41     stringutil,
    42 )
    42 )
    43 
    43 
    44 urlerr = util.urlerr
    44 urlerr = util.urlerr
    45 urlreq = util.urlreq
    45 urlreq = util.urlreq
       
    46 
       
    47 _NARROWACL_SECTION = 'narrowhgacl'
    46 
    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',
    50                          'packed1': 's1',
    52                          'packed1': 's1',
  2067     5) closed heads nodes
  2069     5) closed heads nodes
  2068     """
  2070     """
  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).
  2073         return
  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)):
       
  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 
  2077 def check_heads(repo, their_heads, context):
  2084 def check_heads(repo, their_heads, context):
  2078     """check if the heads of a repo have been modified
  2085     """check if the heads of a repo have been modified