hgext/narrow/narrowbundle2.py
changeset 36357 adce75cdf8f8
parent 36355 cd4f13f1ea2f
child 36464 3f0af89e008d
equal deleted inserted replaced
36356:7e97174a1835 36357:adce75cdf8f8
   257                 narrowspecpart.addparam(
   257                 narrowspecpart.addparam(
   258                     _SPECPART_EXCLUDE, '\n'.join(exclude), mandatory=True)
   258                     _SPECPART_EXCLUDE, '\n'.join(exclude), mandatory=True)
   259 
   259 
   260         return
   260         return
   261 
   261 
   262     depth = kwargs.get('depth', None)
   262     depth = kwargs.get(r'depth', None)
   263     if depth is not None:
   263     if depth is not None:
   264         depth = int(depth)
   264         depth = int(depth)
   265         if depth < 1:
   265         if depth < 1:
   266             raise error.Abort(_('depth must be positive, got %d') % depth)
   266             raise error.Abort(_('depth must be positive, got %d') % depth)
   267 
   267 
   268     heads = set(heads or repo.heads())
   268     heads = set(heads or repo.heads())
   269     common = set(common or [nullid])
   269     common = set(common or [nullid])
   270     oldinclude = sorted(filter(bool, kwargs.get('oldincludepats', [])))
   270     oldinclude = sorted(filter(bool, kwargs.get(r'oldincludepats', [])))
   271     oldexclude = sorted(filter(bool, kwargs.get('oldexcludepats', [])))
   271     oldexclude = sorted(filter(bool, kwargs.get(r'oldexcludepats', [])))
   272     known = {bin(n) for n in kwargs.get('known', [])}
   272     known = {bin(n) for n in kwargs.get(r'known', [])}
   273     if known and (oldinclude != include or oldexclude != exclude):
   273     if known and (oldinclude != include or oldexclude != exclude):
   274         # Steps:
   274         # Steps:
   275         # 1. Send kill for "$known & ::common"
   275         # 1. Send kill for "$known & ::common"
   276         #
   276         #
   277         # 2. Send changegroup for ::common
   277         # 2. Send changegroup for ::common
   341     user_includes = [
   341     user_includes = [
   342         'path:.' if p == '*' else 'path:' + p for p in user_includes]
   342         'path:.' if p == '*' else 'path:' + p for p in user_includes]
   343     user_excludes = [
   343     user_excludes = [
   344         'path:.' if p == '*' else 'path:' + p for p in user_excludes]
   344         'path:.' if p == '*' else 'path:' + p for p in user_excludes]
   345 
   345 
   346     req_includes = set(kwargs.get('includepats', []))
   346     req_includes = set(kwargs.get(r'includepats', []))
   347     req_excludes = set(kwargs.get('excludepats', []))
   347     req_excludes = set(kwargs.get(r'excludepats', []))
   348 
   348 
   349     req_includes, req_excludes, invalid_includes = narrowspec.restrictpatterns(
   349     req_includes, req_excludes, invalid_includes = narrowspec.restrictpatterns(
   350         req_includes, req_excludes, user_includes, user_excludes)
   350         req_includes, req_excludes, user_includes, user_excludes)
   351 
   351 
   352     if invalid_includes:
   352     if invalid_includes: