This gets test-narrow.t to *almost* pass. Something appears to be
borked in producing bundles, but only some of the time? I'm lost, but
this change is at least a clear improvement.
- skip-blame just more r prefixes on strings
This gets test-narrow.t to *almost* pass. Something appears to be
borked in producing bundles, but only some of the time? I'm lost, but
this change is at least a clear improvement.
Lint Skipped |
Unit Tests Skipped |
narrowspecpart.addparam( | narrowspecpart.addparam( | ||||
_SPECPART_INCLUDE, '\n'.join(include), mandatory=True) | _SPECPART_INCLUDE, '\n'.join(include), mandatory=True) | ||||
if exclude: | if exclude: | ||||
narrowspecpart.addparam( | narrowspecpart.addparam( | ||||
_SPECPART_EXCLUDE, '\n'.join(exclude), mandatory=True) | _SPECPART_EXCLUDE, '\n'.join(exclude), mandatory=True) | ||||
return | return | ||||
depth = kwargs.get('depth', None) | depth = kwargs.get(r'depth', None) | ||||
if depth is not None: | if depth is not None: | ||||
depth = int(depth) | depth = int(depth) | ||||
if depth < 1: | if depth < 1: | ||||
raise error.Abort(_('depth must be positive, got %d') % depth) | raise error.Abort(_('depth must be positive, got %d') % depth) | ||||
heads = set(heads or repo.heads()) | heads = set(heads or repo.heads()) | ||||
common = set(common or [nullid]) | common = set(common or [nullid]) | ||||
oldinclude = sorted(filter(bool, kwargs.get('oldincludepats', []))) | oldinclude = sorted(filter(bool, kwargs.get(r'oldincludepats', []))) | ||||
oldexclude = sorted(filter(bool, kwargs.get('oldexcludepats', []))) | oldexclude = sorted(filter(bool, kwargs.get(r'oldexcludepats', []))) | ||||
known = {bin(n) for n in kwargs.get('known', [])} | known = {bin(n) for n in kwargs.get(r'known', [])} | ||||
if known and (oldinclude != include or oldexclude != exclude): | if known and (oldinclude != include or oldexclude != exclude): | ||||
# Steps: | # Steps: | ||||
# 1. Send kill for "$known & ::common" | # 1. Send kill for "$known & ::common" | ||||
# | # | ||||
# 2. Send changegroup for ::common | # 2. Send changegroup for ::common | ||||
# | # | ||||
# 3. Proceed. | # 3. Proceed. | ||||
# | # | ||||
raise error.Abort(_("{} configuration for user {} is empty") | raise error.Abort(_("{} configuration for user {} is empty") | ||||
.format(_NARROWACL_SECTION, username)) | .format(_NARROWACL_SECTION, username)) | ||||
user_includes = [ | user_includes = [ | ||||
'path:.' if p == '*' else 'path:' + p for p in user_includes] | 'path:.' if p == '*' else 'path:' + p for p in user_includes] | ||||
user_excludes = [ | user_excludes = [ | ||||
'path:.' if p == '*' else 'path:' + p for p in user_excludes] | 'path:.' if p == '*' else 'path:' + p for p in user_excludes] | ||||
req_includes = set(kwargs.get('includepats', [])) | req_includes = set(kwargs.get(r'includepats', [])) | ||||
req_excludes = set(kwargs.get('excludepats', [])) | req_excludes = set(kwargs.get(r'excludepats', [])) | ||||
req_includes, req_excludes, invalid_includes = narrowspec.restrictpatterns( | req_includes, req_excludes, invalid_includes = narrowspec.restrictpatterns( | ||||
req_includes, req_excludes, user_includes, user_excludes) | req_includes, req_excludes, user_includes, user_excludes) | ||||
if invalid_includes: | if invalid_includes: | ||||
raise error.Abort( | raise error.Abort( | ||||
_("The following includes are not accessible for {}: {}") | _("The following includes are not accessible for {}: {}") | ||||
.format(username, invalid_includes)) | .format(username, invalid_includes)) |